Forum Discussion
dani_martinez_2
Nimbostratus
May 09, 2018host parameter in bigip_pool_member
Hello I am quite new to Automation, could someone explain what is the meaning of the field:
host: "{{ ansible_default_ipv4['address'] }}", for the ansible module bigip_pool_member.
I assume it retrie...
Andy_McGrath
Cumulonimbus
Aug 07, 2018The
host parameter is the F5 device the want to pass the module task to, in this case is a variable passed it it.
With Ansible
gather_facts is set to 'on' (it is on by default) then you have access to a load of variables you can use in your playbooks.
With
gather_facts you should get a dictionary variable set named ansible_default_ipv4 which would look like the following:
"ansible_default_ipv4": {
"address": "10.0.0.1",
"alias": "eth0",
"gateway": "10.0.0.254",
"interface": "eth0",
"macaddress": "REDACTED",
"mtu": 1500,
"netmask": "255.255.255.0",
"network": "REDACTED",
"type": "ether"
},
You can then use
ansible_default_ipv4.address or ansible_default_ipv4['address'] to reference the address index of the dictionary.
In your playbooks you will need to use
"{{ansible_default_ipv4.address}}" or "{{ansible_default_ipv4['address']}}"
See Ansible 2.6 Playbook Vaiables for more information.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
