Browse Source

Moved lxc_guest restart on config edit from handlers to tasks.

services
Slash 9 years ago
parent
commit
c4c9bc32b6
2 changed files with 6 additions and 7 deletions
  1. +0
    -5
      roles/lxc_guest/handlers/main.yaml
  2. +6
    -2
      roles/lxc_guest/tasks/main.yaml

+ 0
- 5
roles/lxc_guest/handlers/main.yaml View File

@ -1,5 +0,0 @@
- name: restart container
lxc_container:
name: "{{ vm_name }}"
state: restarted
when: "auto_start == true"

+ 6
- 2
roles/lxc_guest/tasks/main.yaml View File

@ -30,8 +30,12 @@
- block:
- name: update container config
template: src=config.j2 dest="/var/lib/lxc/{{ vm_name }}/config"
notify:
- restart container
register: container_config_update
- name: restart container
lxc_container:
name: "{{ vm_name }}"
state: restarted
when: container_config_update.changed
- name: set container running state
lxc_container:
name: "{{ vm_name }}"


Loading…
Cancel
Save