---
title: Ansible
category: Ansible
+layout: 2017/sheet
---
{% raw %}
## Getting started
+### About
+{: .-intro}
+
+- <https://www.ansible.com/>
+
### Hosts
$ sudo mkdir /etc/ansible
$ ansible-playbook playbook.yml
-## Tasks
+## Playbook files
+
+### Tasks
- hosts: all
user: root
handlers:
- include: db.yml user=timmy
-## Handlers
+### Handlers
handlers:
- name: start apache2
notify:
- start apache2
-## Vars
+### Vars
- host: lol
vars_files:
file: state=directory path=${project_root}/home/.ssh/
only_if: "$vm == 0"
-## Roles
+### Roles
- host: xxx
roles:
vars:
local_home: "{{ lookup('env','HOME') }}"
-## References
-
- * [Intro](http://www.ansibleworks.com/docs/intro_configuration.html)
- * [Modules](http://www.ansibleworks.com/docs/modules.html)
-
{% endraw %}