Make container restart an handler

This commit is contained in:
Mathieu Trossevin 2020-10-19 14:16:53 +02:00
parent 672cb8a4ef
commit d33b4baef1
Signed by: mtrossevin
GPG key ID: D1DBB7EA828374E9
2 changed files with 7 additions and 6 deletions

View file

@ -18,3 +18,9 @@
lxc_container:
name: "{{ lxc_php_version }}"
container_command: "systemctl restart opensmtpd"
- name: Restart container
lxc_container:
name: "{{ lxc_php_version }}"
state: restarted

View file

@ -29,10 +29,5 @@
container_config:
- "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
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