From 37de0831718e5a4e54210462f501c97394803008 Mon Sep 17 00:00:00 2001 From: ckonstanski Date: Fri, 8 Dec 2017 17:15:09 +0000 Subject: autocommit Fri Dec 8 17:15:09 UTC 2017 --- playbooks/stop_start_openbook.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'playbooks/stop_start_openbook.yaml') diff --git a/playbooks/stop_start_openbook.yaml b/playbooks/stop_start_openbook.yaml index 83c1d57..c34a7ff 100644 --- a/playbooks/stop_start_openbook.yaml +++ b/playbooks/stop_start_openbook.yaml @@ -2,9 +2,10 @@ - name: "Verify action to take" hosts: localhost tasks: - - name: "Check that -e 'action=[stop|start]' was passed in" - fail: msg="The variable 'action' was not passed in with a value of 'stop' or 'start' on the command line." - when: action not in ["stop", "start"] + - 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." + when: action not in ["stop", "start", "restart"] - name: "Stop Openbook" hosts: "{{ groups['target']|sort(reverse=True) }}" @@ -17,7 +18,7 @@ docker stop ${cont} done docker container prune -f - when: action == "stop" + when: action in ["stop", "restart"] - name: "Start Openbook" hosts: "{{ groups['target']|sort }}" @@ -25,4 +26,8 @@ tasks: - name: "Start Openbook" shell: /etc/init.d/openbook start - when: action == "start" + 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