<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[IaCverse]]></title><description><![CDATA[IaCverse]]></description><link>https://iacverse.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 24 Oct 2026 19:15:33 GMT</lastBuildDate><atom:link href="https://iacverse.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Autopatch-Ansible: Building an Automated Security Patch Compliance System with Ansible & AWS]]></title><description><![CDATA[Keeping servers secure sounds simple, until you’re managing dozens or even hundreds of them. Every week, there are new OS patches, package updates, and…]]></description><link>https://iacverse.hashnode.dev/autopatch-ansible-building-an-automated-security-patch-compliance-system-with-ansible-and-aws</link><guid isPermaLink="true">https://iacverse.hashnode.dev/autopatch-ansible-building-an-automated-security-patch-compliance-system-with-ansible-and-aws</guid><category><![CDATA[ansible]]></category><category><![CDATA[ansible-playbook]]></category><category><![CDATA[ansible-module]]></category><category><![CDATA[#ansible-adhoc]]></category><category><![CDATA[AWS]]></category><category><![CDATA[ec2]]></category><category><![CDATA[EC2 instance]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Devops articles]]></category><category><![CDATA[#Devopscommunity]]></category><category><![CDATA[DevOps Journey]]></category><category><![CDATA[#IaC]]></category><category><![CDATA[IaC (Infrastructure as Code)]]></category><category><![CDATA[IAM]]></category><category><![CDATA[IAM,MFA,Access key ID,Secret access key]]></category><dc:creator><![CDATA[Sneha Madhuri]]></dc:creator><pubDate>Thu, 16 Oct 2025 16:36:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1760680150898/29061c0c-a254-4801-855b-3d2dc70bc908.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><mark>Keeping servers secure sounds simple, until you’re managing dozens or even hundreds of them</mark>.</p>
<p>Every week, there are new OS patches, package updates, and security advisories. Manually logging into each instance, checking updates, and documenting compliance quickly turns into a repetitive and error-prone nightmare.</p>
<p>That’s exactly the challenge I faced while managing multiple Linux EC2 instances in AWS. I wanted a way to <strong>automate patch checks, apply only critical updates, and generate a compliance report</strong> without logging into a single server manually. So I built my <strong>Ansible-based automation project</strong> that does just that.<br />It scans every running EC2 instances in your AWS environment, identifies pending updates, applies only approved or critical patches, and automatically emails an HTML report summarising patch status, reboot requirements, and compliance metrics.</p>
<p>What started as a small script evolved into a fully modular Ansible-driven system built to automate security patching and compliance reporting across servers. It’s designed not just to simplify patch management, but also to demonstrate essential <strong>Ansible concepts</strong> in a <strong>real-world DevOps scenario</strong> along with <strong>AWS best practices</strong>.</p>
<p>🌱 This project leverages everything I’ve learned along my Ansible journey:</p>
<ol>
<li><p><strong>Roles:</strong> Modular structure split into <code>check_updates</code>, <code>apply_patches</code>, and <code>report</code> for clarity and reusability.</p>
</li>
<li><p><strong>Loops:</strong> Efficiently iterate through multiple servers and update lists.</p>
</li>
<li><p><strong>Conditionals:</strong> Apply only critical patches or skip already compliant hosts.</p>
</li>
<li><p><strong>Ansible Vault:</strong> Securely store sensitive data like AWS credentials and email passwords.</p>
</li>
<li><p><strong>Dynamic AWS Inventory file:</strong> Automatically fetch live EC2 instances based on environment tags.</p>
</li>
<li><p><strong>HTML Reporting:</strong> Generate professional, CSS-styled compliance reports with <strong>Jinja2 templates</strong>.</p>
</li>
<li><p><strong>Automated Email:</strong> Send visual compliance summaries directly to your team’s inbox.</p>
</li>
<li><p><strong>Playbooks:</strong> Orchestrate all roles through a single master playbook for streamlined execution.</p>
</li>
<li><p><strong>Ansible Configuration (</strong><code>ansible.cfg</code><strong>):</strong> Simplifies setup by customizing inventory, SSH behavior, and remote user defaults.</p>
</li>
<li><p><strong>Automation Scripts:</strong></p>
<ul>
<li><p><a target="_blank" href="http://tagging.sh"><code>tagging.sh</code></a>: Assigns sequential names to EC2 instances for easy identification.</p>
</li>
<li><p><a target="_blank" href="http://copy-public-key.sh"><code>copy-public-key.sh</code></a>: Enables passwordless SSH between the Ansible master and target nodes.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-problem-statement">Problem statement →</h3>
<p>Managing patch compliance manually is time-consuming and prone to errors, especially when:</p>
<ul>
<li><p>You have multiple servers across different environments (development, staging, production).</p>
</li>
<li><p>You need to prioritize critical security updates without accidentally breaking stable systems.</p>
</li>
<li><p>Tracking compliance for reporting purposes becomes tedious and inconsistent.</p>
</li>
</ul>
<p><em>Ansible addresses these challenges by:</em></p>
<ol>
<li><p><strong>Scanning all servers dynamically</strong> using AWS EC2 inventory tags.</p>
</li>
<li><p><strong>Applying only critical or approved updates</strong>, using Ansible conditionals.</p>
</li>
<li><p><strong>Generating a clear HTML report</strong> showing compliance status, pending updates, critical security updates, and patch history.</p>
</li>
<li><p><strong>Automating notifications</strong> by sending the report to the DevOps or management team, removing manual effort entirely.</p>
</li>
</ol>
<hr />
<h3 id="heading-project-file-structure">Project File Structure →</h3>
<pre><code class="lang-plaintext">Autopatch-Ansible/
├── ansible.cfg                          # Ansible configuration
├── vault.pass                           # Vault password
├── ansible-key.pem                      # SSH private key
├── inventory/
│   └── ec2_hosts.yaml                   # AWS EC2 dynamic inventory
├── group_vars/
│   └── all/
│       ├── pass.yml                     # Encrypted secrets
│       └── vars.yml                     # Plain variables
├── playbooks/
│   ├── check_and_report.yaml           # Compliance check only
│   ├── apply_patches_and_report.yaml   # Apply patches + report
│   └── execute_playbook.yaml           # Main execution
├── roles/
│   ├── check_updates/                   # Scan for updates
│   │   ├── tasks/main.yml
│   │   └── defaults/main.yml
│   ├── apply_patches/                   # Apply system patches
│   │   └── tasks/main.yml
│   └── report/                          # Generate &amp; email reports
│       └── tasks/main.yml
├── templates/
│   └── patch_report.html.j2            # HTML email template
├── tagging.sh
└── copy-public-key.sh                  # Distribute SSH keys
</code></pre>
<hr />
<p>Now that we’ve covered what this project does and how it’s structured, let’s jump right in and start implementing <strong>Autopatch-Ansible</strong> step by step.</p>
<h3 id="heading-step-1-set-up-the-ansible-control-node">Step 1 → Set up the Ansible Control Node</h3>
<p>We’ll begin by creating the Ansible Control Node which will be the central server that runs all your playbooks and connects to other instances(target servers/manage nodes) to automate tasks.</p>
<ul>
<li><strong>Create a Security Group → Configure inbound rules → Allow relevant ports</strong></li>
</ul>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760512324130/23f4442e-fee9-4050-95d1-c3c746f1d39b.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Open AWS Console → Log in using your AWS credentials → Navigate to EC2 dashboard</strong></li>
</ul>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760511572665/c10266b9-2359-4e37-9657-06147f3641f2.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p><strong>Create a new EC2 instance with the following configuration</strong>:</p>
<ol>
<li><p><strong>Name:</strong> <code>ansible-control-node</code> (This will serve as the central server for all automation tasks)</p>
</li>
<li><p><strong>AMI:</strong> Ubuntu 24.04 LTS</p>
</li>
<li><p><strong>Instance Type:</strong> <code>t2.medium</code></p>
</li>
<li><p>VPC: Create a VPC [<code>project-vpc</code> in my case]</p>
</li>
<li><p><strong>Key Pair:</strong> Create/use an existing key [<code>ansible-key.pem</code> in my case]</p>
</li>
<li><p><strong>Security Group:</strong> [<code>AnsibleSecurityGroup</code> in my case]</p>
</li>
<li><p><strong>Storage:</strong> 20 GB</p>
</li>
</ol>
</li>
</ul>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760511675655/09af78d1-e702-4e87-a04c-bd60021b4720.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760511699811/046070a4-e0ca-411b-b521-e2ef2cc69664.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760511727113/f078bf1e-199a-49a0-9ad1-70ee284fc014.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Click Launch Instance → Wait for the instance to initialize → <mark>Copy the Public IP address</mark>.</strong><br />  You’ll use this IP to connect via SSH and install Ansible in the next step + required configurations.</li>
</ul>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760511796822/a50c9fa1-f3e9-480a-91e7-56d5416bef57.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760511878560/048e17d4-b70e-4461-8777-bfe1b11cea58.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-2-create-an-iam-user">Step 2 → Create an IAM user</h3>
<p>Instead of using your root account credentials, always create a dedicated <strong>IAM user</strong> for automation.<br />This approach enhances security and follows AWS recommended practices for account and credential management.</p>
<ul>
<li><strong>Go to AWS → IAM → Users → Create User</strong></li>
</ul>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760612769317/e7928f98-47d3-48b9-ab07-821e2f6c9d63.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760613045082/1d9dcd8f-49cb-4e0f-bd59-a1ba75398f70.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Attach policies directly → AmazonEC2FullAccess → Create user</strong></li>
</ul>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760613061034/372a9061-d20c-408a-bf98-99c22115704f.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760613077701/a8ca476b-115d-4869-b1fb-ac49fad9d2b1.png" alt class="image--center mx-auto" /></p>
<p>“<code>ansible-user</code>” IAM gets created →</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760613144587/33c30692-3920-47f6-b854-7942c47d2eb5.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-3-generate-iam-access-keys">Step 3 → Generate IAM Access Keys</h3>
<p>We create IAM access keys so our Ansible control node can talk to AWS securely. This way, it can spin up, configure, and manage instances without ever touching your root account which keeps things safe and smooth.</p>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760613153067/f057b994-9f6d-42e4-8fdf-eb2baef3ab0e.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760613204576/95f77bfa-4675-44db-af5c-d3ed65a881c8.png" alt class="image--center mx-auto" /></p>
<p>Make sure to <mark>download the .csv file</mark> so you have a copy handy when you need it later →</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760613483685/a5b4bf98-7ce5-4837-9bab-dcd880ff3ff1.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-4-connect-to-the-ansible-control-node">Step 4 → Connect to the Ansible Control Node</h3>
<p>Now that our EC2 instance is up and running, it’s time to connect to it from your local terminal.</p>
<ul>
<li><strong>Open your terminal → Navigate to the folder where your private key (</strong><code>.pem</code> <strong>file) is stored</strong></li>
</ul>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">chmod 600 ansible-key.pem
ssh -i ansible-key.pem ubuntu@&lt;public_ip_address&gt;
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760520193138/1cc6dc68-f53e-4028-82b1-a3a7dcdd0a46.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-5-install-dependencies-amp-configure-aws-ansible-environment">Step 5 → Install Dependencies &amp; Configure AWS + Ansible Environment</h3>
<ul>
<li><strong>Update and upgrade system packages</strong></li>
</ul>
<p><strong>Command used :</strong></p>
<pre><code class="lang-plaintext">sudo apt update &amp;&amp; sudo apt-get upgrade -y
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760521044699/4ed61aab-dca1-4061-885e-5e80f58b12ca.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Install Python and pip</strong></li>
</ul>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">sudo apt install -y python3
python3 --version

