look like i've the proper json_query





 -  debug: msg="{{ item }}"
    with_items:
      - "{{ SERVICE.MC|json_query('*.PIM_GROUP') }}"

which gives

    "msg": [
        "GS_SIGMAX_MC_A_PIM", 
        "GS_SIGMAY_MC_A_PIM"
    ]




Le lundi 24 juillet 2017 22:34:12 UTC+2, Francois Herbet a écrit :
>
>
> Hi Guys need some advice on this case
>
>
> here's my hostvars
>
> ---
> SERVICE:
>     MC:
>         GS_SIGMAX_MC_A_import:
>             PIM_GROUP: GS_SIGMAX_MC_A_PIM
>         GS_SIGMAY_MC_A_import:
>             PIM_GROUP: GS_SIGMAY_MC_A_PIM
>
>
>
> i'd like to populate a list of "PIM_GROUP" values whatver the previous 
> dict name is (xxx_import)
>
>
>
> currently this task 
>
>  -  debug: msg="{{ item }}"
>     with_items:
>       - "{{ SERVICE.MC }}"
>
>
>
> gives :
>
> "item": {
>         "GS_SIGMAX_MC_A_import": {
>             "PIM_GROUP": "GS_SIGMAX_MC_A_PIM"
>         }, 
>         "GS_SIGMAY_MC_A_import": {
>             "PIM_GROUP": "GS_SIGMAY_MC_A_PIM"
>         }
>     }, 
>     "msg": {
>         "GS_SIGMAX_MC_A_import": {
>             "PIM_GROUP": "GS_SIGMAX_MC_A_PIM"
>         }, 
>         "GS_SIGMAY_MC_A_import": {
>             "PIM_GROUP": "GS_SIGMAY_MC_A_PIM"
>         }
>     }
>
>
>
>
>
>
> do i need json_query  for that or there's an easier way ?
>
>
> thanks !
>
> \\ François
>

-- 
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/2b3ac7c0-f06c-4600-a9c8-6ceef52d292f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to