What Git workflow do you use for Ansible code?
BeginnerProductionProject Structure and Design
Answer
Trunk-based with short-lived branches and pull requests. Branch protection requires CI (yamllint, ansible-lint, Molecule, syntax check) and one review before merging to main.
Merges to main auto-deploy to dev and stage via a pipeline, and prod needs an approval gate. Commit messages explain why the change is needed. No one runs ad hoc edits on servers, so Git history is the audit trail.
More on Project Structure and Design
What does a production Ansible repository look like?BeginnerMonorepo or separate repos for roles? How do you decide?IntermediateHow do you structure inventories for dev, stage and prod?BeginnerHow do you prevent someone from running a playbook against production by accident?IntermediateWhat does "thin playbooks, fat roles" mean?IntermediateWhat makes a well-designed role?Intermediate