sudo apt install python3-pip -y
pip --version
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760521991458/913cb017-9144-4002-9664-b52f27e89e71.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760522084232/836b4fca-985e-4078-81e8-b5d1d0a5cb2c.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Install AWS CLI</strong></li>
</ul>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo apt install unzip
unzip awscliv2.zip
sudo ./aws/install
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760522505762/8f3402f9-b236-4130-a08f-ab79ce6a7abe.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Configure AWS credentials</strong></li>
</ul>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">aws configure
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760522904853/e8fdecca-f27d-43f6-9419-75c328e87b23.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Create and activate a Python virtual environment</strong></li>
</ul>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">sudo apt install python3-venv -y
python3 -m venv ansible-env
source ansible-env/bin/activate
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760523067605/122844f8-1f08-4c54-938c-900f3c315ee2.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Install Ansible</strong></li>
</ul>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">pip install ansible
ansible --version
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760524253230/6b34b40d-090f-4055-8c66-809a31c8b96d.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760524554593/d8a1e077-4c70-4f7c-8413-0ffffedfaa09.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-6-set-up-ansible-aws-collection">Step 6 → Set Up Ansible AWS Collection</h3>
<p>Now that Ansible and AWS CLI are ready, we’ll install the required <strong>AWS collection</strong> and dependencies that allow Ansible to interact with EC2 instances(manage/target nodes) dynamically.</p>
<ul>
<li><strong>Install supporting Python packages</strong></li>
</ul>
<p><strong>Command used :</strong></p>
<pre><code class="lang-plaintext">pip install boto3 botocore docker
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760524734020/4990315f-8562-47ef-b92a-173962e13913.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>Install the Amazon AWS Ansible collection</strong></li>
</ul>
<p><strong>Command used :</strong></p>
<pre><code class="lang-plaintext">ansible-galaxy collection install amazon.aws --force
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760524832271/25e2401b-be00-4d07-a2ef-2e77e9f9c604.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-7-clone-the-autopatch-ansible-repository">Step 7 → Clone the Autopatch-Ansible Repository</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">git clone https://github.com/sneywi/Autopatch-Ansible.git

cd Autopatch-Ansible
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760525139339/7e329f47-b5f2-4c98-9b83-e55bcdb0ea42.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-8-add-your-existing-pem-key-amp-set-up-ssh-access">Step 8 → Add Your Existing <code>.pem</code> Key &amp; Set Up SSH Access</h3>
<ul>
<li><strong>Add your existing</strong> <code>.pem</code> <strong>key that was used to SSH into Ansible Control Node instance</strong><br />  This lets you connect to your managed nodes easily using passwordless authentication</li>
</ul>
<p><strong>Command used :</strong></p>
<pre><code class="lang-plaintext">vi ansible-key.pem
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760525491960/da5965a3-e667-49b7-9d51-6b697ce6236d.png" alt class="image--center mx-auto" /></p>
<ul>
<li><p><strong>Create a new SSH keypair on your control node</strong></p>
<p>  With this, Ansible can log into your managed nodes without asking for passwords every time</p>
</li>
</ul>
<p><strong>Command used :</strong></p>
<pre><code class="lang-plaintext">ssh-keygen -t rsa -b 4096
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760525660203/79c47782-c8ef-4fef-bad2-14b588a495a0.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-9-create-amp-prepare-managed-nodes">Step 9 → Create &amp; Prepare Managed Nodes</h3>
<p>Next, we set up the target servers (managed nodes) that Ansible will automate. These could be AWS EC2 instances or any other Linux machines.</p>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760526374082/a823c4a1-a486-47d2-8bf7-97ebbb2c596b.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760526390317/2cd8ad90-4097-4484-afcf-9b18258d2917.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760526400474/99c2f2a4-bfdd-4a46-bb4a-05262961ba84.png" alt class="image--center mx-auto" /></p>
<p><strong>With these configurations →</strong></p>
<ol>
<li><p><strong>Key:</strong> Environment, <strong>Value:</strong> Development</p>
</li>
<li><p><strong>AMI:</strong> Ubuntu 24.04 LTS</p>
</li>
<li><p><strong>Instance Type:</strong> <code>t2.micro</code></p>
</li>
<li><p><strong>Key Pair:</strong> Use an existing key [<code>ansible-key.pem</code>]</p>
</li>
<li><p><strong>Security Group:</strong> [<code>AnsibleSecurityGroup</code>]</p>
</li>
<li><p><strong>Storage:</strong> 15 GB</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760526597908/6083fbc1-1b11-4a06-9d3a-a11afead16e0.png" alt class="image--center mx-auto" /></p>
<p><strong>Click Launch instance → <mark>5 instances</mark> get created</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760526689910/22c9d081-47e4-4ae2-a4fd-a289cf365e82.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-10-name-manage-nodes-sequentially">Step 10 → Name Manage Nodes Sequentially</h3>
<p>To make automation easier, we’ll assign sequential, unique names to each EC2 instance.</p>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext"># To give executable permissions
sudo chmod +x tagging.sh

