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

amarisoft upgrade

parent 574af5ef
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
vars_files:
- settings/ors.yml
roles:
- amarisoft-upgrade
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
vars_files:
- settings/ors.yml
roles:
- generate-key
---
- name: Create directory if it does not exist
file: path=/opt/amarisoft/{{ amarisoft_version }} state=directory mode=0755
- name: Create directory if it does not exist
file: path=/opt/amarisoft/_{{ amarisoft_version }} state=directory mode=0755
- name: Decrypt key
shell: 'openssl pkeyutl -decrypt -in /root/ors78_symmetric_keyfile.key.enc -inkey /opt/ssl/private_key.pem -out /tmp/symmetric_keyfile.key'
- name: Decrypt archive
shell: 'openssl aes-256-cbc -d -pbkdf2 -in /root/amarisoft.{{ amarisoft_version }}.tar.gz.enc -out {{ install_folder }}/amarisoft.tar.gz -kfile /tmp/symmetric_keyfile.key'
- name: Extract archive
unarchive:
src: "{{ install_folder }}/amarisoft.tar.gz"
dest: "{{ install_folder }}"
- name: Extract lteenb archive
unarchive:
src: "{{ install_folder }}/{{ amarisoft_version }}/lteenb-linux-{{ amarisoft_version }}.tar.gz"
dest: "{{ install_folder }}/_{{ amarisoft_version }}"
- name: Extract ltemme archive
unarchive:
src: "{{ install_folder }}/{{ amarisoft_version }}/ltemme-linux-{{ amarisoft_version }}.tar.gz"
dest: "{{ install_folder }}/_{{ amarisoft_version }}"
- name: Extract trx_sdr archive
unarchive:
src: "{{ install_folder }}/{{ amarisoft_version }}/trx_sdr-linux-{{ amarisoft_version }}.tar.gz"
dest: "{{ install_folder }}/_{{ amarisoft_version }}"
- name: Create a symbolic link for lteenb
file:
src: "lteenb-linux-{{ amarisoft_version }}"
dest: "{{ install_folder }}/_{{ amarisoft_version }}/enb"
state: link
- name: Create a symbolic link for ltemme
file:
src: "ltemme-linux-{{ amarisoft_version }}"
dest: "{{ install_folder }}/_{{ amarisoft_version }}/mme"
state: link
- name: Create a symbolic link for trx_sdr
file:
src: "trx_sdr-linux-{{ amarisoft_version }}"
dest: "{{ install_folder }}/_{{ amarisoft_version }}/trx_sdr"
state: link
- name: Copy trx_sdr libraries
shell: 'cp {{ install_folder }}/_{{ amarisoft_version }}/trx_sdr/*.so {{ install_folder }}/_{{ amarisoft_version }}/enb/'
- name: Move amarisoft folder
shell: 'mv {{ install_folder }}/_{{ amarisoft_version }} {{ install_folder }}/v{{ amarisoft_version }}'
- name: Remove extraction folder
file:
path: "{{ install_folder }}/{{ amarisoft_version }}"
state: absent
---
- name: Create directory if it does not exist
file: path=/opt/ssl/ state=directory mode=0755
- name: Generate private key
shell: 'openssl genrsa -out /opt/ssl/private_key.pem 4096'
- name: Generate certificate request
shell: "openssl req -new -key /opt/ssl/private_key.pem -subj '/CN={{ ansible_hostname }}' -out /opt/ssl/cert_request.csr"
- name: Get monitor private directory path
shell: 'realpath $(dirname $(grep -lR "software_release_url = .*software/monitor/software.cfg" $(find /srv/slapgrid -type f -name "buildout.cfg")))/srv/monitor/private'
register: monitor_path
- name: Create directory if it does not exist
file: path="{{ monitor_path.stdout }}/playbook-report" state=directory mode=0755
- name: Copy certificate request
copy: src=/opt/ssl/cert_request.csr dest={{ monitor_path.stdout }}/playbook-report/cert_request.csr owner=root mode=774
- name: Render log template
template:
src: ansible-report.j2
dest: /tmp/ansible-report-tmp.log
- name: Append to log
shell: 'cat /tmp/ansible-report-tmp.log >> {{ monitor_path.stdout }}/playbook-report/report.log'
{"time": "{{ ansible_date_time['date'] }} {{ ansible_date_time['time'] }}", "log_level": "INFO", "message": "msg"}
---
install_folder: "/opt/amarisoft"
amarisoft_version: "2023-06-10"
launch_upgrader: True
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