|
1 | 1 | ---
|
2 |
| -- name: Restart rabbitmq container (first node) |
| 2 | +- name: Restart rabbitmq container |
3 | 3 | vars:
|
4 | 4 | service_name: "rabbitmq"
|
5 | 5 | service: "{{ rabbitmq_services[service_name] }}"
|
6 |
| - become: true |
7 |
| - kolla_docker: |
8 |
| - action: "recreate_or_restart_container" |
9 |
| - common_options: "{{ docker_common_options }}" |
10 |
| - name: "{{ service.container_name }}" |
11 |
| - image: "{{ service.image }}" |
12 |
| - volumes: "{{ service.volumes }}" |
13 |
| - environment: "{{ service.environment }}" |
14 |
| - dimensions: "{{ service.dimensions }}" |
| 6 | + include_tasks: 'restart_services.yml' |
15 | 7 | when:
|
16 | 8 | - kolla_action != "config"
|
17 |
| - - inventory_hostname == groups[service.group]|first |
18 |
| - notify: |
19 |
| - - Waiting for rabbitmq to start on first node |
20 |
| - listen: Restart rabbitmq container |
21 |
| - |
22 |
| -- name: Waiting for rabbitmq to start on first node |
23 |
| - vars: |
24 |
| - service_name: "rabbitmq" |
25 |
| - service: "{{ rabbitmq_services[service_name] }}" |
26 |
| - become: true |
27 |
| - command: "docker exec {{ service.container_name }} rabbitmqctl wait {{ rabbitmq_pid_file }}" |
28 |
| - when: |
29 |
| - - inventory_hostname == groups[service.group]|first |
30 |
| - |
31 |
| -- name: Restart rabbitmq container (rest of nodes) |
32 |
| - vars: |
33 |
| - service_name: "rabbitmq" |
34 |
| - service: "{{ rabbitmq_services[service_name] }}" |
35 |
| - become: true |
36 |
| - kolla_docker: |
37 |
| - action: "recreate_or_restart_container" |
38 |
| - common_options: "{{ docker_common_options }}" |
39 |
| - name: "{{ service.container_name }}" |
40 |
| - image: "{{ service.image }}" |
41 |
| - volumes: "{{ service.volumes }}" |
42 |
| - environment: "{{ service.environment }}" |
43 |
| - dimensions: "{{ service.dimensions }}" |
44 |
| - when: |
45 |
| - - kolla_action != "config" |
46 |
| - - inventory_hostname != groups[service.group]|first |
47 |
| - listen: Restart rabbitmq container |
| 9 | + - inventory_hostname == item |
| 10 | + loop: "{{ groups[service.group] }}" |
0 commit comments