start macchiato in handler

If we start it in the task, it can temporarily bring down the network as
it assigns a new address, causing future network tasks (like installing
packages) to fail. Starting it in a handler postpones it till the very
end.
This commit is contained in:
Pig Monkey 2017-01-21 17:32:24 -08:00
parent 62e20808b0
commit f94a402ef2
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,4 @@
---
- name: start macchiato
service: name=macchiato.service state=started
when: network.spoof_mac == True

View file

@ -8,9 +8,11 @@
copy: src=macchiato_default.sh dest=/etc/macchiato.d/{{ item }}.sh
with_items: "{{ ansible_interfaces }}"
- name: Enable and start macchiato
- name: Enable macchiato
service: name=macchiato.service enabled=yes state=started
when: network.spoof_mac == True
notify:
- start macchiato
- name: Disable and stop macchiato
service: name=macchiato.service enabled=no state=stopped