Install F5 Imperative Collection¶
This document explains how to install the F5 Imperative Collection for Ansible.
Prerequisites¶
- Install Python: http://www.python.org/
- Install Ansible 2.9+: http://docs.ansible.com/ansible/latest/intro_installation.html
- F5 recommends installing Ansible, using
virtualenv/pip
(see, Install Ansible by using virtualenv)
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¶
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:
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:
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 ...