A Quick Glance of Ansible Facts with Examples - EDUCBA
www.educba.com › ansible-factsIn the below example we will use a condition, in which we will check a fact-value on remote hosts, and then based on that value our condition will allow execution of tasks. Here, we want to create a file only on host-one, so we check using ansible facts that if ansible_hostname has a value equal to host-one. If that is true then, the file will ...
A Quick Glance of Ansible Facts with Examples - EDUCBA
https://www.educba.com/ansible-facts11.06.2020 · Here, we want to create a file only on host-one, so we check using ansible facts that if ansible_hostname has a value equal to host-one. If that is true then, the file will be created and for other remote hosts, the operation will be skipped.---hosts: all tasks: name: When hostname is host-one, create a file named example.ini under /tmp file: path: