1 - name: Configure Drain
2 when: syslog_server is defined or clever_syslog_server is defined
3 command: clever-set-drain.sh
5 chdir: "{{ clever_app_root }}"
7 SYSLOG_UDP_SERVER: "{{ clever_syslog_server | default(syslog_server) }}"
8 CONFIGURATION_FILE: "{{ clever_login_file }}"
10 - name: Configure Domain
11 when: domain is defined or clever_domain is defined
12 command: clever-set-domain.sh
14 chdir: "{{ clever_app_root }}"
16 DOMAIN: "{{ clever_domain | default(domain) }}"
17 CONFIGURATION_FILE: "{{ clever_login_file }}"
19 - name: Push Environment
20 shell: "clever env import < {{ clever_app_confdir }}/env"
22 chdir: "{{ clever_app_root }}"
24 CONFIGURATION_FILE: "{{ clever_login_file }}"
27 #TODO: Improve ssh-key validation
28 - name: Accept Clever-Cloud servers
29 shell: "ssh-keyscan -H push-par-clevercloud-customers.services.clever-cloud.com >> ~/.ssh/known_hosts"
33 - name: Push to Clever-Cloud to trigger deployment
34 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master"
36 chdir: "{{ clever_app_root }}"
37 register: clever_git_push
42 - name: First time push to Clever-Cloud needs a full git clone
43 command: "git fetch --unshallow"
45 chdir: "{{ clever_app_root }}"
47 - clever_git_push is failed
48 - clever_git_push.stderr is search("shallow update not allowed")
52 - name: Push to Clever-Cloud to trigger deployment
53 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master"
55 chdir: "{{ clever_app_root }}"
56 when: clever_git_push is failed
60 - name: Watch deployment status
61 command: "clever-wait-deploy.sh"
63 chdir: "{{ clever_app_root }}"
66 register: long_command
68 CONFIGURATION_FILE: "{{ clever_login_file }}"
71 # Waits up to 15 minutes
72 - name: Wait for deployment completion
74 jid: "{{ long_command.ansible_job_id }}"
76 until: job_result.finished