Тёмный

Ansible Automation | How to create EC2 instance using Ansible Playbook in AWS | Ansible Tutorials 

DevOps Coach
Подписаться 20 тыс.
Просмотров 1,3 тыс.
50% 1

www.coachdevops.com/2024/01/a...
Pre-requisites:
Ansible is installed and Boto is also installed on Ubuntu EC2 instance
Make sure you create an IAM role with AmazonEC2FullAccess policy and attach the role to EC2 instance.
Steps to create EC2 instance using Ansible:
Login to EC2 instance using Git bash or iTerm/putty where you installed Ansible. Execute the below command:
Create an Inventory file first
sudo mkdir /etc/ansible
Edit Ansible hosts or inventory file
sudo vi /etc/ansible/hosts
Add the below two lines in the end of the file:
[localhost]
local
cd ~
mkdir playbooks
cd playbooks
Create Ansible playbook
sudo vi create-ec2.yml
(copy the below content in green color)
edit the create-ec2.yml to make sure you update the key, AMI and region code which is red marked below:
now execute the ansible playbook by
ansible-playbook create_ec2.yml

Наука

Опубликовано:

 

21 янв 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 3   
@shreyasdevarkar8289
@shreyasdevarkar8289 23 дня назад
Hello, for me im still getting the error No Handler was ready to Authenticate.... Im trying to start another ec2 and My inventory file consists of my target ec2 instance and [localhost] My ec2 is Amazon Linux2023 (IMDv2 enabled) But works fine if i set (IMDv2 optional) Need to find a way to make it work even with IMDv2
@danshd.9316
@danshd.9316 3 месяца назад
Plz make it mobile friendly
@DevOpsCoach
@DevOpsCoach 2 месяца назад
Sure, thanks for the feedback.
Далее
🏟️👋 Welcome to your new home, Kylian Mbappé!
00:14
Прятки #nyanmp3
00:25
Просмотров 1,8 млн
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
SSH Keys & AWS
9:57
Просмотров 950
DevOps on AWS: Install and configure Ansible on EC2
14:49
Hashicorp packer to create AWS AMI
16:20
Просмотров 8 тыс.
The cloud is over-engineered and overpriced (no music)
14:39