[ovirt-devel] [rhevm-qe-automation/ovirt-ansible] Question on where does the jinja2 var {{ ansible_fqdn }} get set
Tasdik Rahman
prodicus at outlook.com
Wed May 24 11:52:40 UTC 2017
Hey Moti,
I overlooked the general pattern of “ansible_*”. Was successful in what I was trying to do with it. Thanks for the help :)
Regards,
Tasdik Rahman
http://tasdikrahman.me/
On 24-May-2017, at 3:23 PM, Moti Asayag <masayag at redhat.com<mailto:masayag at redhat.com>> wrote:
Hi Tsadik,
On Tue, May 23, 2017 at 12:17 PM, Tasdik Rahman <prodicus at outlook.com<mailto:prodicus at outlook.com>> wrote:
Hello,
I was having a look at the ansible playbooks to autmate the installation of ovirt-engine on a remote host here at https://github.com/rhevm-qe-automation/ovirt-ansible/ specifically the role engine-setup. I was curious where this jinja variable {{ansible_fqdn}} gets set. I could not see it being assigned in the playbooks. Or do we set it during the playbook execution as a command line arg?
The ansible_fqdn is taken from ansible facts. You can evaluate it on the target host by running (replace target_host_name with the proper host name or localhost for testing only):
ansible target_host_name -m setup -a 'filter=ansible_fqdn'
You can read more about jinga filters by facts here:
http://docs.ansible.com/ansible/playbooks_variables.html#jinja2-filters
Also, you can read more about fact/variables precedence here:
http://docs.ansible.com/ansible/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
Relevant search https://github.com/rhevm-qe-automation/ovirt-ansible/search?utf8=%E2%9C%93&q=ansible_fqdn&type=
Regards,
Tasdik Rahman
http://tasdikrahman.me/
_______________________________________________
Devel mailing list
Devel at ovirt.org<mailto:Devel at ovirt.org>
http://lists.ovirt.org/mailman/listinfo/devel
--
Regards,
Moti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20170524/c5125a6c/attachment-0001.html>
More information about the Devel
mailing list