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

playbook/ors: clean-up file names and add init scripts to /opt/amarisoft

parent bb99c77d
#!/bin/bash
AMARISOFT_PATH="/opt/amarisoft/$(ls -1 /opt/amarisoft | grep "^v[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$" | sort | tail -n1)"
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
$AMARISOFT_PATH/enb/lte_init.sh;
......@@ -8,4 +8,3 @@ lsmod | grep -q sdr && rmmod sdr;
cd $AMARISOFT_PATH/trx_sdr/kernel;
make clean;
bash init.sh;
$AMARISOFT_PATH/enb/lte_init.sh;
---
# Delete ors-upgrade.yml cron which is replaced by ors.yml
#
- name: Check if ors-upgrade playbook is installed
shell: 'crontab -l | grep -q ors-upgrade'
ignore_errors: yes
......@@ -12,7 +12,7 @@
when: ors_upgrade_cron.rc == 0
- name: Check if vifib playbook is installed
shell: 'crontab -l | grep -A1 "#Ansible: Launch Upgrader with ansible" | grep -v ors-upgrade | grep -q upgrader'
shell: 'crontab -l | grep -A1 "#Ansible: Launch Upgrader with ansible" | grep -v ors-upgrade | grep -q "^*/10.*upgrader"'
ignore_errors: yes
register: vifib_cron
......@@ -21,27 +21,44 @@
when: vifib_cron.rc != 0
- name: Install periodic cron
cron: name="Launch ors playbook every 3 hours" minute="15" hour="*/3" job='cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/latest_ors.log >> /opt/upgrader/latest_ors.log'
cron: name="Launch ors playbook periodically" minute="*/10" hour="*" job='cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/latest_ors.log >> /opt/upgrader/latest_ors.log'
- name: Install reboot cron
cron: name="Launch ors playbook at reboot" special_time=reboot job='sleep 20 && cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/startup_ors.log >> /opt/upgrader/startup_ors.log'
- name: Get hostname
shell: hostname
register: hostname
- name: Check hostname
debug: var=hostname
- name: Install rm-tmp-lte script
copy: src=rm-tmp-lte dest={{ install_folder }} owner=root mode=770
- name: Give permission to slapuser to remove tmp files owned by other slapuser
copy: src=slapuser-rm-tmp dest=/etc/sudoers.d owner=root mode=440
- name: Check if /opt/amarisoft exists
stat: path=/opt/amarisoft
register: opt_amarisoft
- 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
when: opt_amarisoft.stat.exists
- name: Check amarisoft_path
debug: var=amarisoft_path
- name: Copy init SDR script
copy: src=init-sdr dest={{ amarisoft_path.stdout }} owner=root
when: opt_amarisoft.stat.exists
- name: Copy init eNB script
copy: src=init-enb dest={{ amarisoft_path.stdout }} owner=root
when: opt_amarisoft.stat.exists
- name: Init SDR
script: init-sdr.sh
script: "{{ amarisoft_path.stdout }}/init-sdr"
when: opt_amarisoft.stat.exists
- name: Init eNB
script: "{{ amarisoft_path.stdout }}/init-enb"
when: opt_amarisoft.stat.exists
- name: Check if Service Exists
stat: path=/etc/init.d/init-sdr
......@@ -56,7 +73,7 @@
when: init_sdr_service.stat.exists
- name: Configure re6st
script: configure-re6st.sh
script: configure-re6st
- name: Configure /etc/network/interfaces
copy: src=interfaces dest=/etc/network/interfaces owner=root mode=644
......@@ -80,4 +97,4 @@
copy: src=/root/.amarisoft dest=/opt/amarisoft owner=root mode=644
- name: Add kernel parameter
script: configure-grub.sh
script: configure-grub
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