Ansible config

forks ⇒ number of simultaneous hosts
gathering ⇒ smart : can avoid gathering facts at each run
pipelining ⇒ can improve performance but requires specific configuration if sudo is used

Ansible command

ansible -k or –ask-pass: use password to authenticate
ansible-doc -l or ansible-doc $MODULE: shows documentation about modules
callback_whitelist = timer.profile_tasks: allows you to have time for each task
callback_whitelist = timer: in order to have time for playbook
ansible vault encrypt_string 'the_string_to_encrypt' --name 'var_name': Encrypt variable

Ansible playbook

ansible-playbook playbook.yml –list-tags LIST ansible-playbook playbook.yml –tags MYTAG : list MYTAG tasks in playbook

If you want to run for one playbook all tasks host by host you can use serial: 1:

---
- hosts: myhosts
  serial: 1
  roles:
    - myrole

Do some maths in a jinja file :
-Xms{{ ((((ansible_memtotal_mb * 0.5)|int)/1024)|round)|int }}g