Ansible Notes

This will encompass things that I find useful and end up looking up later when I haven't coded in a while.

CWD

- name: Go to the folder and execute command
  command: chdir=/opt/tools/temp ls

Resource: https://stackoverflow.com/questions/19369931/ansible-how-to-change-active-directory-in-ansible-playbook

Add apt repo

This will create ```docker.list``` in ```/etc/apt/sources.list.d/``` and update the apt repo to reflect this change.

- name: Configure docker apt repo
  apt_repository:
    repo: 'deb https://download.docker.com/linux/debian stretch stable'
    state: present
    filename: 'docker'
    update_cache: 'yes'
  become: true

Resource: https://raymii.org/s/tutorials/Ansible_-_Add_an_apt-repository_on_Debian_and_Ubuntu.html

Best practices coding guide

https://docs.ansible.com/ansible/2.5/user_guide/playbooks_best_practices.html

Properly formatting a requirements.yml file

https://stackoverflow.com/questions/25230376/how-to-automatically-install-ansible-galaxy-roles