diff options
| author | ckonstanski <ckonstanski@pippiandcarlos.com> | 2017-12-08 17:15:09 +0000 |
|---|---|---|
| committer | ckonstanski <ckonstanski@pippiandcarlos.com> | 2017-12-08 17:15:09 +0000 |
| commit | 37de0831718e5a4e54210462f501c97394803008 (patch) | |
| tree | a6e39938d3572f269378e109e0f1a0225fa1060c /playbooks/stop_start_openbook.yaml | |
| parent | 621a5c280a71fe3ede8742b9b289ee0e3d2a9875 (diff) | |
autocommit Fri Dec 8 17:15:09 UTC 2017
Diffstat (limited to 'playbooks/stop_start_openbook.yaml')
| -rw-r--r-- | playbooks/stop_start_openbook.yaml | 15 |
1 files changed, 10 insertions, 5 deletions
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" |
