diff options
author | Paul Bonaud <paul.bonaud@fretlink.com> | 2020-06-22 18:34:38 +0200 |
---|---|---|
committer | Paul Bonaud <paul.bonaud@fretlink.com> | 2020-06-23 10:52:37 +0200 |
commit | ab73076c017bfc8abbe62e617292ef7232b630f1 (patch) | |
tree | c0fbd00645140c6318d03e127773b4ec067c7f9e /tasks/restart.yml | |
parent | 44af02cef61e043b971f03aa5cec5a4caa6d6875 (diff) | |
download | ansible-clever-ab73076c017bfc8abbe62e617292ef7232b630f1.tar.gz ansible-clever-ab73076c017bfc8abbe62e617292ef7232b630f1.tar.zst ansible-clever-ab73076c017bfc8abbe62e617292ef7232b630f1.zip |
feature: add a new 'clever_restart_only' flag to restart an app
This new flag will perform a restart on the target clever cloud
application instead of deploying it.
Diffstat (limited to 'tasks/restart.yml')
-rw-r--r-- | tasks/restart.yml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tasks/restart.yml b/tasks/restart.yml new file mode 100644 index 0000000..e2a8891 --- /dev/null +++ b/tasks/restart.yml | |||
@@ -0,0 +1,22 @@ | |||
1 | --- | ||
2 | - name: Restart app on Clever-Cloud | ||
3 | shell: "clever restart" | ||
4 | args: | ||
5 | chdir: "{{ clever_app_root }}" | ||
6 | environment: | ||
7 | CONFIGURATION_FILE: "{{ clever_login_file }}" | ||
8 | async: 300 # 5 minutes | ||
9 | poll: 0 | ||
10 | ignore_errors: true | ||
11 | register: clever_deploy | ||
12 | tags: | ||
13 | - skip_ansible_lint | ||
14 | |||
15 | - name: Wait up to 5 minutes for restart completion | ||
16 | async_status: | ||
17 | jid: "{{ clever_deploy.ansible_job_id }}" | ||
18 | register: job_result | ||
19 | until: job_result.finished | ||
20 | ignore_errors: true | ||
21 | delay: 30 | ||
22 | retries: 10 # 5 minutes (10 * 30 secs delay) | ||