Hello,
I have a very specific task where I need deploy f5 configurations - They 
all are kept in yaml file.
Is it possible to read values from dynamically generated fact names?

ansible playbook:

    - name: Generate list of pools
      set_fact:
        "pool_{{ item.id }}": []
      loop: "{{ config.pools }}"
    - name: Generate list of monitors
      set_fact:
        "pool_{{ item.0.id }}": "{{ ('pool_' + item.0.id) }} + [ 
'/Common/{{ item.1.name }}' ]"
      loop: "{{ config.pools|subelements('monitors') }}"


Generate list of monitors doesn't work as expected it returns: 

ok: [127.0.0.1] => {
    "msg": "pool_001 + [ '/Common/monitor1' ]"
}

but supposed to return an array with two monitors.

Yaml config:

server: 192.168.56.20
pools:
  - id: "001"
    name: POOL
    partition: Common
    monitors:
      - name: "monitor1"
        send: 'GET /status HTTP/1.1\r\nHost: localhost\r\nConnection: 
Close\r\n\r\n'
        receive: "up"
      - name: "monitor2"
        send: 'GET /status1 HTTP/1.1\r\nHost: localhost\r\nConnection: 
Close\r\n\r\n'
        receive: "in-release"
    port: 80
    pool_members:
      - "node1.example.com"
      - "node2.example.com"


Any help appreciated.
Thanks!

-- 
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/a55a9e26-da27-4f7e-b9c7-85b22c2d7721%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to