Would need to see your complete playbook.

Definitely don't modify the code just yet :)



On Thu, Nov 6, 2014 at 12:44 PM, Hagai Kariti <[email protected]> wrote:

> Ok, I poked around a bit and indeed found one precedence issue and one
> premature templating issue:
>
> In lib/ansible/runner/__init__.py lines 612-613:
>
>         module_vars_inject = utils.combine_vars(host_variables,
> combined_cache.get(host, {}))
>         module_vars_inject = utils.combine_vars(self.module_vars,
> module_vars_inject)
>
> module_vars are overrided by host_variables, although they are supposed to
> be of high precedence. They are being used in the correct order
> (module_vars > host_variables) when building the inject var. Changing the
> order of precedence in the above lines solves my first use-case (the
> mapping override one).
>
> In lib/ansible/playbook/play.py lines 89-90:
>
>         all_vars = utils.combine_vars(self.vars, self.playbook.extra_vars)
>         self.vars = template(basedir, self.vars, all_vars)
>
> play vars are templated without taking inventory variables into account.
> Removing these lines solves my second use-case (defining a variable in vars
> section based on inventory var with a default value).
>
> make tests seem to pass. Is there a chance that someone with more
> knowledge of how vars behave can verify if my fixes are correct? Should I
> open a PR for this?
>
> Thanks
>
> --
> 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/591094e7-c26d-4fe0-a9c2-e8c34a9f8160%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/591094e7-c26d-4fe0-a9c2-e8c34a9f8160%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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 [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/CA%2BnsWgzOrn4RKdFc%2By3CwP-bYzKFTuMP816BGbpxqyR5%3DAtfpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to