Ansible

Abstract

Ansible configuration and usage.

Ansible#

Playbooks#

The playbook and associated roles are check with ansible-lint according to the rules set in .ansible-lint[1].

Inventory#

This is an example hosts file and is not used anywhere. To use this do the following.

  1. Create a group named ansible.

    groupadd ansible
    
  2. Create a directory named /etc/ansible.

    sudo mkdir -pv /etc/ansible
    
  3. Change the ownership of that directory to the ansible group.

    sudo chgrp ansible /etc/ansible
    
  4. Make the directory group writable.

    sudo chmod g+w /etc/ansible
    
  5. Add your user to the ansible group and relaunch your shell.

    sudo usermod -a -G ansible $USER
    /bin/bash || exit
    
  6. Copy this example hosts file to /etc/ansible/hosts.yml and edit it.

    cp hosts.yml /etc/ansible/hosts.yml
    vi /etc/ansible/hosts.yml
    

hosts.yml#

Section author: Xander Harris xander.harris@gmail.com