Working with Ansible Galaxy Roles

41 views
Skip to first unread message

Matt Davies

unread,
Oct 16, 2018, 12:25:52 PM10/16/18
to Ansible Project
Hi Everyone

There's about 10 developers working on our ansible codebase, configuring approx 20 VM's, it's going to grow rapidly.

We've just started working with ansible galaxy roles and I was wondering if anyone has any links/tips/suggestions on how to manage the workflow?

We'd like to be able to update the ansible galaxy roles easily.

Are we talking about using git submodules here? I've read a bit about a requirements file?

Any tips or help will be greatly appreciated.

Thanks in advance

Matt

Jonathan Lozada De La Matta

unread,
Oct 16, 2018, 12:30:05 PM10/16/18
to ansible...@googlegroups.com
checkout requirements.yml and having each role in a seperate git repo.

--
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.
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/97794648-0778-4f8d-a232-3afbf1fecb58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Jonathan lozada de la matta

AUTOMATION PRACTICE



 

Matt Davies

unread,
Oct 16, 2018, 12:37:21 PM10/16/18
to Ansible Project
Thanks for the prompt response Jonathan

So the roles being separate git repos would then be git submodules?

Is that the idea?

I'll read up on requirements.yml now.

Matt
 

ngo...@gmail.com

unread,
Oct 16, 2018, 1:17:40 PM10/16/18
to Ansible Project
You can also update ansible.cfg to point to one or more role directories.  Which is nice if each of your roles is in a git repo, but you want to work on things locally without pushing up changes every time.  See the roles_path option: https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-roles-path

Jonathan Lozada De La Matta

unread,
Oct 16, 2018, 1:18:53 PM10/16/18
to ansible...@googlegroups.com
not exactly. Each role will be in its own git repository then requirements.yml will list all the roles you need for that specific play. Makes it easier to manage the roles in different git repositories and not have other changes mixed together.

--
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.
To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mischa ter Smitten

unread,
Oct 16, 2018, 1:51:04 PM10/16/18
to Ansible Project
I can really recommend submodules, but it's probably a bit more advance than requirements.yml. We manage over 150 roles this way and it's working like a charm.
Reply all
Reply to author
Forward
0 new messages