Forum Discussion

ARsenthil_30459's avatar
ARsenthil_30459
Icon for Nimbostratus rankNimbostratus
Jan 03, 2017

[Ansible] get all the pools that a node belongs to

I am trying to create a node by node playbook using ansible bigsuds. The bigip_facts returns all the pool's information. In our case , a single node is part of multiple pools. I wanted to get all the pools as a variable that a node belongs to.

 

The playbook yaml: - name: Test bigip_facts hosts: bigip connection: local

 

tasks: - name: Get all of the facts from my BIG-IP bigip_facts: server: "{{ inventory_hostname }}" user: "user" password: "pass" include: "pool" validate_certs: "false"

 

Ex: { "pool": { "/Common/test_8080": { "action_on_service_down": "SERVICE_DOWN_ACTION_NONE", "active_member_count": 0, "aggregate_dynamic_ratio": 0, "allow_nat_state": "STATE_ENABLED", "allow_snat_state": "STATE_ENABLED", "client_ip_tos": 65535, "member": [ { "address": "/Common/192.168.1.101", "port": 8080 }, { "address": "/Common/192.168.1.102", "port": 8080 } ] }, "/Common/test_8090": { "action_on_service_down": "SERVICE_DOWN_ACTION_NONE", "active_member_count": 0, "aggregate_dynamic_ratio": 0, "allow_nat_state": "STATE_ENABLED", "allow_snat_state": "STATE_ENABLED", "client_ip_tos": 65535, "member": [ { "address": "/Common/192.168.1.101", "port": 8090 }, { "address": "/Common/192.168.1.102", "port": 8090 } ] } } }