Day 01 – Ansible Hands-On with SSH Trust & Terraform Integration
Day 01
Agenda
00:00β02:00
Participant Ramakrishna showcased Terraform + Tomcat setup via CI/CD pipeline
β
Jenkins webhook was triggering (200 OK), but Jenkins wasnβt receiving build requests
02:00β06:00
Trainer guided on GitHub-Jenkins integration troubleshooting
Motivated participants to explore Terraform modules beyond AWS β even for Docker, Jenkins, etc.
06:00β13:00
Deep dive into Ansible setup on Ubuntu EC2 in Stockholm region
β
Chose T3.micro instance (2 CPUs), installed Ansible using shell script via GitHub Gist
Explained Ansible controller setup & prerequisites (Python already present)
13:00β24:00
Created multiple Ansible-managed nodes
Copied controllerβs SSH public key into managed nodes using Terraform-based approach
β
Emphasized Ansible’s agentless SSH-based architecture
24:00β33:00
Successfully established SSH trust from controller to nodes
Explained inventory file /etc/ansible/hosts, added private IPs
Validated nodes using ansible all -m ping
33:00β40:00
Demonstrated inventory grouping (valid/invalid hosts)
Covered targeting by:
βͺοΈ All nodes
βͺοΈ Single IP
βͺοΈ Group
40:00β43:00
οΈ Introduced custom inventory file usage with -i flag
Emphasized /etc/ansible/hosts as the default inventory
43:00β49:00
Explained Ansible command structure:ansible <target> -m <module> -a <arguments>
οΈ Sample: apt for installing packages, copy for file transfer, etc.
49:00β57:00
Created a students.txt file on controller and used copy module to push it to all targets
Demonstrated idempotency (file copied only if changed)
57:00β1:02:00
Color meanings in Ansible output:
Yellow = Change occurred
Green = No change (desired state)
Red = Error
Trainer shared real-life experience + announced break until Friday for extended session with Terraform + Ansible + Jenkins