Hi,

I've fairly new to Ansible and I've been trying things out with it.
I'm trying to write a simple playbook. As I'd like to have the ability to 
[let others] decide what to put in some vars and by following the docs on 
vars override rules I came up with something like the following:

roles/
   php-composer/
      defaults/main.xml
      tasks/main.xml


Where defaults/main.xml contains:

---
composer_destination: ./

And one of the tasks in tasks/main.xml contains:

---
- name: install composer to "{{ composer_destination }}" 
  command: chdir={{ composer_destination }} php installer 
  when: is_composer_installer_downloaded and 
is_composer_installer_downloaded|success

When I run the above, the output is:

TASK: [php-composer | install composer to "{{ composer_destination }}"] 
*******

But if I change/move the main.xml from defaults/ to vars/ I get the 
variable "expanded", like so:

TASK: [php-composer | install composer to 
"/the/directory/specified/in/vars_mainxml/"] *******

Is this expected?
If so, how can I always get a variable "expanded" in the name definition of 
a task?

I ask as I'm looking forward to write a reusable and configurable playbook 
but I would also like to always have the variable meant to give the 
destination directory outputted when performing a run like in the latter 
output above.

Thank you in advance,
Walter

-- 
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/60ed7e76-9978-4abf-b8a6-924889842b5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to