How do you organize your Ansible related content in your organizations?
A little background for why I’m asking: I am relatively new to my company, and have inherited a lot of Ansible technical debt. Even though I am new to the scene, I am pretty much the Ansible lead even though my only other Ansible team member is my Linux team lead (Linux team is much larger, but we’re on the Infra side).
Almost all of the existing Ansible content is in a single GitHub repository, and is all playbooks with import_playbook/include_tasks that would be better suited as roles. There’s a lot of things that are standard/common to all inventory hosts, and a lot of things that are application specific (and plenty of rhel 7/8/9 variants of the same thing, which again is better suited as a role that dynamically handles w/e differences there are between major OS releases).
I can write these roles just fine. That part is easy for me. I would also like to group related roles into collections. And, so far, I have two namespaces to place all of these collections under. One is for redoing legacy content, and the other is specifically for AWX CI pipelines that I’m working on.
How do you organize your Namespaces, Collections, Roles, Playbooks, and AWX “projects” in your git source control? Right now, I have a namespace level repo with all of the collections and subsequent roles, and added this repo as a git submodule to the legacy Ansible repo. Then I’ve started creating new playbooks to use those in the legacy repo to try and migrate old playbooks to the new ones. Unfortunately, I’ve grown to dislike this approach because it feels absolutely cluttered, but I’m not sure how I might reorganize this into something more manageable without simultaneously breaking the existing workflow.
Would it make more sense to have each collection in its own repo, so that I can actually add git release tags to match the collection version?
Edit: Just found How to arrange structure for the case multiple projects - Get Help - Ansible again, I saw this the other day and tried to find it again before posting here. I definitely appreciate @utoddl’s insights there. Made myself a bookmark this time.
Do we have any sort of FAQ/Guide/skeleton/overview for this sort of thing anywhere?