Install F5 BIG-IP Collection v2

This document explains how to install the F5 BIG-IP Collection.

Prerequisites

Install the Collection

After installing Python and Ansible, the final task is to install the F5 Ansible Collections.

In the following examples, we assume collections are stored in a relative path to the working directory. All commands are run in the working playbook directory.
To set the working directory, add the following line to ansible.cfg in your working directory: collections_paths = ./collections.
If you do not set the relative path, the default path is ~/.ansible/collections.

Install Location

The installation location is relative based on the configuration in the previous steps: ./collections/ansible_collections/f5_bigip

Official Releases

Install from Github

ansible-galaxy collection install git+https://github.com/f5devcentral/f5-ansible-bigip.git#ansible_collections/f5networks/f5_bigip -p ./collections/

Git Install Docs

Note

-p is the location in which the collection is installed. This location should be defined in the path for Ansible to search for collections. An example of this would be adding collections_paths = ./collections to your ansible.cfg.

Referencing a Collection in a playbook

There are two options for referencing a Collection in a playbook:

  1. Preface each module, role, or resource with the collection name:

    - name: Use Collections
        hosts: f5
        connection: httpapi
    
        tasks:
        - f5networks.f5_bigip.bigip_as3_deploy:
            content: "{{ lookup('file', 'declarations/as3.json') }}"
    
  2. Specify the collection for the entire play (any module found in the collection is used before core):

    - name: Use Collections
        hosts: f5
        connection: httpapi
    
        collections:
        - f5networks.f5_bigip
    
        tasks:
        - bigip_as3_deploy:
            content: "{{ lookup('file', 'declarations/as3.json') }}"
    

Ansible Collection Documentation

For more details on Ansible Collections, see the Ansible documentation