ansible/roles/omm/tasks/main.yml

74 lines
1.9 KiB
YAML
Raw Normal View History

2021-11-19 23:23:45 +01:00
---
- name: Install dependencies
apt:
name:
- alien
- sysvinit-utils
- name: Add i386 architecture
command: dpkg --add-architecture i386
args:
creates: /var/lib/dpkg/arch
when: ansible_architecture != 'i386'
register: add_i386
- name: Install 32bit dependencies
apt:
name:
- libstdc++6:i386
- zlib1g:i386
update_cache: "{{ add_i386.changed }}"
# TODO manual steps
2024-01-11 22:25:53 +01:00
# alien --target=amd64 /tmp/SIP-DECT-OMM-9.0__HF02IK26-0.i686.rpm
# dpkg -i sip-dect-omm_9.0HF02IK26-1_amd64.deb
# alien --target=amd64 /tmp/SIP-DECT-HANDSET-9.0__HF02IK26-0.i686.rpm
# dpkg -i sip-dect-handset_9.0HF02IK26-1_amd64.deb
2021-11-19 23:23:45 +01:00
# rm /etc/init.d/sip-dect-omm
# rm /etc/sysconfig/SIP-DECT
2024-01-11 22:25:53 +01:00
# TODO tftp for iprfp3G.dnld
2021-11-19 23:23:45 +01:00
- name: Install systemd units
template: src={{ item }}.service.j2 dest=/lib/systemd/system/{{ item }}.service
with_items:
- sip-dect-ics
- sip-dect-omm
notify:
- Reload systemd
- Restart sip-dect-ics
- Restart sip-dect-omm
- name: Enable services
service: name={{ item }} state=started enabled=yes
with_items:
- sip-dect-ics
- sip-dect-omm
- name: Ensure certificates are available
command:
cmd: >
openssl req -x509 -nodes -newkey rsa:2048
-keyout /etc/nginx/ssl/{{ omm_domain }}.key -out /etc/nginx/ssl/{{ omm_domain }}.crt
-days 730 -subj "/CN={{ omm_domain }}"
creates: /etc/nginx/ssl/{{ omm_domain }}.crt
notify: Restart nginx
- name: Request nsupdate key for certificate
include_role: name=acme-dnskey-generate
vars:
acme_dnskey_san_domains:
- "{{ omm_domain }}"
- name: Configure certificate manager for omm
template: src=certs.j2 dest=/etc/acertmgr/{{ omm_domain }}.conf
notify: Run acertmgr
- name: Configure vhost
template: src=vhost.j2 dest=/etc/nginx/sites-available/omm
notify: Restart nginx
- name: Enable vhost
file: src=/etc/nginx/sites-available/omm dest=/etc/nginx/sites-enabled/omm state=link
notify: Restart nginx