Ansible F5 device provider object
When monitoring and configuring F5 (also referred to as F5 BIG-IP) network devices via Ansible, a provider dictionary object that contains connection information and credentials is required to access a device. The object is passed as an argument to the Ansible modules (e.g., bigip_command, bigip_config) that manage the device. When using the Automation Gateway module execution API to run Ansible bigip modules, the provider object is required to be in JSON format. Below is the JSON schema for the provider object found in the F5-BIGiP module decorations certified by Itential. Additional information about the provider object can be found in the Ansible documentation.
ansible_provider inventory variable
Starting in release 2019.3, in addition to support for Ansible connection inventory variables (e.g., ansible_host, ansible_connection, ansible_network_os), support has been added for the Automation Gateway specific inventory variable ansible_provider. This variable is of type object and supports the exact same fields as the F5 provider object shown in the JSON schema. Like all other inventory variables, this variable is added when configuring a device using the AG device APIs, or included in the Ansible device inventory file when running in external inventory mode.
Sample F5 device inventory configuration
In order to avoid AG clients having to include a JSON provider object for each F5-BIGIP module execution, AG will automatically construct the object using the contents of the ansible_provider inventory variable fields and add it as a module execution argument. The ansible_network_os variable must be set to bigip and be present at the host level for this conversion to occur. If a provider object is already present as a module argument, the contents of the argument will be used instead of the contents of the host’s ansible_provider inventory variable.
When managing F5 devices via the Itential provided roles (e.g., itential_cli, itential_get_config), the ansible_provider inventory variable must be configured for the F5 devices that are present in the hosts parameter of the Automation Gateway role execution API.
Sample INI inventory file with ansible_provider variable
The variable ansible_provider must be a valid JSON string passed in single quotes (').