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

--

--

--

DevOps who is willing to learn and try new things.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Marvin — A Machine Learning based approach to Performance Artist Recommendation — Part II

Lawyer Broflovski’s Principle, or DIY: Cloud Load Balancing

Single-Page Apps on AWS, Part 1: Hosting a Website on S3

SOCIAL MINING DAO LABS

Install Python and PyCharm IDE

Set up Sidebar review widget

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
Sachith Muhandiram

Sachith Muhandiram

DevOps who is willing to learn and try new things.

More from Medium

How to create a Docker image using Docker File and push it on Docker Hub.

Securely Copy Data From One Server to Another Server

Create CI/CD pipeline for Docker Images in AWS

Launch an EC2 Instance in a Virtual Private Cloud (VPC)