From 85721c5bb09028974a724a43849f7291bc5f719d Mon Sep 17 00:00:00 2001 From: Carlos Konstanski Date: Fri, 8 Dec 2017 07:29:43 -0700 Subject: debug support integrated into jenkins Issue: IS-44 --- salt/openbook/ansible/files/ob-ctl.sh | 3 ++- salt/openbook/ansible/files/openbook_stop_start.yaml | 1 + salt/openbook/ansible/files/stop_start_openbook.yaml | 9 +++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'salt/openbook/ansible/files') diff --git a/salt/openbook/ansible/files/ob-ctl.sh b/salt/openbook/ansible/files/ob-ctl.sh index 6a2a108..7e3a357 100644 --- a/salt/openbook/ansible/files/ob-ctl.sh +++ b/salt/openbook/ansible/files/ob-ctl.sh @@ -2,6 +2,7 @@ branch="${1}" action="${2}" +extra_args="${3}" buildroot="$(pwd)" pushd ${buildroot}/conf @@ -10,5 +11,5 @@ rm -f env.yaml ln -s env.yaml.openbook env.yaml popd pushd ${buildroot} -ansible-playbook -i inventory_json_${branch}.rb -e "action=${action}" openbook_stop_start.yaml +ansible-playbook -i inventory_json_${branch}.rb -e "action=${action} extra_args=${extra_args}" openbook_stop_start.yaml popd diff --git a/salt/openbook/ansible/files/openbook_stop_start.yaml b/salt/openbook/ansible/files/openbook_stop_start.yaml index 045f7a9..8eb2437 100644 --- a/salt/openbook/ansible/files/openbook_stop_start.yaml +++ b/salt/openbook/ansible/files/openbook_stop_start.yaml @@ -4,6 +4,7 @@ # # Required variables to be passed in the command line via -e: # action=[stop|start|restart] +# extra_args= ### - name: "Stop/Start Openbook" diff --git a/salt/openbook/ansible/files/stop_start_openbook.yaml b/salt/openbook/ansible/files/stop_start_openbook.yaml index 376d1f5..c34a7ff 100644 --- a/salt/openbook/ansible/files/stop_start_openbook.yaml +++ b/salt/openbook/ansible/files/stop_start_openbook.yaml @@ -3,7 +3,8 @@ hosts: localhost tasks: - name: "Check that -e 'action=[stop|start|restart]' was passed in" - fail: msg="The variable 'action' was not passed in with a value of 'stop', 'start' or 'restart' on the command line." + fail: + msg: "The variable 'action' was not passed in with a value of 'stop', 'start' or 'restart' on the command line." when: action not in ["stop", "start", "restart"] - name: "Stop Openbook" @@ -25,4 +26,8 @@ tasks: - name: "Start Openbook" shell: /etc/init.d/openbook start - when: action in ["start", "restart"] + when: action in ["start", "restart"] and extra_args != "debug" + + - name: "Start Openbook in debug mode" + shell: /etc/init.d/openbook debug + when: action in ["start", "restart"] and extra_args == "debug" -- cgit v1.3