Differences between revisions 4 and 5
Revision 4 as of 2018-07-27 01:05:05
Size: 1197
Editor: SamatJain
Comment:
Revision 5 as of 2018-10-05 03:32:54
Size: 1427
Editor: SamatJain
Comment:
Deletions are marked like this. Additions are marked like this.
Line 49: Line 49:
Line 53: Line 52:

== Filters ==

 * [[https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html|Filters in Ansible's documentation]]
 * [[http://jinja.pocoo.org/docs/latest/templates/#builtin-filters|Jinja2's built-in filters]]

Installing ansible

# Official PPA for Ubuntu
sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible

Playbooks meant to only be run locally

   1 - hosts: local
   2   connection: local
   3   become: yes
   4   become_user: root
   5   tasks:
   6    - name: Install Nginx
   7      apt:
   8        name: nginx
   9        state: installed
  10        update_cache: true

or specify hosts: all:

   1 - hosts: all
   2   become: yes
   3   become_user: root
   4   tasks:
   5    - name: Install Nginx
   6      apt:
   7        name: nginx
   8        state: installed
   9        update_cache: true

and then invoke ansible with:

ansible-playbook -i 'localhost,' -c local Playbook.ansible.yml

Async/parallelizing tasks

See http://toroid.org/ansible-parallel-dispatch and https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html, and https://blog.crisp.se/2018/01/27/maxwenzin/how-to-run-ansible-tasks-in-parallel, needs more research.

Good articles

Filters

SamatsWiki: Ansible (last edited 2021-06-24 18:44:34 by SamatJain)