Hi,

I want a symlink to be present on some hosts and absent for others, so I write 
this task

- name: enable plugins for baremetal only
  file:
    path: "/etc/munin/plugins/{{ item }}"
    state: "{{ is_baremetal | ternary('link', 'absent') }}"
    src: "/usr/share/munin/plugins/{{ item }}"
  loop:
    - acpi
    - cpu
    - cpuspeed
    - diskstats
    - entropy
    - forks
    - fw_packets
    - interrupts
    - irqstats
    - load
    - proc_pri
    - swap
    - threads
    - vmstat
  notify: restart munin-node
  tags: [ 'config', 'munin-node' ]

It works, but it show this warning

  [WARNING]: The src option requires state to be 'link' or 'hard'.  This will 
become an error in
  Ansible 2.10

Why turn this to an error ?

It will force me to write almost the same task twice (one with `state: link` 
and a second
with `state: absent`)


-- 
Daniel

Les avions sont des jouets sans aucune valeur militaire.
Maréchal Foch (1911)

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20210209111726.14590355%40dell.

Reply via email to