Move container restart task to handlers.
This commit is contained in:
parent
fcb2e99cc5
commit
85836e311e
2 changed files with 17 additions and 8 deletions
7
roles/educontainer/handlers/main.yml
Normal file
7
roles/educontainer/handlers/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
- name: enable and restart containers
|
||||
systemd:
|
||||
name: systemd-nspawn@{{ contname }}{{ "%02d" | format(item|int) }}.service
|
||||
state: restarted
|
||||
enabled: yes
|
||||
loop: "{{ containers }}"
|
||||
listen: enable and restart containers
|
Loading…
Add table
Add a link
Reference in a new issue