Ansible usage

From wikinotes

Generally, a central server will have ansible installed/daemonized on it, and it will keep a copy of all synchronized files/configs. This server will have a list of hosts, and a preferred method of remotely-controlling these hosts.

Every controlled machine will have python2, and sshd running.

The a user on the ansible-server runs a particular playbook, which is then read and deployed.

ansible-playbook site.yml --ask-vault-pass
---
- name:        'zsh: install'
  package:     name={{ zsh }} state=present
  become:      true



- name:        'zsh: copy config-files'
  vars:
    files:
       - src: /home/git/config/unix/.zshrc
         dst: ~/.zshrc

       - src: /home/git/config/unix/.zsh
         dst: ~/.zsh

  copy:         src={{ item[1].src }} dest={{ item[1].dst }} owner={{ item[0] }}
  become:      true
  become_user: '{{ item[0] }}'
  with_nested:
     - install_users
     - files