Do a variable defined in vars/main.yml will be evaluated in defaults/main.yml?

8 views
Skip to first unread message

Omkar Patil

unread,
Aug 19, 2019, 11:18:14 AM8/19/19
to Ansible Project
Hello,

I have a question, I want 2 use a URL that has to be dynamically generated. I will be providing the version as a variable to the URL. So here's what I am doing.

1. I have the url variable defined in defaults/main.yml like this
    url: https://some.app.here/version-{{ version_no }}.tar.gz

2. I have the variable version_no defined in the vars/main.yml file as below.
    version_no:1.2.3

So now my question is, will this work? Will the value of url variable will be  https://some.app.here/version-1.2.3.tar.gz after evaluation?

Please let me know if this is possible? If not, please suggest me some solution to achieve the same.

Dick Visser

unread,
Aug 19, 2019, 11:24:22 AM8/19/19
to ansible...@googlegroups.com
Yes
> --
> 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-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/25308375-8456-4c17-b270-ebdf6998bd76%40googlegroups.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT
Reply all
Reply to author
Forward
0 new messages