Forum Discussion

e0013192's avatar
e0013192
Icon for Altostratus rankAltostratus
Aug 24, 2022
Solved

Bigip_device_info for ltm-policies doesn't have an action of forward

I'm trying to figure out how to get a list of the pools we are forwarding to in our policies.  I don't see the action in the bigip_device_info for forward.  I've tried to use the REST API with the Ansible url command but then I don't know how to parse the output so I just get the pool names.  I need the pool names that the policy is forwarding to so I can check the status of the pools and the members.  Any suggestion wouls be greatly appreciated.

7 Replies

  • Thank you for your reply but I'm not sure those solutions will help.  I'm pulling the bigip_device_info based on a virtual-server then I'm parsing the policy name and getting the facts for the policy also using the bigip_device_info.  The issue is that subset of the ltm-policy fact from the bigip_device_info module doesn't provide a way to get the pools we are forwarding to.  i have to be able to find the pools associated with the access policy without know what the pool name are which is why I'm using the facts.  

    This is what I'm doing.

       

     

        - name: json_query - VIP address
          set_fact:
            vip_result: "{{ bigip_facts.virtual_servers|default({}) | json_query(jmesquery) }}"
          vars:
            jmesquery: "[?destination=='/Common/{{ item.destination_address }}:{{ item.destination_port }}'].{virtual_name: name, destination_address: destination_address, destination_port: destination_port, snat_pool: snat_pool, default_pool: default_pool, persistence_profile: persistence_profile, profiles: profiles[*].{context: context,name: name}, policy_name: policies[*], irules: irules[*], virtual_state: availability_status virtual_enabled: enabled}"
          loop: "{{ vip }}"
    
        - name: json_query - Policy
          set_fact:
            policy_result: "{{ vip_result[0].policy_name }}"
          loop: "{{ vip }}"
    
        - name: json_query - Policy Details
          set_fact:
            policy_details: "{{ bigip_facts.ltm_policies|default({}) | json_query(jmesquery) }}"
          vars:
            jmesquery: "[?full_path=='{{policy_result}}']"
          when: vip_result[0].policy_name is defined

     

  • I'm familiar with the command module but my issue there is how to parse the stdout so that I can further use the results in other tasks.   I need the pool names to complete the decommisioning of the pools and the nodes.