official documentation
about me
Ansible
Quickstart Tutorial
Updated on Jun 13, 2020
Introduction
What is Ansible?
Agentless
Expansion of the tool
Declarative vs Imperative model
Tools similar to Ansible
Prerequisites
Terminology
Ansible Playbook
Basic directory structure
Inventory
Ansible Playbook file
Plays
Roles
Tasks
Module
Ansible ad-hoc
Prerequisites
Create a virtual environment
Activate a virtual environment
Deactivate a virtual environment
Install Ansible (inside a Python virtual environment)
Install VirtualBox
Install Vagrant
References
Tutorial
1 - Best practices and first playbook
Prerequisites
Create a role to provision the popular nginx webserver with a sample page
Role
webservers-nginx
Create a playbook to use the role
Creating a virtual machine using Vagrant
How to SSH into a Vagrant VM
Simple inventory file
References
2 - Handling the inventory
Introduction
Hosts management
Variables management
Variable precedence
Cleaning-up the current inventory file
Create files to place variables
Create the vagrant box
Run the playbook
Multiple inventories
Inventory layout 1: multiple environments
Inventory layout 2: multiple environments, multiple customers or deployments
Vault and secrets
Encrypt a file
Decrypt file
Including vault into our environment
Run playbook using the usual command
Run playbook asking for the vault password
Verify htpasswd file
Run using a file with the vault password in it
Run using the vault password file environment variable
Bonus: specify the ANSIBLE_VAULT_PASSWORD_FILE var without exporting it
References
3 - Working with modules and roles
Introduction
Roles
Modules
Ansible Quickstart Tutorial
Docs
»
Index
Edit on GitHub
Index