Small task:
- name: Configure hosts
template: src=host.cfg.j2 dest=/etc/shinken/hosts/{{item.host_name}}.cfg
with_items: shinken_hosts
when: shinken_hosts is defined
notify: reload config
I want to remove all other configs (files) in /etc/shinken/hosts/ configured by this task.
How can I do this?
(It is really important if I fix a typo in 'shinken_hosts', and want to automatically remove old config with mistake in the name).
you might want to check this, slide 19. This assumes that you know what files needs to exist in the specific dir, and then deletes all others.