- `clever_build_flavor`: an optional text value used to configure the size of the dedicated build instance (for instance `S` or `XL`). If not defined, it delegates to clever cloud default behaviour. Setting `disabled` disables the dedicated build instance altogether.
- `clever_scaling`: an optional object used to configure the runtime instances flavours and numbers. If not defined, it delegates to clever cloud default behaviour.
-Variables specific to deployment, default should be fine:
+Variables specific to deployment, defaults should be fine:
- `clever_cli_version`: Version of clever cli tools, default to `2.6.1`.
- `clever_user_path`: Path relative to ansible_user home dir where cli tools and helpers are installed default to `.local/bin`.
- `clever_app_root`: Path of the application to deploy, default to `app_root` if defined or `"{{ playbook_dir }}/.."` otherwise. I.e. the default behavior will work fine if you define a playbook using this role in a one level deep directory (e.g. `deployment/`) of the root of the application.
- `clever_app_confdir`: Path where to store clever cloud data specific to this application, default to `"{{ clever_app_root }}/.clever_cloud"`
- `clever_login_file`: Path to store login information. Default to `"{{ clever_app_confdir }}/login"`.
+- `clever_restart_only`: set to `true` to skip any deployment related tasks (domain, scaling, env, deploy, …) and only restart the application. Optional.
Variables specific to Haskell applications:
- name: Deploy app
import_tasks: deploy.yml
+ when: not clever_restart_only is defined or not clever_restart_only
tags:
- clever
- clever-deploy
- name: Post deploy tasks
import_tasks: post_deploy.yml
+ when: not clever_restart_only is defined or not clever_restart_only
tags:
- clever
- clever-deploy
- clever-env
+
+- name: Restart app
+ import_tasks: restart.yml
+ when: clever_restart_only is defined and clever_restart_only
+ tags:
+ - clever
+ - clever-restart
--- /dev/null
+---
+- name: Restart app on Clever-Cloud
+ shell: "clever restart"
+ args:
+ chdir: "{{ clever_app_root }}"
+ environment:
+ CONFIGURATION_FILE: "{{ clever_login_file }}"
+ async: 300 # 5 minutes
+ poll: 0
+ ignore_errors: true
+ register: clever_deploy
+ tags:
+ - skip_ansible_lint
+
+- name: Wait up to 5 minutes for restart completion
+ async_status:
+ jid: "{{ clever_deploy.ansible_job_id }}"
+ register: job_result
+ until: job_result.finished
+ ignore_errors: true
+ delay: 30
+ retries: 10 # 5 minutes (10 * 30 secs delay)