Overview
Ansible is my favorite configuration management tool, its uses YAML and Python, so you have a winning combo to begin with. One of the main things of why I enjoy using it, is basically that it doesn’t require an installation on the target servers and that is a big factor that in my opinion defeats other management tools like Chef or Puppet.
The fact that you can run and configure servers without anything installed on them besides python (which is almost now standard on every single virtual/physical machine).
Few things to note:
- Requires python on both master and client machine
- Connects mostly over SSH so credential setup is needed
- Uses or executes in sequence (top to bottom)
As we talked before, Ansible relies on YAML. Yaml Aint Markup Language
Meant to be “human-readable” Perfect for the simplicity that involves ansible/python YAML uses a dictionary type of input information example: key:value Name: Mike
YAML Examples (not directly ANSIBLE examples)
Same as with Python, indentation is critical for your YAML files.
To use ansible it’s as simple as: (process may be different based on your distribution)
Once installed you can start creating what we call “playbooks”, which is basically YAML instructions for Ansible to execute something. We will begin with the classic hello word. Create a file named hello.yml.
To run your playbook execute the following command:
As you can see, running Ansible playbooks is incredibly easy and of course there a lot more topics to cover for Ansible basics. If you want to keep learning more, head over to the Ansible Documentation.