Re: [ansible-project] variables messed up when using including tasks

2015-12-13 Thread silverdr
> On 2015-12-13, at 01:07, Igor Cicimov wrote: > > Well of course they get overwritten in the *same* play since all variables > are *global* during the play execution, Well, until yesterday I wouldn't say "of course". If I used host variables, then I would understand this as being "of course"

Re: [ansible-project] variables messed up when using including tasks

2015-12-12 Thread Igor Cicimov
Well of course they get overwritten in the *same* play since all variables are *global* during the play execution, otherwise if you call group1 after group0 what will happen is group1 will get the variables from group0, which is not desirable, right? What you need to do is rethink your playbook

Re: [ansible-project] variables messed up when using including tasks

2015-12-12 Thread silverdr
I /think/ I know where the problem comes from: I encountered it with group vars defined in the inventory file. I eventually moved both the role variables and group_vars into inventory file, trying to establish one place where the variables are defined. Now: My inventory file looks like this (IP

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread Igor Cicimov
Also if you can put - debug: var=destination before and after every include call would be very helpful to see where the var actually gets changed. Just realized that my previous message might not be clear enough, what I mean is add: --extra-vars '{"destination":"some_value_here"}' to the ans

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread Igor Cicimov
Just out of curiosity, what happens when you supply destination via extra_vars and leave everything as it was in defaults file? On Friday, December 11, 2015 at 11:09:30 AM UTC+11, silverdr wrote: > > > > On 2015-12-10, at 23:13, Igor Cicimov > wrote: > > > > Strange, because I'm sure every ti

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread silverdr
> On 2015-12-10, at 23:13, Igor Cicimov wrote: > > Strange, because I'm sure every time I call a tasks file from another role I > have to explicitly include that role's defaults|vars file via vars_files to > be able to use its variables. Actually I stay within one role. The problem is that wh

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread silverdr
> On 2015-12-10, at 23:13, Igor Cicimov wrote: > > Strange, because I'm sure every time I call a tasks file from another role I > have to explicitly include that role's defaults|vars file via vars_files to > be able to use its variables. So you are saying you are seeing this happen > without

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread Igor Cicimov
Strange, because I'm sure every time I call a tasks file from another role I have to explicitly include that role's defaults|vars file via vars_files to be able to use its variables. So you are saying you are seeing this happen without this linking. Do you mind showing us the whole main playbook

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread patrycjusz . logiewa
> On 2015-12-09, at 22:35, Igor Cicimov wrote: > > Do you by any chance have some of those vars also defined in the > group_vars/all file? In that case they overide the ones in the roles default > file causing unexpected results for people unaware of this fact. No, that would actually explain

Re: [ansible-project] variables messed up when using including tasks

2015-12-09 Thread Igor Cicimov
Do you by any chance have some of those vars also defined in the group_vars/all file? In that case they overide the ones in the roles default file causing unexpected results for people unaware of this fact. -- You received this message because you are subscribed to the Google Groups "Ansible P

Re: [ansible-project] variables messed up when using including tasks

2015-12-08 Thread silverdr
> On 2015-12-09, at 00:10, Brian Coca 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

[ansible-project] variables messed up when using including tasks

2015-12-08 Thread silverdr
Hello, group, I encountered a strange problem with variables when running a role. The role has some defaults and the variables are used throughout the plays. At some point in the tasks/mains playbook, there are included other tasks from the same directory. Those also include tasks from root dir