How to skip Role Dependencies?

2,635 views
Skip to first unread message

howa...@gmail.com

unread,
Dec 8, 2013, 4:34:19 AM12/8/13
to ansible...@googlegroups.com
Sometimes, we would like deploy a machine without the need for checking  the "Role Dependencies", because it is very slow for our playbook (up to 5 mins), is it possible?

Thanks.

Brian Green

unread,
Dec 8, 2013, 10:07:56 AM12/8/13
to ansible...@googlegroups.com
Have you tried something like:

---
dependencies:
    - { role: some_role, when: some_role_dependency is not defined }

ansible-playbook -i hosts some_role.yml -e "some_role_dependency=false"     - skips dependency
ansible-playbook -i hosts some_role.yml                                                        - executes dependency

Michael DeHaan

unread,
Dec 8, 2013, 10:54:04 AM12/8/13
to ansible...@googlegroups.com
When you say "checking role dependencies" is slow, can you elaborate?

There's a feature of Ansible called role dependencies which has nothing at all to do with the network, nor does it run any tasks, so I'm pretty sure we're not talking about the same thing.

Or if we are, you've somehow got a super-strange recursive loop going on that we didn't anticipate and it's not going to get done ever -- but you said it does get done.

In either case, more info would be great!




--
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-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

Chris Arnesen

unread,
Oct 9, 2014, 1:11:25 PM10/9/14
to ansible...@googlegroups.com
He just means that sometimes the user wants to run a role without having to first run through all its dependencies, something like:

ansible-playbook foo.yml --skip-role-dependencies

which would run the roles as if they had no dependencies.

Michael Peters

unread,
Oct 9, 2014, 3:57:33 PM10/9/14
to ansible...@googlegroups.com
I do this by tagging each dependent role as 'dependent-role' and then
use the --skip-tags dependent-role when I need to execute just the top
level role (usually only for testing).
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d515f22c-a079-44c8-ad34-49cd51e47814%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages