mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
EXPERIMENTAL: asterisk_patch for RPi + prelim path to PHP 8
This commit is contained in:
parent
cb1ae8d4f4
commit
3c360d21fa
10 changed files with 39 additions and 24 deletions
|
@ -21,8 +21,10 @@
|
|||
# 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!
|
||||
|
||||
# Allows testing on newer php versions when present in local_vars.yml
|
||||
# pbx_php74_override: True
|
||||
|
||||
# 2023-04-02: If you want to try EXPERIMENTAL testing on Raspberry Pi:
|
||||
# asterisk_patch: True
|
||||
|
||||
asterisk_url: https://downloads.asterisk.org/pub/telephony/asterisk
|
||||
asterisk_src_file: asterisk-20-current.tar.gz
|
||||
asterisk_src_dir: "{{ iiab_base }}/asterisk" # /opt/iiab
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
owner: "{{ apache_user }}" # www-data
|
||||
group: "{{ apache_user }}"
|
||||
|
||||
|
||||
- name: "Set 'apache_installed: True'"
|
||||
set_fact:
|
||||
apache_installed: True
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
ansible.posix.patch:
|
||||
src: install_prereq.diff
|
||||
dest: "{{ asterisk_src_dir }}/contrib/scripts/install_prereq"
|
||||
when: asterisk_patch is defined and asterisk_patch
|
||||
|
||||
- name: Asterisk - Run 'install_prereq install' for dependencies - CAN TAKE 2-5 MIN OR LONGER!
|
||||
shell: export DEBIAN_FRONTEND=noninteractive && ./contrib/scripts/install_prereq install
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
- name: JUST 1 SETTING TO TURN ON/OFF FOR APACHE - whereas NGINX below has 4...
|
||||
meta: noop
|
||||
|
||||
- name: EITHER - Create symlink /etc/{{ apache_service }}/sites-enabled/freepbx.conf to enable Apache's http://box:{{ pbx_http_port }}/freepbx - if pbx_use_apache and pbx_enabled # http://box:83/freepbx
|
||||
- name: EITHER - Create symlink /etc/{{ apache_service }}/sites-enabled/freepbx.conf to enable Apache's http://box:{{ pbx_http_port }}/freepbx - if apache_installed is defined and pbx_use_apache and pbx_enabled # http://box:83/freepbx
|
||||
command: a2ensite freepbx.conf
|
||||
when: apache_installed is defined and pbx_use_apache and pbx_enabled
|
||||
|
||||
- name: OR ELSE - Delete symlink /etc/{{ apache_service }}/sites-enabled/freepbx.conf to disable Apache's http://box:{{ pbx_http_port }}/freepbx - if not (pbx_use_apache and pbx_enabled)
|
||||
- name: OR ELSE - Delete symlink /etc/{{ apache_service }}/sites-enabled/freepbx.conf to disable Apache's http://box:{{ pbx_http_port }}/freepbx - if not (apache_installed is defined and pbx_use_apache and pbx_enabled)
|
||||
file: # As 'a2dissite freepbx.conf' might not be installed
|
||||
path: /etc/{{ apache_service }}/sites-enabled/freepbx.conf # apache2
|
||||
state: absent
|
||||
when: apache_installed is defined and (not pbx_enabled or not pbx_use_apache)
|
||||
when: not (apache_installed is defined and pbx_use_apache and pbx_enabled)
|
||||
|
||||
|
||||
- name: "ENACT ABOVE SETTING FOR APACHE - 'pbx_use_apache: False' might arise later, so best ALWAYS run..."
|
||||
meta: noop
|
||||
|
||||
- name: EITHER - Restart & Enable '{{ apache_service }}' systemd service - if pbx_use_apache and pbx_enabled
|
||||
- name: EITHER - Restart & Enable '{{ apache_service }}' systemd service - if apache_installed is defined and pbx_use_apache and pbx_enabled
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: "{{ apache_service }}" # apache2
|
||||
|
@ -23,19 +23,20 @@
|
|||
enabled: yes
|
||||
when: apache_installed is defined and pbx_use_apache and pbx_enabled
|
||||
|
||||
- name: OR ELSE - Stop & Disable '{{ apache_service }}' systemd service - if not (pbx_use_apache and pbx_enabled)
|
||||
- name: OR ELSE - Stop & Disable '{{ apache_service }}' systemd service - if not (apache_installed is defined and pbx_use_apache and pbx_enabled)
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: "{{ apache_service }}"
|
||||
state: stopped
|
||||
enabled: no
|
||||
when: apache_installed is defined and (not pbx_use_apache or not pbx_enabled)
|
||||
when: not (apache_installed is defined and pbx_use_apache and pbx_enabled)
|
||||
ignore_errors: yes # If Apache not installed, HIGHLIGHT IN RED FOR IMPLEMENTER/OPERATOR
|
||||
|
||||
- name: Open-or-Close Asterix ports (including Apache port {{ pbx_http_port }}) in iptables firewall, depending on pbx_enabled [{{ pbx_enabled }}] in local_vars.yml - in support of './runrole pbx'
|
||||
command: /usr/bin/iiab-gen-iptables
|
||||
when: iiab_stage|int == 9 and network_enabled
|
||||
# iptables installed in 1-prep via roles/network/tasks/install.yml, but iiab-gen-tables may not be set up until
|
||||
# roles/network runs later and can be omitted altogether
|
||||
# iptables installed in 1-prep via roles/network/tasks/install.yml, but
|
||||
# iiab-gen-tables may not be set up, until/if roles/network runs later.
|
||||
|
||||
|
||||
- block:
|
||||
|
|
|
@ -11,15 +11,14 @@
|
|||
# 2021-08-12: Let's try to track the "official" init.d / update-rc.d
|
||||
# instructions ('update-rc.d -f asterisk remove') but using systemd instead,
|
||||
# to be more future-proof?
|
||||
# 2023-04-02 The above is not true, the service is running from the asterisk install causing
|
||||
# './start_asterisk start' to do nothing as the service is alredy running resulting in the
|
||||
# need to use 'ignore' for 'killall -9 safe_asterisk' or './start_asterisk stop'
|
||||
# Lets get rid of the red warning.
|
||||
# 2023-04-02: Disagreement remains the same as 2 years ago:
|
||||
# @jvonau wants to stop service asterisk (from the asterisk install).
|
||||
# @holta prefers we track Asterisk/FreePBX community's mainline/consensus.
|
||||
- name: "FreePBX - Disable 'asterisk' systemd service, giving FreePBX full control during boot - similar to officially recommended 'update-rc.d -f asterisk remove' at: https://wiki.freepbx.org/display/FOP/Installing+FreePBX+16+on+Debian+10.9"
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: asterisk
|
||||
state: stopped
|
||||
#state: stopped
|
||||
enabled: no
|
||||
|
||||
|
||||
|
@ -66,10 +65,15 @@
|
|||
# state: present
|
||||
# when: php_version is version('8.0', '<')
|
||||
|
||||
- name: "Run roles/www_options/tasks/php-settings.yml with 'nginx_high_php_limits: False' by default"
|
||||
- name: "FreePBX - Run roles/www_options/tasks/php-settings.yml with 'nginx_high_php_limits: False' by default"
|
||||
include_tasks: roles/www_options/tasks/php-settings.yml
|
||||
when: php_settings_done is undefined
|
||||
|
||||
- name: FreePBX - Install and configure Apache - if pbx_use_apache
|
||||
include_tasks: apache.yml
|
||||
when: pbx_use_apache and apache_installed is undefined
|
||||
|
||||
|
||||
# - name: FreePBX - Download {{ freepbx_url }}/{{ freepbx_src_file }} to {{ downloads_dir }}
|
||||
# get_url:
|
||||
# url: "{{ freepbx_url }}/{{ freepbx_src_file }}"
|
||||
|
|
|
@ -18,21 +18,19 @@
|
|||
fail_msg: "PLEASE GIVE VARIABLE 'pbx_enabled' A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
|
||||
|
||||
- block:
|
||||
|
||||
- name: EXIT 'pbx' ROLE, if 'php_version' doesn't shows "7.4"
|
||||
fail: # FORCE IT RED THIS ONCE!
|
||||
msg: FreePBX 16 requires PHP 7.4 and is not available.
|
||||
when: php_version is version('8.0', '>') and pbx_php74_override is undefined
|
||||
- name: If PHP >= 8 is detected, loudly warn that FreePBX does not support PHP 8+ (as of April 2023)
|
||||
fail: # FORCE IT RED, allowing adventurous/testing people to proceed at their own risk!
|
||||
msg: 'FreePBX DOES NOT SUPPORT PHP 8+ AS OF APRIL 2023. YOU ARE PROCEEDING ENTIRELY AT YOUR OWN RISK.'
|
||||
when: php_version is version('8.0', '>=')
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Install PBX if pbx_installed is not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml
|
||||
include_tasks: install.yml
|
||||
when: pbx_installed is undefined
|
||||
|
||||
- name: FreePBX - Install and configure Apache - if pbx_use_apache
|
||||
include_tasks: apache.yml
|
||||
when: pbx_use_apache and apache_installed is undefined
|
||||
|
||||
- name: Install & Enable chan_dongle for Huawei USB modems - if asterisk_chan_dongle
|
||||
include_tasks: chan_dongle.yml
|
||||
when: asterisk_chan_dongle
|
||||
|
|
|
@ -422,4 +422,6 @@ pbx_install: False
|
|||
pbx_enabled: False
|
||||
pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
|
||||
pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
|
||||
# 2023-04-02: If you want to try EXPERIMENTAL testing on Raspberry Pi:
|
||||
# asterisk_patch: True
|
||||
asterisk_chan_dongle: False
|
||||
|
|
|
@ -422,4 +422,6 @@ pbx_install: False
|
|||
pbx_enabled: False
|
||||
pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
|
||||
pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
|
||||
# 2023-04-02: If you want to try EXPERIMENTAL testing on Raspberry Pi:
|
||||
# asterisk_patch: True
|
||||
asterisk_chan_dongle: False
|
||||
|
|
|
@ -422,4 +422,6 @@ pbx_install: False
|
|||
pbx_enabled: False
|
||||
pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
|
||||
pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
|
||||
# 2023-04-02: If you want to try EXPERIMENTAL testing on Raspberry Pi:
|
||||
# asterisk_patch: True
|
||||
asterisk_chan_dongle: False
|
||||
|
|
|
@ -422,4 +422,6 @@ pbx_install: False
|
|||
pbx_enabled: False
|
||||
pbx_use_apache: True # 2021-08-17: Set either to 'False' if nec -- please
|
||||
pbx_use_nginx: True # read github.com/iiab/iiab/issues/2914 & #2916, THX!
|
||||
# 2023-04-02: If you want to try EXPERIMENTAL testing on Raspberry Pi:
|
||||
# asterisk_patch: True
|
||||
asterisk_chan_dongle: False
|
||||
|
|
Loading…
Add table
Reference in a new issue