<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: mzandinia</title>
    <description>The latest articles on Forem by mzandinia (@mzandinia).</description>
    <link>https://forem.com/mzandinia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1048207%2F42972bae-8401-4d25-9d57-a9be6bd0f1ce.png</url>
      <title>Forem: mzandinia</title>
      <link>https://forem.com/mzandinia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mzandinia"/>
    <language>en</language>
    <item>
      <title>Automating Linux Distribution Updates with Ansible and Monitoring with Splunk</title>
      <dc:creator>mzandinia</dc:creator>
      <pubDate>Fri, 26 Apr 2024 14:16:51 +0000</pubDate>
      <link>https://forem.com/mzandinia/automating-linux-distribution-updates-with-ansible-and-monitoring-with-splunk-31od</link>
      <guid>https://forem.com/mzandinia/automating-linux-distribution-updates-with-ansible-and-monitoring-with-splunk-31od</guid>
      <description>

&lt;p&gt;When you think about automating your project, it's essential to understand what you aim to achieve at the end. Automation is not just a task that can be accomplished with some tools; these tools are merely aids to make our lives easier. As an architect responsible for the automation process, Stephen Covey's principle of "Begin with the end in mind" is crucial. You must consider every aspect of your automation project.&lt;/p&gt;

&lt;p&gt;This project streamlines the updating process of the most popular Linux distributions (RedHat and Debian-based) by leveraging a Nexus repository as a centralized source for installation files and packages.&lt;br&gt;
The project consists of the following key components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Nexus Repository: A private Nexus repository is set up to store and manage installation files and packages required for updating the Linux instances. This ensures a reliable and controlled source for the necessary files.&lt;/li&gt;
&lt;li&gt;Splunk Installation: An Ansible playbook is used to install Splunk on a dedicated instance within a private subnet. The Splunk instance retrieves the required installation files from the Nexus repository, ensuring a secure and efficient installation process.&lt;/li&gt;
&lt;li&gt;Ansible-based Updates: Ansible is employed to automate the updating process for all the Linux instances. It executes the necessary tasks to update the instances and logs the results for further analysis and monitoring.&lt;/li&gt;
&lt;li&gt;Splunk Dashboard: The update statuses and outcomes are visualized through a comprehensive dashboard in Splunk. This dashboard provides a clear and centralized view of the update statuses across different environments, enabling easy monitoring and troubleshooting.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Repository Structure&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Terraform files:&lt;/strong&gt; Essential files for AWS resource creation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scripts:&lt;/strong&gt; Scripts for proper instance configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ansible-project:&lt;/strong&gt; Contains playbooks and roles for various configurations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;br&gt;
Before you can use these configurations, you need to have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An AWS account with appropriate permissions to create resources such as VPC, EC2 instances, and security groups.&lt;/li&gt;
&lt;li&gt;Terraform installed on your local machine. &lt;a href="https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli" rel="noopener noreferrer"&gt;Install Terraform&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Your AWS credentials, including your Access Key and Secret Access Key, are configured for use with the AWS CLI or Terraform.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Deployment all the infrastructure with Terraform&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

