Role meta dependencies and overrides

40 views
Skip to first unread message

Mark Olliver

unread,
Feb 7, 2017, 4:03:15 AM2/7/17
to ansible...@googlegroups.com
Hi All,

I am using ansible 2.2.1.0 and have a few issues with meta dependencies.

I have a base role that is used for many of my environments. This role in turn has a meta file which defines a list of dependant roles. For example one role updates the centos yum file to use a specific mirror via a role var.

Now so far so good, however when I include the base role as a requirement for another playbook it correctly pulls in the meta dependencies and as expected runs these first. The problem being when running the role I have group_vars/all set with a variable override for the location of the mirror.
The issue here is that the on first pass as it is a dependency it is ignoring the override var.
Is there a way to ensure these are enforced on dependencies?

Thanks

Mark

Sent from my iPhone

Johannes Kastl

unread,
Feb 7, 2017, 5:18:32 AM2/7/17
to ansible...@googlegroups.com
On 07.02.17 10:03 Mark Olliver wrote:

> Now so far so good, however when I include the base role as a
> requirement for another playbook it correctly pulls in the meta
> dependencies and as expected runs these first. The problem being
> when running the role I have group_vars/all set with a variable
> override for the location of the mirror. The issue here is that the
> on first pass as it is a dependency it is ignoring the override
> var. Is there a way to ensure these are enforced on dependencies?

You can specify variables on dependencies.

https://docs.ansible.com/ansible/playbooks_roles.html#role-dependencies

Johannes

signature.asc
Reply all
Reply to author
Forward
0 new messages