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?
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.
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.
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.