forked from evolix/ansible-roles
Make container restart an handler
This commit is contained in:
parent
672cb8a4ef
commit
d33b4baef1
|
@ -18,3 +18,9 @@
|
||||||
lxc_container:
|
lxc_container:
|
||||||
name: "{{ lxc_php_version }}"
|
name: "{{ lxc_php_version }}"
|
||||||
container_command: "systemctl restart opensmtpd"
|
container_command: "systemctl restart opensmtpd"
|
||||||
|
|
||||||
|
- name: Restart container
|
||||||
|
lxc_container:
|
||||||
|
name: "{{ lxc_php_version }}"
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,5 @@
|
||||||
container_config:
|
container_config:
|
||||||
- "lxc.mount.entry = /var/run/mysqld {{ php_conf_mysql_socket_dir | replace('/', '', 1) }} none bind,create=dir 0 0"
|
- "lxc.mount.entry = /var/run/mysqld {{ php_conf_mysql_socket_dir | replace('/', '', 1) }} none bind,create=dir 0 0"
|
||||||
when: php_conf_mysql_socket_dir is string
|
when: php_conf_mysql_socket_dir is string
|
||||||
register: added_mysql_socket
|
notify: Restart container
|
||||||
|
|
||||||
- name: "{{ lxc_php_version }} - Restart container as configuration changed"
|
|
||||||
lxc_container:
|
|
||||||
name: "{{ lxc_php_version }}"
|
|
||||||
state: restarted
|
|
||||||
when: added_mysql_socket.changed
|
|
||||||
|
|
Loading…
Reference in a new issue