1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/pbx/tasks/install.yml

54 lines
1.6 KiB
YAML

- name: "ONLY PHP 7.4 IS SUPPORTED AS OF AUG 2021 -- PLEASE READ: https://github.com/iiab/iiab/tree/master/roles/pbx/#pbx-readme"
meta: noop
- name: "Set 'nodejs_install: True' and 'nodejs_enabled: True'"
set_fact:
nodejs_install: True
nodejs_enabled: True
- name: NODEJS - run 'nodejs' role (attempt to install & enable Node.js)
include_role:
name: nodejs
- name: FAIL (STOP THE INSTALL) IF 'nodejs_installed is undefined'
fail:
msg: "PBX install cannot proceed, as Node.js is not installed."
when: nodejs_installed is undefined
# - name: FAIL (STOP THE INSTALL) IF 'nodejs_version != "12.x"'
# fail:
# msg: "PBX install cannot proceed, as it currently requires Node.js 12.x, whereas nodejs_version is set to {{ nodejs_version }}. Please check the value of nodejs_version in /opt/iiab/iiab/vars/default_vars.yml, /etc/iiab/local_vars.yml, /opt/iiab/iiab/roles/nodejs, etc."
# when: nodejs_version != "12.x"
# 2021-08-07: Moved to roles/pbx/tasks/freepbx_dependencies.yml
# - 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
- name: Install Asterisk
include_tasks: asterisk.yml
- name: Install FreePBX
include_tasks: freepbx.yml
# RECORD PBX AS INSTALLED
- name: "Set 'pbx_installed: True'"
set_fact:
pbx_installed: True
- name: "Add 'pbx_installed: True' to {{ iiab_state_file }}"
lineinfile:
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp: '^pbx_installed'
line: 'pbx_installed: True'