Please find a simple Ansible playbook for terminating EC2 instance in AWS using instance id.
Pre-requisites:
Watch the steps in YouTube channel:
Pre-requisites:
Make sure you create an IAM role with AmazonEC2FullAccess policy and attach the role to EC2 instance where Ansible was installed.
Login to EC2 instance using Git bash or ITerm/putty where you installed Ansible. Execute the below command to edit Ansible hosts or inventory file
sudo vi /etc/ansible/hosts
Add the below two lines in the end of the file:
[localhost]
local
[localhost]
local
save the file and come out of it.
sudo vi terminate.yml
---
- name: ec2 provisioning using Ansible
hosts: local
connection: local
gather_facts: False
- hosts: local
gather_facts: False
connection: local
vars:
- region: 'us-east-1'
- ec2_id: 'i-05f39cfb80c97df38'
tasks:
- name: Terminate instances
local_action: ec2
state='absent'
instance_ids='{{ ec2_id }}'
region='{{ region }}'
wait=True
This playbook can be executed by two ways. Either mention instance ID in the ansible playbook or pass as an argument. Intstance Id can be taken from AWS mgmt console.
ansible-playbook terminate.yml -e ec2_id=i-xxxx
PLAY [ec2 provisioning using Ansible] *********************************************************************
PLAY [local] **********************************************************************************************
TASK [Terminate instances] ********************************************************************************
ok: [local -> localhost]
PLAY RECAP ************************************************************************************************
local : ok=1 changed=0 unreachable=0 failed=0
PLAY [ec2 provisioning using Ansible] *********************************************************************
PLAY [local] **********************************************************************************************
TASK [Terminate instances] ********************************************************************************
ok: [local -> localhost]
PLAY RECAP ************************************************************************************************
local : ok=1 changed=0 unreachable=0 failed=0
instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram beğeni satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - polen filtresi - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi - binance sahibi - btcturk sahibi - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - webturkey.net - minecraft premium hesap - karfiltre.com - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir
ReplyDeleteinstagram takipçi satın al
ReplyDeleteaşk kitapları
tiktok takipçi satın al
instagram beğeni satın al
youtube abone satın al
twitter takipçi satın al
tiktok beğeni satın al
tiktok izlenme satın al
twitter takipçi satın al
tiktok takipçi satın al
youtube abone satın al
tiktok beğeni satın al
instagram beğeni satın al
trend topic satın al
trend topic satın al
youtube abone satın al
instagram takipçi satın al
beğeni satın al
tiktok izlenme satın al
sms onay
youtube izlenme satın al
tiktok beğeni satın al
sms onay
sms onay
perde modelleri
instagram takipçi satın al
takipçi satın al
tiktok jeton hilesi
instagram takipçi satın al
pubg uc satın al
sultanbet
marsbahis
betboo
betboo
betboo
MMORPG OYUNLAR
ReplyDeleteinstagram takipçi satın al
tiktok jeton hilesi
TİKTOK JETON HİLESİ
antalya saç ekimi
referans kimliği nedir
instagram takipçi satın al
Mt2 Pvp Serverlar
TAKİPCİ
perde modelleri
ReplyDeletesms onay
Türk Telekom Mobil Ödeme Bozdurma
nft nasıl alınır
ANKARA EVDEN EVE NAKLİYAT
Trafik sigortasi
DEDEKTÖR
web sitesi kurma
aşk kitapları
smm panel
ReplyDeleteSmm panel
iş ilanları
İnstagram takipçi satın al
Hırdavat
beyazesyateknikservisi.com.tr
Servis
Tiktok para hilesi
kadıköy alarko carrier klima servisi
ReplyDeletebeykoz daikin klima servisi
üsküdar daikin klima servisi
pendik toshiba klima servisi
pendik beko klima servisi
tuzla alarko carrier klima servisi
tuzla daikin klima servisi
çekmeköy toshiba klima servisi
ataşehir toshiba klima servisi
Good content. You write beautiful things.
ReplyDeletehacklink
vbet
taksi
mrbahis
korsan taksi
vbet
hacklink
sportsbet
sportsbet
Good text Write good content success. Thank you
ReplyDeletebonus veren siteler
betmatik
mobil ödeme bahis
kralbet
poker siteleri
tipobet
slot siteleri
kibris bahis siteleri
maraş
ReplyDeletebursa
tokat
uşak
samsun
8VFMMP
salt likit
ReplyDeletesalt likit
dr mood likit
big boss likit
dl likit
dark likit
X86HV6
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
XAB