Ansible Workflow with Roles as Git Submodules

943 views
Skip to first unread message

Steffen Prince

unread,
Aug 15, 2014, 1:30:33 AM8/15/14
to ansible...@googlegroups.com
What are people's experiences with using git submodules to incorporate reusable roles into Ansible repos?

We've just started trying this out because we are incorporating roles from affiliated public role repos as submodules, and we need to manage integration of public roles into private "master" repos. We need to be able to make edits to submodules and push those out to the public roles without a lot of overhead. We also need to keep multiple developers in sync.

Any experiences, regrets, or recommendations with regards to Ansible roles as submodules? Any recommendations for submodule workflows, or alternate strategies such as managed vendoring ala golang?

Will Thames

unread,
Aug 15, 2014, 1:35:55 AM8/15/14
to ansible...@googlegroups.com
I think the solutions discussed in https://groups.google.com/forum/#!topic/ansible-project/TawjChwaV08
start to look like managed vendoring ala golang.

Not to say it's the only solution and git submodules might work, but the above approach is where I'm thinking of going with managing versioning of roles.

Will

Jim Gumbley

unread,
Aug 15, 2014, 7:32:34 AM8/15/14
to ansible...@googlegroups.com
Keep it simple solution is to just copy paste the code in. I'd wager for most vendored roles the benefits of the upstream changes will be outweighed by the cost of maintaining the submodule connections.


--
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/3ad574ad-71ff-4e6b-ba43-0a6f058e79f1%40googlegroups.com.

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



--
Jim Gumbley
Telephone
+44 7521 266838
ThoughtWorks

Steffen Prince

unread,
Aug 15, 2014, 12:17:03 PM8/15/14
to ansible...@googlegroups.com
We are the maintainers of the upstream repos in this case. I'm starting to think, though, that we need to shift the burden to the side of keeping upstream repos up-to-date, and keep our working repositories nice and simple. I don't want our working repos to be brittle, and I can already see that's going to be the case with submodules.

So what I intend to do is just vendor the roles in from the upstream repos so that developers can use a normal git workflow in the working repos. But I would like to look at scripting the process of updating our upstreams. We'll have to live with either losing or recreating commit messages when updating our upstream repos, but I think it's a small price to pay for a simplified and robust workflow in the working repos.

Michael DeHaan

unread,
Aug 15, 2014, 12:52:10 PM8/15/14
to ansible...@googlegroups.com
Generally you'll find roles in things like galaxy are just starting points, and it's not expected that you follow them as upstream copies change.

I would consider starting your own company roles repo, maybe call it foocorp-roles, as you are likely going to want modifications.

But I would not look at it as per-project vendoring or anything complicated like that.

It's not source code, and most likely the content is not going to need to change, so use things as a starting point, and then make them your own.

--Michael




Reply all
Reply to author
Forward
0 new messages