This style guide is designed to ensure consistent style and practices across M-Lab's Ansible playbooks and associated Ansible files.
To propose an addition or change to the style guide:
This style guide is modeled after Google Style guides, for example:
In particular, style decisions should include both a clear explanation of the style choice and the rationale for the decision.
This style guide is an extension of the Ansible Playbook Best Practices. If contradictions arise between the two documents, the Playbook Best Practices take priority and this style guide should be modified to eliminate the contradiction.
Use line breaks and indentation to separate parameters to Ansible modules, for example:
# Correct
- name: create foo temp directory
file: path=/tmp/foo
state=directory
owner=bar
group=fooers
# WRONG
- name: create foo temp directory
file: path=/tmp/foo
state=directory owner=bar group=fooers # WRONG: multiple params on line
owner
,
group
, mode
for several modules)