1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Asterisk deps + enable; PBX 6 -> 9

This commit is contained in:
root 2021-08-03 17:09:58 -04:00
parent 5c10b89dd0
commit b41fe01cd5
6 changed files with 71 additions and 50 deletions

View file

@ -61,11 +61,6 @@
name: nextcloud
when: nextcloud_install
- name: PBX
include_role:
name: pbx
when: pbx_install
- name: WORDPRESS
include_role:
name: wordpress

View file

@ -3,22 +3,27 @@
- name: ...IS BEGINNING ====================================
meta: noop
- name: INTERNETARCHIVE
include_role:
name: internetarchive
when: internetarchive_install
# Is porting to Python 3 complete, and if so does this belong elsewhere?
- name: CAPTIVE PORTAL
include_role:
name: captiveportal
when: captiveportal_install
- name: INTERNETARCHIVE
include_role:
name: internetarchive
when: internetarchive_install
- name: MINETEST
include_role:
name: minetest
when: minetest_install
- name: PBX - Asterisk & FreePBX
include_role:
name: pbx
when: pbx_install
# KEEP AT THE END as this installs dependencies from Debian's 'testing' branch!
- name: CALIBRE
include_role:

View file

@ -1,5 +1,6 @@
- name: Asterisk - Install dependencies
include: asterisk_dependencies.yml
# 2021-08-03: Not nec on Debian 11, and hopefully other OS's likewise
#- name: Asterisk - Install dependencies
# include: asterisk_dependencies.yml
- name: Asterisk - Download software to /opt/iiab/downloads
get_url:
@ -32,13 +33,10 @@
extra_opts: [--strip-components=1]
creates: "{{ asterisk_src_dir }}/Makefile"
- name: Asterisk - Download mp3 decoder library into source tree
command: ./contrib/scripts/get_mp3_source.sh
args:
chdir: "{{ asterisk_src_dir }}"
creates: addons/mp3/mpg123.h
# 2021-08-03: Experiment w/o aptitude
# 2021-08-03: Asterisk's install_prereq script (stanza just below) installs
# 'aptitude' regardless, within handle_debian() here:
# https://github.com/asterisk/asterisk/blob/master/contrib/scripts/install_prereq#L262-L271
#
#- name: Asterisk - Install aptitude (otherwise install_prereq fails?)
# package:
# name: aptitude
@ -49,6 +47,13 @@
args:
chdir: "{{ asterisk_src_dir }}"
# 2021-08-03: Requires subversion (installed just above)
- name: Asterisk - Download mp3 decoder library into source tree
command: ./contrib/scripts/get_mp3_source.sh
args:
chdir: "{{ asterisk_src_dir }}"
creates: addons/mp3/mpg123.h
- name: Asterisk - Run the configure script
command: ./configure --with-jansson-bundled
args:

View file

@ -0,0 +1,44 @@
- name: Enable & (Re)start 'asterisk' systemd service (if pbx_enabled)
systemd:
daemon_reload: yes
name: asterisk
enabled: yes
state: restarted
when: pbx_enabled
- name: Disable & Stop 'asterisk' systemd service (if not pbx_enabled)
systemd:
daemon_reload: yes
name: asterisk
enabled: no
state: stopped
when: not pbx_enabled
- name: Enable & (Re)start 'freepbx' systemd service (if pbx_enabled)
systemd:
name: freepbx
enabled: yes
state: restarted
when: pbx_enabled
- name: Disable & Stop 'freepbx' systemd service (if not pbx_enabled)
systemd:
name: freepbx
enabled: no
state: stopped
when: not pbx_enabled
- name: Enable http://box:{{ pbx_http_port }}/freepbx via Apache, if pbx_enabled # http://box:83/freepbx
command: a2ensite freepbx.conf
when: pbx_enabled
- name: Disable http://box:{{ pbx_http_port }}/freepbx via Apache, if not pbx_enabled
command: a2dissite freepbx.conf
when: not pbx_enabled
- name: Restart Apache service ({{ apache_service }})
systemd:
name: "{{ apache_service }}" # httpd or apache2
state: restarted

View file

@ -1,28 +0,0 @@
- name: FreePBX - Enable & (Re)start 'freepbx' systemd service (if pbx_enabled)
systemd:
daemon_reload: yes
name: freepbx
enabled: yes
state: restarted
when: pbx_enabled
- name: FreePBX - Disable & Stop 'freepbx' systemd service (if not pbx_enabled)
systemd:
daemon_reload: yes
name: freepbx
enabled: no
state: stopped
when: not pbx_enabled
- name: FreePBX - Enable http://box:{{ pbx_http_port }} via Apache, if pbx_enabled # http://box:83
command: a2ensite freepbx.conf
when: pbx_enabled
- name: FreePBX - Disable http://box:{{ pbx_http_port }} via Apache, if not pbx_enabled # http://box:83
command: a2dissite freepbx.conf
when: not pbx_enabled
- name: FreePBX - Restart Apache service ({{ apache_service }})
systemd:
name: "{{ apache_service }}" # httpd or apache2
state: restarted

View file

@ -23,14 +23,14 @@
include_tasks: install.yml
when: pbx_installed is undefined
- name: Enable FreePBX (debuntu)
include_tasks: freepbx_enable.yml
when: pbx_installed is defined
- include_tasks: enable-or-disable.yml
- name: Asterisk - Install chan_dongle
include: chan_dongle.yml
when: asterisk_chan_dongle
- name: Add 'pbx' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini