Organize and tag roles

This commit is contained in:
Correl Roush 2024-12-03 18:14:01 -05:00
parent 12236c6c8d
commit 909cc137ad
5 changed files with 62 additions and 48 deletions

View file

@ -2,5 +2,7 @@
hosts: asterisk
become: true
roles:
- asterisk
- phone-provisioning
- role: asterisk
tags: asterisk
- role: phone-provisioning
tags: provisioning

View file

@ -0,0 +1,25 @@
- name: Configure extensions
template:
src: extensions.conf.j2
dest: /etc/asterisk/extensions.conf
notify: reload dialplan
- name: Configure SIP clients
template:
src: pjsip.conf.j2
dest: /etc/asterisk/pjsip.conf
notify: reload sip
- name: Configure mailboxes
template:
src: voicemail.conf.j2
dest: /etc/asterisk/voicemail.conf
notify: reload voicemail
- name: Configure HTTP interface
template:
src: http.conf.j2
dest: /etc/asterisk/http.conf
notify: reload core
- name: Configure ARI interface
template:
src: ari.conf.j2
dest: /etc/asterisk/ari.conf
notify: reload core

View file

@ -1,27 +1,8 @@
- name: Configure extensions
template:
src: extensions.conf.j2
dest: /etc/asterisk/extensions.conf
notify: reload dialplan
- name: Configure SIP clients
template:
src: pjsip.conf.j2
dest: /etc/asterisk/pjsip.conf
notify: reload sip
- name: Configure mailboxes
template:
src: voicemail.conf.j2
dest: /etc/asterisk/voicemail.conf
notify: reload voicemail
- name: Configure HTTP interface
template:
src: http.conf.j2
dest: /etc/asterisk/http.conf
notify: reload core
- name: Configure ARI interface
template:
src: ari.conf.j2
dest: /etc/asterisk/ari.conf
notify: reload core
- ansible.builtin.include_tasks:
- name: Configure Asterisk
tags: asterisk-configuration
ansible.builtin.include_tasks:
file: configure_asterisk.yml
- name: Install Voicemail API
tags: voicemail-api
ansible.builtin.include_tasks:
file: install_voicemail_api.yml

View file

@ -0,0 +1,17 @@
- name: Configure TFTP provisioning server
ansible.builtin.lineinfile:
path: /etc/default/tftpd-hpa
regexp: '^TFTP_DIRECTORY='
line: TFTP_DIRECTORY="/var/lib/tftpboot"
notify: restart tftpd
- name: Configure HTTP provisioning server
ansible.builtin.template:
src: 001-tftpboot.conf.j2
dest: /etc/apache2/sites-available/001-tftpboot.conf
notify: reload apache2
- name: Enable HTTP provisioning server
ansible.builtin.file:
src: /etc/apache2/sites-available/001-tftpboot.conf
dest: /etc/apache2/sites-enabled/001-tftpboot.conf
state: link
notify: reload apache2

View file

@ -1,25 +1,14 @@
- ansible.builtin.include_tasks:
- name: Install Apache2
ansible.builtin.include_tasks:
file: install_apache2.yml
- ansible.builtin.include_tasks:
- name: Install TFTPd
ansible.builtin.include_tasks:
file: install_tftpd.yml
- name: Copy phone files
- name: Copy phone provisioning files
tags: phone-configuration
ansible.builtin.copy:
src: tftpboot/
dest: /var/lib/tftpboot/
- name: Configure TFTP provisioning server
ansible.builtin.lineinfile:
path: /etc/default/tftpd-hpa
regexp: '^TFTP_DIRECTORY='
line: TFTP_DIRECTORY="/var/lib/tftpboot"
notify: restart tftpd
- name: Configure HTTP provisioning server
ansible.builtin.template:
src: 001-tftpboot.conf.j2
dest: /etc/apache2/sites-available/001-tftpboot.conf
notify: reload apache2
- name: Enable HTTP provisioning server
ansible.builtin.file:
src: /etc/apache2/sites-available/001-tftpboot.conf
dest: /etc/apache2/sites-enabled/001-tftpboot.conf
state: link
notify: reload apache2
- name: Configure and enable phone provisioning
ansible.builtin.include_tasks:
file: configure_provisioning.yml