summaryrefslogtreecommitdiff
path: root/playbooks/stop_start_openbook.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/stop_start_openbook.yaml')
-rw-r--r--playbooks/stop_start_openbook.yaml15
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"