Install F5 Modules Collection

This document explains how to install the F5 Modules for Ansible.

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.

Installing Collections

Both the official or daily build are placed in this folder structure: ./collections/ansible_collections/f5_modules

Official Releases

Daily Build (testing pre-released updates)

  • Download the daily build from AWS S3:

    wget https://f5-ansible.s3.amazonaws.com/collections/f5networks-f5_modules-devel.tar.gz

  • Install the collection build that was downloaded:

    ansible-galaxy collections install f5networks-f5_modules-devel.tar.gz


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: local
    
      tasks:
        - f5networks.f5_modules.bigip_pool:
            name: my-pool
            partition: Common
            ...
    
  2. Specify the collection for the entire play (any module found in the collection will be used before core)

    - name: Use Collections
      hosts: f5
      connection: local
    
        collections:
          - f5networks.f5_modules
    
        tasks:
          - bigip_pool:
              name: my-pool
              partition: Common
              ...
    

Ansible Collection Documentation

For more details on Ansible Collections, see the Ansible documentation