$ ansible --version
ansible 2.10.8
I believe this is a different issue from Ansible's set_fact
not working at all.
I have the following variable defined in group_vars/all.yml
nexus_repo = "dev_builds"
nexus_url = "https://nexus.company.com/{{ nexus_repo }}"
Then on one of my tasks, I do
- name: Adjust nexus_repo value for release builds
set_fact:
nexus_repo: "release_builds"
nexus_url: "https://nexus.company.com/{{ nexus_repo }}"
- debug: msg="{{ nexus_url }}"
When I run my playbook (my-playbook.yml
runs my-role.yml
), I just see
$ ansible-playbook -i inverntories/hosts.yml -e var_hosts=my-host my-playbook.yml
TASK [my-role : Adjust nexus_repo value for release builds] ****************
ok: [10.227.x.x]
TASK [my-role : debug] *****************************************************
ok: [10.227.x.x] => {
"msg": "https://nexus.mycompany.com/repository/dev_builds"
}
Why is that?