On 12.03.2019 14:41, fusillator wrote:
> Hi Kai, in my current release 2.3.2.0 the hash vars is undefined
I have been using vars for a long time so it's strange it don't work for you,
so I did a test in my Ansible 2.3.2 test environment and it work great for me.
$ find roles/test/
roles/test/
roles/test/defaults
roles/test/defaults/main.yml
roles/test/default/main.yml
---
fromtestrole: "from default in test role"
$ ansible-playbook --version | head -1
ansible-playbook 2.3.2.0
playbook.yml
---
- hosts: localhost
gather_facts: no
pre_tasks:
- debug: msg="{{ vars['fromtestrole'] }}"
roles:
- test
$ ansible-playbook playbook.yml
PLAY [localhost] ***************************************************************
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "from default in test role"
}
PLAY RECAP *********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0
--
Kai Stian Olstad
--
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/ce9de8b6-548d-0a24-1a2a-c3b09ce82e9b%40olstad.com.
For more options, visit https://groups.google.com/d/optout.