LinkORB Engineering

Rules in [#ansible]

Ansible


Rule: All Ansible Yaml files MUST have a .yml extension (and NOT .YML, .yaml etc).

Rationale: Ansible tooling (like ansible-galaxy init) create files with a .yml extension. Also, the Ansible documentation website references files with a .yml extension several times. Because of this, it is normal in the Ansible community to use a .yml extension for all Ansible Yaml files.


Rule: Reuse Ansible Galaxy content by default

Rationale: Existing roles and collections on galaxy.ansible.com tend to be of high quality and designed for re-use. It comes with documentation / README.md and maintenance that you don't need to do on new custom roles.


npm run dev Good
function printName () {
  let name = prompt("Please enter your name")
  alert(`Your name is ${name}`)
}

Rule: Manage inventory externally to the primary playbook repository

Rationale: This setup forces you to design the repository in a way that simplifies local development, production usage and staging replica infrastructures.


Rule: Use SOPS encryption to secure inventory repositories

Rationale: SOPS is a version-control and collaboration-friendly encryption solution, perfectly suited for this use-case.


Rule: Title-case task names in Ansible playbooks

Rationale: consistency


- hosts: all
tasks:
  - name: Set OS distribution dependant variables
    include_vars: "os_{{ ansible_facts['distribution'] }}.yml"
  - debug:
      var: asdf
- hosts: all
tasks:
  - name: set os distribution dependant variables
    include_vars: "os_{{ ansible_facts['distribution'] }}.yml"
  - debug:
      var: asdf

About Ansible