Modifying the playbook

Regardless of how you install the collection branch, the playbook changes remain the same. This is because we are using httpapi connection plugin to connect to BIG-IP devices, therefore the connection parameters need to be set accordingly. For an explanation of the parameters, see the httpapi connection parameters page.

The following shows the older style playbook and the new style playbook.

Old Style Playbook

---

- name: Create SSLO DNS resolver
  hosts: localhost
  gather_facts: False
  connection: local

  collections:
    - kevingstewart.f5_sslo_ansible

  vars:
    provider:
      server: 10.1.1.4
      user: admin
      password: admin
      validate_certs: no
      server_port: 443

  tasks:
    - name: SSLO dns resolver
      bigip_sslo_config_resolver:
        provider: "{{ provider }}"
        forwardingNameservers:
          - "10.1.20.1"
      delegate_to: localhost

New Style Playbook

---

- name: Create SSLO DNS resolver
  hosts: localhost
  gather_facts: False
  collections:
    - f5networks.f5_bigip
  connection: httpapi

  vars:
    ansible_host: 10.1.1.4
    ansible_user: "admin"
    ansible_httpapi_password: "admin"
    ansible_network_os: "f5networks.f5_bigip.bigip"
    ansible_httpapi_use_ssl: true
    ansible_command_timeout: 1800
    ansible_httpapi_use_proxy: false
    ansible_httpapi_validate_certs: "no"
    ansible_httpapi_port: "443"


  tasks:
    - name: SSLO dns resolver
      bigip_sslo_config_resolver:
        forwardingNameservers:
          - "10.1.20.1"

For SSLO modules, because the tasks are longer running, we recommend setting the ansible_command_timeout parameter to some higher value, as the default is 30 seconds, which may cause playbook failures. The value of this parameter will depend on the system and environment. Moreover, ansible_httpapi_use_proxy is by default set to true, so if there are no proxies in your environment, this setting needs to be set to false.

Finally, if you wish to reuse the provider variable, your new playbook could look something like the following:

---

- name: Create SSLO DNS resolver
  hosts: localhost
  gather_facts: False
  collections:
    - f5networks.f5_bigip
  connection: httpapi

  vars:
    ansible_host: "{{ provider.server }}"
    ansible_user: "{{ provider.user }}"
    ansible_httpapi_password: "{{ provider.password }}"
    ansible_httpapi_port: "{{ provider.server_port }}"
    ansible_network_os: f5networks.f5_bigip.bigip
    ansible_httpapi_use_ssl: yes
    ansible_httpapi_use_proxy: false
    ansible_command_timeout: 1800
    ansible_httpapi_validate_certs: "{{ provider.validate_certs }}"

  tasks:
    - name: SSLO dns resolver
      bigip_sslo_config_resolver:
        forwardingNameservers:
          - "10.1.20.1"