Commit a484c07d authored by Joanne Hugé's avatar Joanne Hugé

playbook/ors: reorganize tasks

parent 80690b3c
---
# Delete ors-upgrade.yml cron which is replaced by ors.yml
# Legacy
- name: Remove obsolete cron
cron: name="Launch Upgrader with ansible" state=absent
......@@ -17,8 +17,24 @@
- name: Remove obsolete cron
cron: name="Launch ors playbook every 3 hours" state=absent
- name: Enable and start cron.service
systemd: name=cron.service enabled=yes state=started
- 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
# 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
file: path=/opt/amarisoft state=directory mode=0755
......@@ -32,21 +48,6 @@
- name: Copy rm-tmp-lte script
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
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
......@@ -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'
when: lteenb_avx2_cap.rc != 0
- name: Configure re6st
script: configure-re6st
- name: Create .amarisoft directory for SR
file: path=/opt/amarisoft/.amarisoft state=directory
- name: Configure /etc/network/interfaces
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: Configure dhcp timeout
lineinfile: dest=/etc/dhcp/dhclient.conf regexp="^timeout (.*)" line="timeout 15" state=present
- name: Configure sudoers
script: configure-sudoers
- name: Configure journald log size
lineinfile: dest=/etc/systemd/journald.conf regexp="^SystemMaxUse=(.*)" line="SystemMaxUse=1G" state=present
# Re6st
- name: Configure ssh
lineinfile: dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (.*)" line="PermitRootLogin yes" state=present
- name: Configure re6st
script: configure-re6st
- name: Configure ssh
lineinfile: dest=/etc/ssh/sshd_config regexp="^PasswordAuthentication (.*)" line="PasswordAuthentication yes" state=present
# Slapos
- name: Enable and start cron.service
systemd: name=cron.service enabled=yes state=started
- name: Configure slapos
script: configure-slapos.py
- name: Configure sudoers
script: configure-sudoers
# Network
- name: Create .amarisoft directory for SR
file: path=/opt/amarisoft/.amarisoft state=directory
- name: Copy keys for SR
copy: src=/root/.amarisoft dest=/opt/amarisoft owner=root mode=644
ignore_errors: yes
- name: Configure /etc/network/interfaces
copy: src=interfaces dest=/etc/network/interfaces owner=root mode=644
- name: Add kernel parameter
script: configure-grub
- name: Configure dhcp timeout
lineinfile: dest=/etc/dhcp/dhclient.conf regexp="^timeout (.*)" line="timeout 15" state=present
- name: Disable dnsmasq service
systemd: name=dnsmasq.service enabled=no state=stopped
......@@ -149,6 +147,24 @@
source_port: 5353
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
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
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