I don't fully agree with you.
Because I set "applicationname" to "{{ APPLICATIONNAME }}" when I call the 
role in the playbook:

- include_role: 
    name: role1 
    applicationname: "{{ APPLICATIONNAME }}" 
    description: "{{ DESCRIPTION }}"

Problem is, that "{{ APPLICATIONNAME }}" at this point is undefined.

And again, I think the problem with 
- name: check required vars when applicationname is not defined
  debug: msg="Variable '{{ item }}' is not defined"
  when: vars[item] is not defined
  with_items: "{{ required_vars }}" 

is, that vars[item] is not undefined.
Why? Because "applicationname" seems to have a value:

TASK [role1 : debug] ***********************************************

ok: [server1] => {
    "vars": {

        "applicationname": "{{ APPLICATIONNAME }}"

Maybe it is misinterpreted as a string "{{ APPLICATIONNAME }}"
Therefore, when: vars[item] is not defined does not work as expected

Hope you can follow me.

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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to