On 05.06.2019 08:29, eric sandgren wrote:
First I'm a sysadmin not a developer I often use ansible to set up things
in f5 -ltm i often need to add several hosts to a number of pools. The
loadbalancing setup in f5 products in a glance consist of av VIP (virtual server) that is linked to a Pool containing one or more physical servers.
I get stuck in how to set up the loop, i define this first
var_node:
       - { host: 1.2.3.4, name: server1.com }
       - { host: 1.2.3.5, name: server2.com }
var_pool:
       - { pool: pool1, port: 80 }
       - { pool: pool2, port: 8080 }
       - { pool: pool3, port: 443 }

The module ii'm trying to use

- name: add nodes to pools
      bigip_pool_members:
        provider: "{{ provider }}"
        partition: "{{ partition }}"
        pool:{{ item.pool }}          "here I want to loop var_pool
        name: "{{ item.name }}    "here I want to loop var_node"
        port: "{{ item.port}}           "and again ....var_pool"
     loop: ?????

I realize I'm probably on a dead end thinking this way any good input from
a developer-mind would be extremely appreciated

You are looking for with_together
https://docs.ansible.com/ansible/2.4/playbooks_loops.html#looping-over-parallel-sets-of-data


--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c282ec9f9372df6713b5a827c9d0e6f4%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to