How do I use Ansible facts in a custom module?

40 views
Skip to first unread message

ZillaYT

unread,
Dec 14, 2016, 12:39:29 PM12/14/16
to Ansible Project
I'm trying to write my first Ansible module. How do I refer to the built-in facts that Ansible gathers during the setup phase? I just want to be able to do this inside my module, for example.I want to be able to do the "when" part in my module.

- name: Issue some command
  command: ls -al /tmp
  when: (ansible_product_version | search(".*.amazon"))



Reply all
Reply to author
Forward
0 new messages