Commit 7ced67af authored by Joanne Hugé's avatar Joanne Hugé

playbook/ors: reorganize tasks

parent 45054798
--- ---
# Delete ors-upgrade.yml cron which is replaced by ors.yml # Legacy
- name: Remove obsolete cron - name: Remove obsolete cron
cron: name="Launch Upgrader with ansible" state=absent cron: name="Launch Upgrader with ansible" state=absent
...@@ -17,8 +17,24 @@ ...@@ -17,8 +17,24 @@
- name: Remove obsolete cron - name: Remove obsolete cron
cron: name="Launch ors playbook every 3 hours" state=absent cron: name="Launch ors playbook every 3 hours" state=absent
- name: Enable and start cron.service - name: Check if Service Exists
systemd: name=cron.service enabled=yes state=started stat: path=/etc/init.d/init-sdr
register: init_sdr_service
- name: Reload daemon
systemd: daemon_reload=yes
when: init_sdr_service.stat.exists
- name: Disable old init-sdr service
systemd: name=init-sdr enabled=no
when: init_sdr_service.stat.exists
# Radio Hardware
- name: Copy get-sdr-info script
copy: src=get-sdr-info dest=/opt/amarisoft owner=root mode=770
# Amarisoft software
- name: Create a directory if it does not exist - name: Create a directory if it does not exist
file: path=/opt/amarisoft state=directory mode=0755 file: path=/opt/amarisoft state=directory mode=0755
...@@ -32,21 +48,6 @@ ...@@ -32,21 +48,6 @@
- name: Copy rm-tmp-lte script - name: Copy rm-tmp-lte script
copy: src=rm-tmp-lte dest=/opt/amarisoft owner=root mode=770 copy: src=rm-tmp-lte dest=/opt/amarisoft owner=root mode=770
- name: Copy get-sdr-info script
copy: src=get-sdr-info dest=/opt/amarisoft owner=root mode=770
- name: Check if Service Exists
stat: path=/etc/init.d/init-sdr
register: init_sdr_service
- name: Reload daemon
systemd: daemon_reload=yes
when: init_sdr_service.stat.exists
- name: Disable old init-sdr service
systemd: name=init-sdr enabled=no
when: init_sdr_service.stat.exists
- name: Get Amarisoft path - name: Get Amarisoft path
shell: 'find /opt/amarisoft -maxdepth 1 | grep "^/opt/amarisoft/v[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$" | sort | tail -n1' shell: 'find /opt/amarisoft -maxdepth 1 | grep "^/opt/amarisoft/v[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$" | sort | tail -n1'
register: amarisoft_path register: amarisoft_path
...@@ -69,39 +70,36 @@ ...@@ -69,39 +70,36 @@
shell: 'patchelf --set-rpath {{ amarisoft_path.stdout }}/enb {{ amarisoft_path.stdout }}/enb/lteenb-avx2 && setcap cap_sys_nice=+pe {{ amarisoft_path.stdout }}/enb/lteenb-avx2' shell: 'patchelf --set-rpath {{ amarisoft_path.stdout }}/enb {{ amarisoft_path.stdout }}/enb/lteenb-avx2 && setcap cap_sys_nice=+pe {{ amarisoft_path.stdout }}/enb/lteenb-avx2'
when: lteenb_avx2_cap.rc != 0 when: lteenb_avx2_cap.rc != 0
- name: Configure re6st - name: Create .amarisoft directory for SR
script: configure-re6st file: path=/opt/amarisoft/.amarisoft state=directory
- name: Configure /etc/network/interfaces - name: Copy keys for SR
copy: src=interfaces dest=/etc/network/interfaces owner=root mode=644 copy: src=/root/.amarisoft dest=/opt/amarisoft owner=root mode=644
ignore_errors: yes
- name: Configure dhcp timeout - name: Configure sudoers
lineinfile: dest=/etc/dhcp/dhclient.conf regexp="^timeout (.*)" line="timeout 15" state=present script: configure-sudoers
- name: Configure journald log size # Re6st
lineinfile: dest=/etc/systemd/journald.conf regexp="^SystemMaxUse=(.*)" line="SystemMaxUse=1G" state=present
- name: Configure ssh - name: Configure re6st
lineinfile: dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (.*)" line="PermitRootLogin yes" state=present script: configure-re6st
- name: Configure ssh # Slapos
lineinfile: dest=/etc/ssh/sshd_config regexp="^PasswordAuthentication (.*)" line="PasswordAuthentication yes" state=present
- name: Enable and start cron.service
systemd: name=cron.service enabled=yes state=started
- name: Configure slapos - name: Configure slapos
script: configure-slapos.py script: configure-slapos.py
- name: Configure sudoers # Network
script: configure-sudoers
- name: Create .amarisoft directory for SR - name: Configure /etc/network/interfaces
file: path=/opt/amarisoft/.amarisoft state=directory copy: src=interfaces dest=/etc/network/interfaces owner=root mode=644
- name: Copy keys for SR
copy: src=/root/.amarisoft dest=/opt/amarisoft owner=root mode=644
ignore_errors: yes
- name: Add kernel parameter - name: Configure dhcp timeout
script: configure-grub lineinfile: dest=/etc/dhcp/dhclient.conf regexp="^timeout (.*)" line="timeout 15" state=present
- name: Disable dnsmasq service - name: Disable dnsmasq service
systemd: name=dnsmasq.service enabled=no state=stopped systemd: name=dnsmasq.service enabled=no state=stopped
...@@ -149,6 +147,24 @@ ...@@ -149,6 +147,24 @@
source_port: 5353 source_port: 5353
to_source: ':53' to_source: ':53'
# System
- name: Configure journald log size
lineinfile: dest=/etc/systemd/journald.conf regexp="^SystemMaxUse=(.*)" line="SystemMaxUse=1G" state=present
- name: Add kernel parameter
script: configure-grub
# SSH
- name: Configure ssh
lineinfile: dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (.*)" line="PermitRootLogin yes" state=present
- name: Configure ssh
lineinfile: dest=/etc/ssh/sshd_config regexp="^PasswordAuthentication (.*)" line="PasswordAuthentication yes" state=present
# Schedule and upgrade playbook
- name: Install upgrader - name: Install upgrader
shell: ansible-playbook upgrader-run.yml --extra-vars 'extra_playbook={{ extra_playbook }} upgrader_playbook={{ upgrader_playbook }} repeat_until_success={{ repeat_until_success }} upgrade_kernel={{ upgrade_kernel | default(False) == True }}' -i hosts 2>>/opt/upgrader/latest_daily_upgrade.log >> /opt/upgrader/latest_daily_upgrade.log shell: ansible-playbook upgrader-run.yml --extra-vars 'extra_playbook={{ extra_playbook }} upgrader_playbook={{ upgrader_playbook }} repeat_until_success={{ repeat_until_success }} upgrade_kernel={{ upgrade_kernel | default(False) == True }}' -i hosts 2>>/opt/upgrader/latest_daily_upgrade.log >> /opt/upgrader/latest_daily_upgrade.log
when: launch_upgrader when: launch_upgrader
a07e4e316188077fee8abcbb1a31ee7bc9f8de28f55174bdb5c6a238a227df9d - 55ce33d3e89f0093de552d8de66e306b6c142c06a4aa3e36e03954785f720047 -
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment