FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

Β© 2026 FlareStart. All rights reserved.

Back to articles
πŸš€ LAB: Deploy Nginx with Variables, Templates & Handlers
How-ToDevOps

πŸš€ LAB: Deploy Nginx with Variables, Templates & Handlers

via Dev.to TutorialAisalkyn Aidarova1mo ago

🎯 Objective Use common modules ( apt , template , service ) Understand variables See variable precedence in action Use Jinja2 template Trigger handler on config change Observe idempotency πŸ— Architecture Flow: Mac (Control Node) β†’ SSH β†’ 2 Ubuntu EC2 Instances β†’ Install & Configure Nginx πŸ”Ή Step 1 – Launch 2 EC2 Instances AMI: Ubuntu 22.04 Instance type: t2.micro Security Group: Port 22 (SSH) Port 80 (HTTP) πŸ”Ή Step 2 – Install Ansible (Control Node) brew install ansible Verify: ansible --version πŸ”Ή Step 3 – Create Inventory inventory.ini [web] node1 ansible_host = 3.x.x.x node2 ansible_host = 18.x.x.x [web:vars] ansible_user = ubuntu ansible_ssh_private_key_file = ~/Downloads/key.pem Test: ansible web -i inventory.ini -m ping πŸ”Ή Step 4 – Create Project Structure ansible-nginx-lab/ β”‚ β”œβ”€β”€ inventory.ini β”œβ”€β”€ deploy.yml β”œβ”€β”€ group_vars/ β”‚ └── web.yml └── templates/ └── nginx.conf.j2 πŸ”Ή Step 5 – Variables (Group Level) group_vars/web.yml app_port : 80 server_name : jumptotech.local welcome_message :

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
14 views

Related Articles

I built an expense tracker because every other one wanted my bank login
How-To

I built an expense tracker because every other one wanted my bank login

Dev.to β€’ 4d ago

Samsung Galaxy S26 and Galaxy S26+ Review: Lacking Ambition
How-To

Samsung Galaxy S26 and Galaxy S26+ Review: Lacking Ambition

Wired β€’ 4d ago

5 kitchen splurges that I can't recommend enough
How-To

5 kitchen splurges that I can't recommend enough

ZDNet β€’ 4d ago

Here’s how to rank the 50 best Apple products ever
How-To

Here’s how to rank the 50 best Apple products ever

The Verge β€’ 4d ago

Fix Payment and Tax Issues in Museum Ticketing Software
How-To

Fix Payment and Tax Issues in Museum Ticketing Software

Dev.to Beginners β€’ 4d ago

Discover More Articles