git clone https://github.com/mzandinia/sample-project-on-AWS
cd sample-project-on-AWS/week4
terraform init
terraform plan
terraform apply


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After terraform creates all necessary resources terraform output will provide you three values:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Nexus initial password&lt;/li&gt;
&lt;li&gt;Load Balancer address&lt;/li&gt;
&lt;li&gt;Nexus login URL&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuika85ctbog3yrmefcj7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuika85ctbog3yrmefcj7.png" alt="terraform output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this moment, log in to Nexus via the URL and password that were provided to you in the Terraform output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fru3j8prh5izmcipbgbjm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fru3j8prh5izmcipbgbjm.png" alt="nexus signin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the "Sign In" button on the top right of the screen and enter the &lt;code&gt;admin&lt;/code&gt; user and the password provided to you in the last step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpnmmzve4j6jerxp272lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpnmmzve4j6jerxp272lm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;code&gt;Next&lt;/code&gt; to continue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fameq4kfycva2yj2uyak8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fameq4kfycva2yj2uyak8.png" alt="click next"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter a new strong password.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F493mixte8v1v39dui3j7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F493mixte8v1v39dui3j7.png" alt="enter password"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose &lt;code&gt;enable anonymous access&lt;/code&gt; and then click &lt;code&gt;next&lt;/code&gt; to continue. Enabling anonymous access allows unauthenticated users to access certain repositories or resources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffb25tn1ym00kcprxek8h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffb25tn1ym00kcprxek8h.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose &lt;code&gt;Finish&lt;/code&gt; to complete the login and configuration process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favju6m4s09c54t7gpusw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favju6m4s09c54t7gpusw.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the following steps, we will setup configure Nexus, install and configure Splunk, and update all the instances with Ansible playbooks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step1: Configure Nexus by Ansible&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To configure Nexus using Ansible, first login to the Nexus server via SSH using the &lt;code&gt;demouser&lt;/code&gt; username and &lt;code&gt;changeme&lt;/code&gt; password. Use the public address of Nexus instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqymy66yn4j7kf2i8husb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqymy66yn4j7kf2i8husb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, log in to the Ansible server via SSH using the same &lt;code&gt;demouser&lt;/code&gt; username and &lt;code&gt;changeme&lt;/code&gt; password. The private IP of Ansible is 10.10.10.11.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptn4zp3vcnevvdmfryhh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptn4zp3vcnevvdmfryhh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clone the repository containing the Ansible playbooks:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

git clone https://github.com/mzandinia/sample-project-on-AWS.git
cd sample-project-on-AWS/week4/ansible-project


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wnsbs6ts95xx52rdbbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wnsbs6ts95xx52rdbbp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the &lt;code&gt;ansible-playbook&lt;/code&gt; command to execute the &lt;code&gt;nexus-config.yml&lt;/code&gt; playbook, which configures the Nexus OSS repository. When prompted, enter the new password you configured for Nexus during the login process.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ansible-playbook 01-nexus-config/nexus-config.yml


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrx3fe5z0r4ziu6o8f4e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrx3fe5z0r4ziu6o8f4e.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3lezrsq14tx1t9f721s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3lezrsq14tx1t9f721s.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the playbook execution completes, you can verify that the appropriate repositories are configured in Nexus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5ev4fpoxde42nfo4bc3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5ev4fpoxde42nfo4bc3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Configure Linux Instances to use the nexus repo&lt;/strong&gt;&lt;br&gt;
The repo-config.yml playbook automates the configuration of the Linux instances to use the Nexus repository. It updates the package manager configuration files on each instance to point to the Nexus repository, ensuring that the instances will fetch packages and dependencies from Nexus instead of the default public repositories.&lt;/p&gt;

&lt;p&gt;To configure the Linux instances to use the Nexus repository, run the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ansible-playbook 02-repo-config/repo-config.yml


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5p9iuwa6y7otk9wwmvl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5p9iuwa6y7otk9wwmvl1.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step3: Install Splunk and Special app to view the results of the updates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Splunk is a powerful log management and analysis tool that can help you monitor and visualize the results of the updates performed on Linux instances. &lt;br&gt;
The &lt;code&gt;splunk-config.yml&lt;/code&gt; playbook automates the installation of Splunk on a designated instance and configures it to collect logs from the Linux instances. It also sets up the necessary Splunk configurations and forwards the logs to the Splunk instance for centralized monitoring.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;linux-update&lt;/code&gt; app includes pre-configured reports and alerts that help you track the progress of the updates, identify any issues or failures, and ensure that all instances are successfully updated. The dashboard provides a comprehensive view of the update process, making it easier to monitor and manage the updates across multiple instances.&lt;/p&gt;

