From c71063209119571eb34541f53e4ed91613db265e Mon Sep 17 00:00:00 2001 From: Anish Mangal Date: Fri, 18 Jan 2019 07:12:34 +0000 Subject: [PATCH] Add checks to install pbx only when sugarizer is absent and nodejs version is correct --- roles/pbx/tasks/main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/pbx/tasks/main.yml b/roles/pbx/tasks/main.yml index 2ee162686..da4810761 100644 --- a/roles/pbx/tasks/main.yml +++ b/roles/pbx/tasks/main.yml @@ -1,9 +1,17 @@ +- name: Throw warning if sugarizer_install is true + debug: Refusing to install as sugarizer_install is true. Fix that and rerun. + when: pbx_install and sugarizer_install + +- name: Throw warning if sugarizer_install is true + debug: Refusing to install as nodejs_version is not 10.x. Fix that and rerun. + when: pbx_install and (nodejs_version != "10.x") + #- name: TODO: Check if asterisk and freepbx are already installed - name: Install asterisk include_tasks: asterisk.yml - when: internet_available and is_ubuntu_18 and pbx_install and (not pbx_installed) + when: internet_available and is_ubuntu_18 and pbx_install and (not pbx_installed) and (not sugarizer_install) and (nodejs_version == "10.x") - name: Install freepbx include_tasks: freepbx.yml - when: internet_available and is_ubuntu_18 and pbx_install and (not pbx_installed) + when: internet_available and is_ubuntu_18 and pbx_install and (not pbx_installed) and (not sugarizer_install) and (nodejs_version == "10.x")