-
Notifications
You must be signed in to change notification settings - Fork 17
/
site.step-65-post-deploy.yml
48 lines (43 loc) · 1.35 KB
/
site.step-65-post-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- import_playbook: site.common.group-current-hosts.yml
- hosts: app:¤t
gather_facts: no
tasks:
- name: Wait app nodes to be reachble
wait_for_connection:
delay: 10
timeout: 300
- hosts: app:¤t
gather_facts: no
tasks:
- name: Run Magento post-deploy setup
command: "{{ item.cmd | default(item) }}"
args:
chdir: "{{ item.dir | default(magento_live_release_dir) }}"
run_once: true
become: yes
become_user: "{{ magento_user }}"
loop: "{{ commands_base + magento_post_deploy_commands | default([]) }}"
loop_control:
label: "{{ item.cmd | default(item) }}"
register: out
vars:
commands_base:
- "bin/magento app:config:import --no-interaction"
- "bin/magento setup:upgrade --keep-generated"
- "bin/magento maintenance:disable"
- name: Show Magento post-deploy output
debug:
msg: "{{ result.stdout | default('--- N/A ---') }}"
loop: "{{ out.results }}"
loop_control:
loop_var: result
label: "{{ result.cmd | default([]) | join(' ') }}"
- name: Start Magento services
service:
name: "{{ service_name }}"
state: started
loop:
- magento-node-warmup.service
- supervisord.service
loop_control:
loop_var: service_name