Ansible: Nine (9) Part Series for Familiarization
Do you want to learn about Ansible? Well, you've found the best place to start! This nine (9) part series will familiarize you with Ansible.
Article 1 creates a base environment for using Ansible in future articles in the series. It leverages AWS Cloud9, several AWS CLI for "aws ec2" for describing instances and provisioning SSH keys. The article ends with making sure your Cloud9 environment is up-to-date with Python, Pip, and Ansible.
Article 2 introduces you to the Ansible inventory and the Ansible ping module, pointing out how the Ansible ping module does more than just ping a host, it attempts to connect to the host also. You will also get introduced to the Ansible config file.
Article 3 is all about Ansible modules. You will use several modules:
ping module to check if targets are up
command module to run commands against target hosts
apt module to install software on targets
shell module to run commands in a shell on targets
service module to interact with services on targets
copy module to copy files to targets
file module to manipulate files on target (e.g.: delete)
Article 4 is more of a setup for the next article. It provisions the infrastructure via Terraform and validates connectivity to targets via Ansible ping. Suffice to say, playbooks are repeatable recipes that can be run against your infrastructure.
Article 5 is about using an Ansible Plabyook. You will dp several things:
manually install nginx test the application uninstall nginx install nginx using the Ansible playbook At the end of this article, you will destroy the infrastructure you created in Article 4.
Article 6 is about Ansible Variables. Use variables to store and reference values that can be used throughout playbooks, templates, and other Ansible configuration files. Variables can be used against a single host or a group of hosts.
Article 7 is about Ansible Conditionals. You can use conditionals to control the execution of playbooks based on specific conditions or values. For example, you can do certain steps depending upon the target operating system
Article 8 is about Ansible Loops. The looping techniques used are "with_items" and the "loop" directive.
Article 9 is about Ansible Roles. Roles permit you to do a series of operations against infrastructure, simply due to classification into certain "roles". You can load variables, files, tasks, handlers, etc., all based on a known file structure.