Advertisement
ioggstream

ansible_register_with_items

Sep 29th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. - hosts: localhost
  2. gather_facts: no
  3. tasks:
  4. - stat:
  5. path: >-
  6. {{item}}
  7. with_items:
  8. - /etc/FOO
  9. - /etc/hosts
  10. register: o
  11. - debug:
  12. msg: >
  13. {{ o.results
  14. | selectattr("stat.exists", "equalto", true)
  15. | map(attribute="item")
  16. | first
  17. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement