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 retrieves a variable but how does it work or what is the value of the variable it retrieves?
- Andy_McGrath
Cumulonimbus
The
parameter is the F5 device the want to pass the module task to, in this case is a variable passed it it.host
With Ansible
is set to 'on' (it is on by default) then you have access to a load of variables you can use in your playbooks.gather_facts
With
you should get a dictionary variable set namedgather_facts
which would look like the following:ansible_default_ipv4
"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
oransible_default_ipv4.address
to reference the address index of the dictionary.ansible_default_ipv4['address']
In your playbooks you will need to use
or"{{ansible_default_ipv4.address}}"
"{{ansible_default_ipv4['address']}}"
See Ansible 2.6 Playbook Vaiables for more information.
- Joel_42834
Nimbostratus
The
parameter is not the F5 device. Rather that is thehost
parameter.server
The
parameter is an alias for thehost
parameter which is the IP address of the pool member you are acting upon.address
The
variable is usually the self IP address of the external vlan of the LTM.ansible_default_ipv4
The use of the
parameter in the examples is a bit confusing. It would have been better to just make up some IP addresses to represent the downstream servers in the pool.ansible_default_ipv4
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