Ansible with AWS EC2 — Part 1

ssh-keygen -t rsa -N “” -f /home/ubuntu/.ssh/id_rsa
ubuntu@ec2–......-1.compute.amazonaws.com
[workers]ubuntu@ec2-......1.compute.amazonaws.com
ubuntu@ec2-...-1.compute.amazonaws.com | SUCCESS => {
"changed": false,
"ping": "pong"
}
---
- name: installvlc # name of the playbook
hosts: workers # where we need to install
become: true # run as sudo user
tasks:
- name: Install VLC Media Player
apt: # the package manager
name: vlc-bin
state: latest
# if you want specific version you can specify in . state : 3.0.0
PLAY [installvlc] *********************************************************************************************************************TASK [Gathering Facts] ****************************************************************************************************************
ok: [ubuntu@ec2-....-1.compute.amazonaws.com]
TASK [Install VLC Media Player] *******************************************************************************************************
changed: [ubuntu@ec2-....-1.compute.amazonaws.com]
PLAY RECAP ****************************************************************************************************************************
ubuntu@ec2-....-1.compute.amazonaws.com : ok=2 changed=1 unreachable=0 failed=0

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store