The purpose of this lab is to install the minimum software in order to create an EC2 instance on AWS.
Ansible is an open source automation language that can describe an IT application infrastructure in Ansible playbooks.
It is an automation engine that runs Ansible Playbooks (yml).
There are guides to setup Ansible for CentOS machines and Windows machines .
Ubuntu users simply run sudo ./setup_script.sh inside the setup folder.
Give a shot at the training lab (trainingLab.yml). If everything goes correctly, you should be able to create an EC2 instance using Ansible!
Below is an example of what should happen if everything is done correctly.
Playbooks are what we run when using Ansible.
A file that contains hosts and groups.
A group contains several hosts that you may want to interact with.
Hosts are remote machines that Ansible manages. For ACMS, we will most likely be using localhost.
hosts: localhost
A playbook is a list of plays. A play first takes the host and runs through as many tasks as there are present in the playbook. Tasks and roles are in plays.
Roles are units of organization for Ansible. They can be treated the same as subflows in HP OO. When possible, try to make your plays into roles so you can reuse your plays. A role usually contains several tasks.
Tasks are the basic unit of actions. Roles, plays, and playbooks contain tasks. Tasks take a module and its parameters and are run by the playbook.
A module is very similar to a function/method in a regular programming language. Tasks are composed of modules. Each module have their own set of required and optional parameters.
Ansible has many built-in modules for your use, but you can create your own.
The part of the task that declares which module to use an its parameters.
task: <---- Task
- name: Create EC2 Instance
vvvvvvv Action vvvvvvv
ec2: <--- Module
region: "us-east-1"
image: ami-iXXXXXX
aws_access_key: XXXXXXXXX
aws_secret_key: XXXXXXXXX
http://docs.ansible.com/ansible/glossary.html
http://docs.ansible.com/ansible/playbooks_best_practices.html
