Add handler so the glance container gets restarted every time the glance config file is changed
This commit is contained in:
parent
a1ab0ae715
commit
8e54340c9e
7
roles/docker/handlers/main.yml
Normal file
7
roles/docker/handlers/main.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# roles/docker/handlers/main.yml
|
||||||
|
- name: restart glance
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: /opt/stacks/glance
|
||||||
|
files:
|
||||||
|
- compose.yml
|
||||||
|
state: restarted
|
@ -1,6 +1,6 @@
|
|||||||
- name: make glance directories
|
- name: make glance directories
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item}}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
loop:
|
loop:
|
||||||
- /opt/stacks/glance
|
- /opt/stacks/glance
|
||||||
@ -10,17 +10,18 @@
|
|||||||
src: glance-compose.yml.j2
|
src: glance-compose.yml.j2
|
||||||
dest: /opt/stacks/glance/compose.yml
|
dest: /opt/stacks/glance/compose.yml
|
||||||
owner: root
|
owner: root
|
||||||
mode: 644
|
mode: '0644'
|
||||||
|
|
||||||
- name: Template out the config file
|
- name: Template out the config file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: glance.yml.j2
|
src: glance.yml.j2
|
||||||
dest: /opt/stacks/glance/glance.yml
|
dest: /opt/stacks/glance/glance.yml
|
||||||
owner: root
|
owner: root
|
||||||
mode: 644
|
mode: '0644'
|
||||||
|
notify: restart glance
|
||||||
|
|
||||||
- name: deploy glances stack
|
- name: deploy glances stack
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
project_src: /opt/stacks/glance
|
project_src: /opt/stacks/glance
|
||||||
files:
|
files:
|
||||||
- compose.yml
|
- compose.yml
|
Loading…
Reference in New Issue
Block a user