Install F5 Modules for Ansible¶
This document explains how to install the F5 Modules for Ansible.
Install the latest version of Python (2.7 minimum) if you do not already have it.
Install Ansible Core¶
Next, install Ansible (2.7.0 or later):
F5 recommends that you install Ansible by using virtualenv/pip. For an example, see Install Ansible by using virtualenv.
Install F5 Ansible Collections¶
The final task is to install the F5 Ansible Collections.
- Ansible 2.9 or later
- 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
Both the official or daily build are placed in this folder structure: ./collections/ansible_collections/f5_modules
View the F5 Collection releases: https://galaxy.ansible.com/f5networks/f5_modules
Install the most recent release:
ansible-galaxy collection install f5networks.f5_modules
Daily Build (testing pre-released updates)¶
Download the daily build from AWS S3:
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:
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
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