> On 2015-12-09, at 00:10, Brian Coca <bc...@ansible.com> wrote:
> 
> I'm not understanding the problem, can you post an acual example and also 
> what versions you are using?

There are several roles with practically the same structures:

- role0
  - defaults
    - main.yml
  - tasks
    - main.yml
    - task1.yml
    - task2.yml
    - etc.yml

- role1
  - defaults
    - main.yml
  - tasks
    - main.yml
    - task1.yml
    - task2.yml
    - etc.yml

- role2
  - defaults
    - main.yml
  - tasks
    - main.yml
    - task1.yml
    - task2.yml
    - etc.yml

and so on. There are other directories but "vars" are empty in all of them. 
Each role's "main" task uses variables defined in respective "defaults" but 
also includes other tasks from the same role and tasks directory. While default 
values are all fine as long as they are used before the first

- include?: task1.yml

they get their values overwritten with some defaults from another role (sic!) 
once finished processing the included task file. Now that looks to me like a 
bug but I might be missing something.

A real example:

# Prerequisities / system dependencies
- name: install python http library
  apt: name={{item}} state=present
  with_items:
    - python-httplib2

# Configuring PHP
- include: php.yml

# Configuring database
- include: database.yml

# Configuring network
- include: network.yml

# Configuring httpd
- include: httpd.yml

# Getting and preparing / installing the code
- name: clone repository
  git: repo={{repository}} dest={{destination}} accept_hostkey=yes

When I place git above the included tasks then {{destination}} is correct. When 
I place it below any of the included tasks, then the destination gets wrong 
value of a default from a completely different role...


> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Ansible Project" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/ansible-project/gWN-uuj7NRI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mnDeE7uv5M7gypoGjHsrX157KL-qvkn3n5t7G8UyYrJQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/67E4921B-1B16-4D35-BA05-B79BA84EDA91%40srebrnysen.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to