1 - name: Configure Drain
2 when: syslog_server is defined or clever_syslog_server is defined
3 command: clever-set-drain.sh
5 SYSLOG_UDP_SERVER: "{{ clever_syslog_server | default(syslog_server) }}"
6 CONFIGURATION_FILE: "{{ clever_login_file }}"
8 - name: Configure Domain
9 when: domain is defined or clever_domain is defined
10 command: clever-set-domain.sh
12 DOMAIN: "{{ clever_domain | default(domain) }}"
13 CONFIGURATION_FILE: "{{ clever_login_file }}"
15 - name: Push Environment
16 shell: "clever env import < {{ clever_app_confdir }}/env"
18 CONFIGURATION_FILE: "{{ clever_login_file }}"
21 #TODO: Improve ssh-key validation
22 - name: Accept Clever-Cloud servers
23 shell: "ssh-keyscan -H push-par-clevercloud-customers.services.clever-cloud.com >> ~/.ssh/known_hosts"
27 - name: Push to Clever-Cloud to trigger deployment
28 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master"
29 register: clever_git_push
34 - name: First time push to Clever-Cloud needs a full git clone
35 command: "git fetch --unshallow"
37 - clever_git_push is failed
38 - clever_git_push.stderr is search("shallow update not allowed")
42 - name: Push to Clever-Cloud to trigger deployment
43 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master"
44 when: clever_git_push is failed
48 - name: Watch deployment status
49 command: clever-wait-deploy.sh
52 register: long_command
54 CONFIGURATION_FILE: "{{ clever_login_file }}"
57 # Waits up to 15 minutes
58 - name: Wait for deployment completion
60 jid: "{{ long_command.ansible_job_id }}"
62 until: job_result.finished