Ansible variables precedence

19 views
Skip to first unread message

nitesh jindal

unread,
Jul 12, 2021, 3:18:27 AM7/12/21
to Ansible Development
Hi All

having a query about variable precedence.
Having roles calling like this:

playbook/testplay.yml 
---
{role: testrole.yml, action: testplay}

roles/testrole.yml
---
{role: nexttestrole.yml, action: testnext}

roles/nexttestrole.yml
- name: print variable
  ansible.builtin.debug:
    var: action


As per variable precedence order, it should refer most recent one, but here it prints testplay, instead of testnext. anyone got clue about this if this behavior is right? ans also how can I make it to print "testnext"
Reply all
Reply to author
Forward
0 new messages