Hello,

I'm blocking on this all the weekend.

I'm trying to build dynamically a variable with "item" for browsing in a 
list.

  - debug:
      msg: "{{ item.dev }} "
    loop: "{{ nginx }}"


This is working well.

But I need to have the choice of the environment.

I tried this:

  - debug:
      msg: "{{ lookup('vars', 'item.' + environnement }} "
    loop: "{{ nginx }}"


The output is:


fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an 
undefined variable. The error was: 'dict object' has no attribute 
'item.dev'\n\nThe error appears to have been in '': line 22, column 5, but 
may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe 
offending line appears to be:\n\n\n - debug:\n ^ here\n"}

I tried a lot of thing, but I didn't find the right one.

Any advice?

Thank,
Guillaume

-- 
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/f0d454de-ba7e-4dd0-bfe6-e879e18eb981%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to