&lt;p&gt;By using Splunk and the &lt;code&gt;linux-update&lt;/code&gt; app, you can gain valuable insights into the update process, quickly identify and troubleshoot any problems, and ensure that your Linux instances are up-to-date and secure.&lt;/p&gt;

&lt;p&gt;To install Splunk and set up a custom dashboard, run the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ansible-playbook 03-splunk-config/splunk-config.yml


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabxx87mt7spwe9h4gpzm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabxx87mt7spwe9h4gpzm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkvpkx75v8s6m0zli5747.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkvpkx75v8s6m0zli5747.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step4: Updating Linux Instances&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keeping your Linux instances up-to-date is crucial for maintaining system security, stability, and performance. This step focuses on updating the Linux instances using Ansible, with different update strategies and reboot behaviors.&lt;br&gt;
The update process is divided into four plays based on two factors:&lt;/p&gt;

&lt;p&gt;1- How to update the OS: Update all packages or exclude some packages&lt;/p&gt;

&lt;p&gt;2- How to reboot the server: Just check the reboot status or automatically reboot using Ansible&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftz7fua94g9gzpewvw4u4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftz7fua94g9gzpewvw4u4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;update-linux.yml&lt;/code&gt; playbook handles the update process based on the specified variables, ensuring that the desired update strategy and reboot behavior are applied to each instance.&lt;br&gt;
To demonstrate all possible conditions, there is one instance that exists, so the unreachablility can be chack. Also, there is another instance that doesn't properly configure to use the Nexus repository so the cache updating process will fail.&lt;/p&gt;

&lt;p&gt;To update all instances, run the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ansible-playbook 04-update-linux/update-linux.yml


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qlfnnf9hruwdbsl9fqn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qlfnnf9hruwdbsl9fqn.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bpb13qp93l9o3qxkadd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bpb13qp93l9o3qxkadd.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After executing the playbook, use the &lt;code&gt;ALB load balancer address&lt;/code&gt; to log into Splunk with the username &lt;code&gt;admin&lt;/code&gt; and password &lt;code&gt;changeme&lt;/code&gt;. The Splunk dashboard provides a centralized view of the update process, allowing you to monitor the progress and view the results.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3h7lb7zwttz2jwmunbn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3h7lb7zwttz2jwmunbn.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7khn1vfmsaoc6377metz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7khn1vfmsaoc6377metz.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the &lt;code&gt;"Linux Update Dashboard"&lt;/code&gt; to access the custom dashboard created by the linux-update app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkhx7w5a7uwdh9lwoggs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkhx7w5a7uwdh9lwoggs.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This dashboard presents a comprehensive overview of the update results and various configurations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9rti77rmw0xbsdhzhre7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9rti77rmw0xbsdhzhre7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;linux-update&lt;/code&gt; app also includes predefined reports and alerts to help you identify and troubleshoot issues that may occur during the update process:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reports:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg85ua3hna0ifupz0qfzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg85ua3hna0ifupz0qfzb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Cache Update Failure:&lt;/code&gt; Triggers if the cache update process fails for any reason.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Host Unreachable:&lt;/code&gt; Alerts if any host becomes unreachable during playbook execution.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Update Result Failure:&lt;/code&gt; Indicates if there is a problem during the update operation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Alerts:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fufly8dr286oqr5h9hfrx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fufly8dr286oqr5h9hfrx.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Playbook Execution Failure:&lt;/code&gt; Triggers if there are no logs, suggesting that the playbook was not executed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Reboot Failure:&lt;/code&gt; Critical alert if an instance fails to come back up after an Ansible-initiated reboot.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Server(s) must be reboot:&lt;/code&gt; Notifies if some servers require manual rebooting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By leveraging Ansible, Splunk, and the linux-update app, you can efficiently manage and monitor the update process across your Linux instances, ensuring system security and stability.&lt;/p&gt;

</description>
      <category>ansible</category>
      <category>terraform</category>
      <category>splunk</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