./tagging.sh
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760601167086/c0968d3c-26ce-4e43-b668-d3fad950e54e.png" alt class="image--center mx-auto" /></p>
<ul>
<li><strong>They get sequentially named like below:</strong></li>
</ul>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760538718217/ad255afe-6d1e-46fb-8f1b-d26eaaefa81c.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-11-setup-passwordless-ssh-to-all-managed-nodes">Step 11 → Setup Passwordless SSH to All Managed Nodes</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext"># To give executable permissions
sudo chmod +x copy-public-key.sh

./copy-public-key.sh
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760613748474/51fe17b8-6866-4d48-be7b-abc23be8759e.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-12-visualizing-your-inventory-after-ssh-is-set-up">Step 12 → Visualizing your inventory after SSH is set up</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">ansible-inventory -i inventory/aws_ec2.yaml --graph

# To log in without password, testing passwordless authentication
ssh ubuntu@&lt;any_instance_ip&gt;.compute.amazon.aws.com
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760614112698/230587d8-71f8-44a6-b812-33c3da41cd50.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760636731872/60c14422-398e-42a3-a319-bdb8a2cce14f.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-13-configure-and-secure-credentials-with-ansible-vault">Step 13 → Configure and Secure Credentials with Ansible Vault</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-plaintext">ansible-vault edit group_vars/all/pass.yml --vault-password-file vault.pass
</code></pre>
<p><strong>Demonstration :</strong></p>
<p>Add your credentials →</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760540357874/f2718979-97d2-49a8-9504-a2939ffeae81.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-14-run-your-playbook">Step 14 → Run your playbook!</h3>
<p><strong>Command used :</strong></p>
<pre><code class="lang-plaintext">ansible-playbook playbooks/execute_playbook.yaml
</code></pre>
<p><strong>Demonstration :</strong></p>
<p>🔴 <strong>LIVE</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760614197527/1aaec8d7-6bd7-47c8-8669-290f63a66097.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760614317396/905d370d-92c8-48d4-a05f-2e83aec83e14.png" alt class="image--center mx-auto" /></p>
<p>Applies patches if updates are available.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760614432011/3fe3500c-8f39-4785-8977-e518a674d0c6.png" alt class="image--center mx-auto" /></p>
<p>It finally executes the playbook to finish with no errors!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760614823534/e01ea2f0-9a37-4c2f-874b-edc037402660.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-15-verify-email-notifications">Step 15 → Verify Email Notifications</h3>
<p><mark>Checking for updates</mark> →</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760621826228/5ccb46d4-c0a5-4cdb-b66e-6227fb8f411b.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760621860235/da9efae4-bb36-4de4-bdd5-56eae885b71b.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760621878615/69bac861-adfc-4abe-81e7-4c00ad609fc1.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760621894464/c369e0ec-3650-4db5-8cb2-b3e70a0ffa1a.png" alt class="image--center mx-auto" /></p>
<p><mark>After applying patches</mark> →</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760622038231/469ac17a-f5e6-4661-b3f4-fcb18e902545.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760622056467/f61a9041-3bf3-4a82-aab5-f565b51212c1.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760622077668/b094d95b-f5b4-4c6a-8536-30d37e968e99.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760622096380/a55a36d2-0583-4fbc-ad36-4a4de0cf97f6.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item></channel></rss>