summaryrefslogtreecommitdiff
path: root/salt/openbook/ansible
diff options
context:
space:
mode:
authorCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-12-08 07:29:43 -0700
committerCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-12-08 07:29:43 -0700
commit85721c5bb09028974a724a43849f7291bc5f719d (patch)
treedc1b8ee2bc7516846f0f5556b23cc423324c26af /salt/openbook/ansible
parent2bc881db007a02995d0a09ed5d1303d00d120418 (diff)
debug support integrated into jenkins
Issue: IS-44
Diffstat (limited to 'salt/openbook/ansible')
-rw-r--r--salt/openbook/ansible/files/ob-ctl.sh3
-rw-r--r--salt/openbook/ansible/files/openbook_stop_start.yaml1
-rw-r--r--salt/openbook/ansible/files/stop_start_openbook.yaml9
3 files changed, 10 insertions, 3 deletions
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=<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"