Install F5 BIG-IP Collection v2¶
This document explains how to install the f5_bigip collection.
Prerequisites¶
- Install Python: http://www.python.org/
- Install Ansible 2.9+: http://docs.ansible.com/ansible/latest/intro_installation.html
- F5 recommends you install Ansible by using virtualenv/pip.
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¶
View the F5 Collection releases: https://galaxy.ansible.com/f5networks/f5_bigip
Install the most recent release:
ansible-galaxy collection install f5networks.f5_bigip
Install from Github¶
ansible-galaxy collection install git+https://github.com/F5Networks/f5-ansible-bigip.git#ansible_collections/f5networks/f5_bigip -p ./collections/
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:
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') }}"
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