Dig deeper into Ansible and F5 integration
Published Apr 05, 2017
Version 1.0Was this article helpful?
Hi Satish,
You can define in the inventory file which BIG-IP hosts you want to run your playbook against.
Example: Inventory file
[bigips]
10.1.1.2
10.1.1.3
10.1.1.4
Playbook
- name: Onboarding BIG-IP
hosts: bigip This will run the playbook against all hosts undet tag [bigips] in the inventory file
gather_facts: false
vars_files:
- irule_var.yml
tasks:
- name: Add iRule
bigip_irule:
server: "{{inventory_hostname}}"
user: "admin"
password: "****"
module: "ltm"
name: "{{item}}"
content: "{{ lookup('file', '{{item}}') }}"
state: present
validate_certs: false
with_items: "{{irules}}"
Irule variable file (irule_var.yml)
irules:
- name_irule1
- name_irule2
- name_irule3