Dig deeper into Ansible and F5 integration
Basics of Ansible and F5 integration were covered in a joint webinar held earlier in March 2017. To learn more about the integration and current F5 module support along with some use cases view the w...
Published Apr 05, 2017
Version 1.0Payal_S
Ret. Employee
Joined May 16, 2019
Payal_S
Ret. Employee
Joined May 16, 2019
Payal_S
Jun 06, 2018Ret. Employee
So If I get this correctly you want to run a playbook on multiple virtual servers and each virtual server has multiple irules
See if this works for you
Variable file
virtualserver:
- name: Test1
ip: "10.192.xx.xx"
irules:
- irule1
- irule2
- name: Test2
ip: "10.192.xx.xx"
irules:
- irule1
- irule3
Playbook task:
- name: Add VS on BIG-IP
bigip_virtual_server:
server: "10.192.xx.xx"
user: "****"
password: "****"
name: "{{item.name}}"
destination: "{{item.ip}}"
port: 80
irules: "{{item.irules}}"
validate_certs: False
with_items: "{{virtualserver}}"
delegate_to: localhost
Result:
changed: => (item={u'irules': [u'irule1', u'irule2'], u'ip': u'10.192.xx.xx', u'name': u'Test1'})
changed: => (item={u'irules': [u'irule1', u'irule3'], u'ip': u'10.192.xx.xx', u'name': u'Test2'})