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

Community invite to try flag 'pbx_try_nginx: True'

This commit is contained in:
root 2021-08-07 10:09:20 -04:00
parent 6d0ae1fe27
commit d57676dce8
9 changed files with 78 additions and 46 deletions

View file

@ -5,13 +5,16 @@
# pbx_install: False
# pbx_enabled: False
# pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE,
# # AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX !
# asterisk_chan_dongle: False
# pbx_signaling_ports_chan_sip: 5160:5161
# pbx_signaling_ports_chan_pjsip: 5060
# pbx_data_ports: 10000:20000
# pbx_http_port: 83
#
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!

View file

@ -15,33 +15,41 @@
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
- block:
# - name: Disable http://box:{{ pbx_http_port }}/freepbx via Apache, if not pbx_enabled
# command: a2dissite freepbx.conf
# 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: Restart Apache service ({{ apache_service }})
# systemd:
# name: "{{ apache_service }}" # apache2
# state: restarted
- 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 }}" # apache2
state: restarted
when: not pbx_try_nginx
- name: Enable http://box/freepbx via NGINX, by installing {{ nginx_conf_dir }}/freepbx-nginx.conf from template
template:
src: freepbx-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/freepbx-nginx.conf" # /etc/nginx/conf.d
when: pbx_enabled
- block:
- name: Disable http://box/freepbx via NGINX, by removing {{ nginx_conf_dir }}/freepbx-nginx.conf
file:
path: "{{ nginx_conf_dir }}/freepbx-nginx.conf"
state: absent
when: not pbx_enabled
- name: Enable http://box/freepbx via NGINX, by installing {{ nginx_conf_dir }}/freepbx-nginx.conf from template
template:
src: freepbx-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/freepbx-nginx.conf" # /etc/nginx/conf.d
when: pbx_enabled
- name: Restart 'nginx' systemd service
systemd:
name: nginx
state: restarted
- name: Disable http://box/freepbx via NGINX, by removing {{ nginx_conf_dir }}/freepbx-nginx.conf
file:
path: "{{ nginx_conf_dir }}/freepbx-nginx.conf"
state: absent
when: not pbx_enabled
- name: Restart 'nginx' systemd service
systemd:
name: nginx
state: restarted
when: pbx_try_nginx

View file

@ -201,15 +201,19 @@
# line: "$amp_conf['AMPASTERISKWEBUSER'] = 'www-data';"
# - name: FreePBX - Install /etc/apache2/sites-available/freepbx.conf from template ({{ apache_user }}:{{ apache_user }}, 0644 by default)
# template:
# src: freepbx.conf.j2
# dest: /etc/apache2/sites-available/freepbx.conf
# owner: "{{ apache_user }}" # www-data
# group: "{{ apache_user }}"
block:
# - name: FreePBX - Add directive "Listen {{ pbx_http_port }}" to /etc/apache2/ports.conf
# lineinfile:
# path: /etc/apache2/ports.conf
# line: "Listen {{ pbx_http_port }}"
# # insertafter: Listen 80
- name: FreePBX - Install /etc/apache2/sites-available/freepbx.conf from template ({{ apache_user }}:{{ apache_user }}, 0644 by default)
template:
src: freepbx.conf.j2
dest: /etc/apache2/sites-available/freepbx.conf
owner: "{{ apache_user }}" # www-data
group: "{{ apache_user }}"
- name: FreePBX - Add directive "Listen {{ pbx_http_port }}" to /etc/apache2/ports.conf
lineinfile:
path: /etc/apache2/ports.conf
line: "Listen {{ pbx_http_port }}"
# insertafter: Listen 80
when: not pbx_try_nginx

View file

@ -1,4 +1,4 @@
- name: FreePBX - Install dependencies (run 'php -m' or 'php -i' to verify PHP modules)
- name: FreePBX - Install ~19 dependencies (run 'php -m' or 'php -i' to verify PHP modules)
package:
name:
- wget
@ -24,11 +24,16 @@
- php{{ php_version }}-snmp
- php{{ php_version }}-xml # Likewise installed in mediawiki/tasks/install.yml, moodle/tasks/install.yml, nextcloud/tasks/install.yml, wordpress/tasks/install.yml -- AND REGARDLESS dragged in later by Admin Console's use of php-pear for roles/cmdsrv/tasks/main.yml -- run 'php -m | grep -i xml' which in the end shows {libxml, SimpleXML, xml, xmlreader, xmlwriter}
- php{{ php_version }}-zip # Likewise installed in moodle/tasks/install.yml, nextcloud/tasks/install.yml, wordpress/tasks/install.yml
#- libapache2-mod-php
#- python-mysqldb # https://github.com/Yannik/ansible-role-freepbx/blob/master/tasks/freepbx.yml#L33
#- libapache2-mpm-itk # To serve FreePBX through a VirtualHost as asterisk user
state: latest
- name: "FreePBX - Install packages: libapache2-mod-php, libapache2-mpm-itk - if not pbx_try_nginx"
package:
name:
- libapache2-mod-php
- libapache2-mpm-itk # To serve FreePBX through a VirtualHost as asterisk user
when: not pbx_try_nginx
# For PHP >= 8.0: phpX.Y-json is baked into PHP itself.
# For PHP < 8.0: phpX.Y-json auto-installed by phpX.Y-fpm AND phpX.Y-cli in 3-base-server's nginx/tasks/install.yml, as confirmed by: apt rdepends phpX.Y-json
#

View file

@ -22,14 +22,18 @@
# when: nodejs_version != "12.x"
# - name: "Set 'apache_install: True' and 'apache_enabled: True'"
# set_fact:
# apache_install: True
# apache_enabled: True
block:
# - name: APACHE - run 'httpd' role
# include_role:
# name: httpd
- name: "Set 'apache_install: True' and 'apache_enabled: True'"
set_fact:
apache_install: True
apache_enabled: True
- name: APACHE - run 'httpd' role
include_role:
name: httpd
when: not pbx_try_nginx
- name: Install Asterisk

View file

@ -624,6 +624,8 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False
pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE,
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX !
asterisk_chan_dongle: False
pbx_signaling_ports_chan_sip: 5160:5161
pbx_signaling_ports_chan_pjsip: 5060

View file

@ -405,4 +405,6 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False
pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE,
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX !
asterisk_chan_dongle: False

View file

@ -405,4 +405,6 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False
pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE,
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX !
asterisk_chan_dongle: False

View file

@ -405,4 +405,6 @@ calibre_web_path: calibre #NEEDS WORK: https://github.com/iiab/iiab/issues/529
# If using PBX intensively, investigate nginx_high_php_limits further above.
pbx_install: False
pbx_enabled: False
pbx_try_nginx: False # 2021-08-07: PLEASE TRY NGINX INSTEAD OF APACHE,
# AFTER READING https://github.com/iiab/iiab/issues/2914 AND #2916, THX !
asterisk_chan_dongle: False