I am writing this down so I don't forget. I started this task but had to stop a few times, and then remember where I left off and at some point, others will need to know how to get started.
brew install ansible
Go here and follow instructions for Amazon EC2 Ansible integration tool. You will run a Python script and setup a few environment variable. It is painless. This will create an ansible inventory file based on your EC2 environment.
$ ssh-agent bash
$ ssh-add ~/.ssh/YOUR_KEY.pem
$ ansible-galaxy install ansiblebit.oracle-java
However you like, start up an EC2 instance and tag it with the tag elk=elk. This is just the type of box. In this case, I am in the process of writing an ansible setup script for an ELK stack.
$ ansible tag_elk_elk -m ping -u ec2-user
54.68.31.178 | SUCCESS => {
"changed": false,
"ping": "pong"
}
---
- hosts: tag_elk_elk
user: ec2-user
sudo: yes
roles:
- { role: ansiblebit.oracle-java,
oracle_java_set_as_default: yes,
oracle_java_version: 8,
oracle_java_version_update: 102,
oracle_java_version_build: 14}
tasks:
- name: ensure apache is at the latest version
yum: name=httpd state=latest
$ ansible-playbook elk_install_playbook.yml
Ok. Now back to creating my ansible ELK install script. There are also tasks for creating an Amazon box with Ansible.