HOWTO: Using Ansible facts to make decisions in playbooks

5 Comments



This is an introduction to the use of ansible facts to make decisions within playbooks.

You can find the sample code here: https://github.com/whboyd/ansible-facts-sample

Relevant ansible docs:

Ansible Facts: http://docs.ansible.com/ansible/latest/playbooks_variables.html#information-discovered-from-systems-facts
When statements: http://docs.ansible.com/ansible/latest/playbooks_conditionals.html#the-when-statement

source

5 Comments
    • blank
      Vitus Yu
      May 17, 2022 06:20 am Reply

      You mentioned there are a lot of ways to do the same function, could you shed light on just another ways to do the same conditional execution of this Ansible tasks ?

    • blank
      Hungarian Nerd
      May 17, 2022 06:20 am Reply

      this is helping in my current job, thanks

    • blank
      David Tovar
      May 17, 2022 06:20 am Reply

      I actually hate that you made this video. Precisely because it was really good and there aren’t others.

    • blank
      Sandeep Verma
      May 17, 2022 06:20 am Reply

      That's a great video about Ansible Facts………….Thank You WIlliam

    • blank
      Swadhikar C
      May 17, 2022 06:20 am Reply

      Great video and concise presentation. subscribed! Would you make some more videos on ansible?

Leave us a comment