<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ansible on Samarthya</title><link>https://samarthya.me/tags/ansible/</link><description>Recent content in Ansible on Samarthya</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© Samarthya 2018-2026. All rights reserved.</copyright><lastBuildDate>Sat, 14 Sep 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://samarthya.me/tags/ansible/index.xml" rel="self" type="application/rss+xml"/><item><title>A Maintainable Ansible Playbook Structure</title><link>https://samarthya.me/posts/ansible-playbook-structure/</link><pubDate>Sat, 14 Sep 2024 00:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-playbook-structure/</guid><description>&lt;p&gt;My first Ansible playbook was a single file. It installed packages, created users, copied configuration, and restarted services. It was a reasonable starting point. The problem began when every change required editing the same file, which had quietly become a miniature operating system.&lt;/p&gt;</description></item><item><title>Ansible Loops</title><link>https://samarthya.me/posts/ansible-loops/</link><pubDate>Wed, 28 Aug 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-loops/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/ansible-loops/loop-1.jpg"&#10; srcset="https://samarthya.me/posts/ansible-loops/loop-1.jpg 800w, https://samarthya.me/posts/ansible-loops/loop-1.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/ansible-loops/loop-1.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;&lt;code&gt;Ansible&lt;/code&gt; offers powerful looping mechanisms that can significantly enhance your playbooks’ efficiency and readability. In this blog post, we’ll dive deep into Ansible loops, exploring various elements and providing practical examples to help you master this essential feature.&lt;/p&gt;</description></item><item><title>Privilege Escalation: How a `remote_user` and a `become_user` works</title><link>https://samarthya.me/posts/ansible-privilege-escalation/</link><pubDate>Fri, 26 Jul 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-privilege-escalation/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="600"&#10; src="https://samarthya.me/posts/ansible-privilege-escalation/image-ansible.jpg"&#10; srcset="https://samarthya.me/posts/ansible-privilege-escalation/image-ansible.jpg 800w, https://samarthya.me/posts/ansible-privilege-escalation/image-ansible.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/ansible-privilege-escalation/image-ansible.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;One of its Ansible’s features is the ability to execute tasks with elevated privileges, often necessary for managing system configurations. This process is known as privilege escalation.&lt;/p&gt;</description></item><item><title>Ansible Magic Variables: Useful Context Without Guesswork</title><link>https://samarthya.me/posts/ansible-magic-variables/</link><pubDate>Sat, 08 Jun 2024 00:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-magic-variables/</guid><description>&lt;p&gt;The first time I saw &lt;code&gt;hostvars&lt;/code&gt; inside a Jinja expression I thought Ansible had become much cleverer than I was. It was useful, but it also made the playbook harder to read. After a few such expressions, I went back and learned what Ansible calls magic variables.&lt;/p&gt;</description></item><item><title>Ansible Configuration: Make the Defaults Explicit</title><link>https://samarthya.me/posts/ansible-configuration-basics/</link><pubDate>Sat, 16 Mar 2024 00:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-configuration-basics/</guid><description>&lt;p&gt;When I first used Ansible, I was happy that it worked without a configuration file. Later, the same playbook behaved differently depending on which folder I ran it from. That was the point at which I stopped treating the defaults as magic and created a small project-level &lt;code&gt;ansible.cfg&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Non root `podman` and `molecule`</title><link>https://samarthya.me/posts/non-root-podman-and-molecule/</link><pubDate>Tue, 13 Feb 2024 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/non-root-podman-and-molecule/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Molecule testing an Ansible role through podman-docker and the user&amp;rsquo;s podman.socket, with containers running as non-root"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/non-root-podman-and-molecule/molecule_hu_c9c0ad608e5dc687.png"&#10; srcset="https://samarthya.me/posts/non-root-podman-and-molecule/molecule_hu_c9c0ad608e5dc687.png 800w, https://samarthya.me/posts/non-root-podman-and-molecule/molecule.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/non-root-podman-and-molecule/molecule.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;On my &lt;code&gt;Centos8&lt;/code&gt; I was facing issue when I was trying to run Molecule on a centos machine which is running &lt;code&gt;podman&lt;/code&gt; as a non root user. Also, I am using the driver – &lt;code&gt;docker&lt;/code&gt; and not &lt;code&gt;podman&lt;/code&gt;, so to overcome the aliases and references issues I have installed &lt;code&gt;podman-docker&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Getting Started with Ansible: From One Command to a Playbook</title><link>https://samarthya.me/posts/getting-started-with-ansible/</link><pubDate>Sun, 21 Jan 2024 00:00:00 +0000</pubDate><guid>https://samarthya.me/posts/getting-started-with-ansible/</guid><description>&lt;p&gt;I had been writing shell commands for every small infrastructure change. It worked, until I needed to repeat the same change on another machine and could no longer remember which command I had run first. That was my reason for starting with Ansible.&lt;/p&gt;</description></item><item><title>Async/Poll &amp; Notify: Ansible Long running process</title><link>https://samarthya.me/posts/async-poll-notify-ansible-long-running-process/</link><pubDate>Fri, 24 Mar 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/async-poll-notify-ansible-long-running-process/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Ansible long-running task with async 300 and poll 60, registered job ID, async_status until finished, and debug output"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/async-poll-notify-ansible-long-running-process/as-async_hu_5a8baddeb9db8fb4.png"&#10; srcset="https://samarthya.me/posts/async-poll-notify-ansible-long-running-process/as-async_hu_5a8baddeb9db8fb4.png 800w, https://samarthya.me/posts/async-poll-notify-ansible-long-running-process/as-async.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/async-poll-notify-ansible-long-running-process/as-async.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;ASYNC &amp;amp; Poll&lt;/p&gt;</description></item><item><title>Ansible Variables</title><link>https://samarthya.me/posts/ansible-variables-2/</link><pubDate>Wed, 15 Mar 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-variables-2/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Places to define Ansible variables: inline, playbook, role, inventory, command line and facts"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/ansible-variables-2/ans-vars_hu_28380e744336e13.png"&#10; srcset="https://samarthya.me/posts/ansible-variables-2/ans-vars_hu_28380e744336e13.png 800w, https://samarthya.me/posts/ansible-variables-2/ans-vars.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/ansible-variables-2/ans-vars.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Ansible Variables&lt;/p&gt;</description></item><item><title>`lookup`: Ansible</title><link>https://samarthya.me/posts/lookup-ansible/</link><pubDate>Tue, 28 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/lookup-ansible/</guid><description>&lt;p&gt;Ansible’s &lt;code&gt;lookup&lt;/code&gt; plugin allows you to access data from a variety of sources, including files, templates, and external programs. You can use &lt;code&gt;lookup&lt;/code&gt; to fetch data dynamically at runtime and use it in your playbooks and roles.&lt;/p&gt;</description></item><item><title>Python Virtual Enviroments</title><link>https://samarthya.me/posts/venvansible/</link><pubDate>Tue, 28 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/venvansible/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Python virtual environment steps: create, activate, install, freeze to requirements.txt, and recreate"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/venvansible/an-lint-1_hu_c5d8a3d7cb9aaa30.png"&#10; srcset="https://samarthya.me/posts/venvansible/an-lint-1_hu_c5d8a3d7cb9aaa30.png 800w, https://samarthya.me/posts/venvansible/an-lint-1.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/venvansible/an-lint-1.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Using a virtual environment like venv is a best practice when working with Python-based projects like Ansible, Molecule, and Playbooks.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;Continuing from the &lt;a href="https://samarthya.me/posts/venv-ansible/" &gt;blog&lt;/a&gt;, &lt;code&gt;Virtual environments&lt;/code&gt; are isolated Python environments that allow you to manage dependencies separately for each project, providing a controlled and reproducible environment for development, testing, and production.&lt;/p&gt;</description></item><item><title>VENV: Ansible</title><link>https://samarthya.me/posts/venv-ansible/</link><pubDate>Mon, 27 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/venv-ansible/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Steps to run Ansible and Molecule in a Python virtual environment on CentOS 7"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/venv-ansible/an-venv_hu_2084f4df6bf85296.png"&#10; srcset="https://samarthya.me/posts/venv-ansible/an-venv_hu_2084f4df6bf85296.png 800w, https://samarthya.me/posts/venv-ansible/an-venv.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/venv-ansible/an-venv.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Ansible and Molecule are popular tools for configuration management and testing in the world of DevOps. To avoid conflicts between different projects and their dependencies, it is recommended to use a virtual environment for each project. In this blog post, we’ll show you how to set up and use a virtual environment using Python’s built-in &lt;code&gt;venv&lt;/code&gt; module on &lt;code&gt;macOS&lt;/code&gt; and &lt;code&gt;CentOS 7&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Ansible Configuration: `ansible.cfg`</title><link>https://samarthya.me/posts/ansible-configuration-ansible-cfg/</link><pubDate>Thu, 23 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-configuration-ansible-cfg/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Common ansible.cfg settings: inventory, remote_user, become, become_user, become_method, library, forks and file location"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/ansible-configuration-ansible-cfg/an-config_hu_282d8824440c703f.png"&#10; srcset="https://samarthya.me/posts/ansible-configuration-ansible-cfg/an-config_hu_282d8824440c703f.png 800w, https://samarthya.me/posts/ansible-configuration-ansible-cfg/an-config.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/ansible-configuration-ansible-cfg/an-config.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;&lt;code&gt;ansible.cfg&lt;/code&gt; is the main configuration file for Ansible. It is used to customize Ansible’s behavior and includes a wide range of options, including the location of inventory files, the default SSH user, and the path to the module library.&lt;/p&gt;</description></item><item><title>Ansible: A thought</title><link>https://samarthya.me/posts/ansible-a-thought/</link><pubDate>Wed, 08 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-a-thought/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="low"&#10; alt=""&#10; src="https://www.ansible.com/hubfs/Logo-Red_Hat-Ansible-A-Reverse-SVG.svg"&#10; &gt;&lt;/figure&gt;&#10;&lt;p&gt;Ansible is an open-source software platform for automating and managing IT infrastructure. It provides a simple and easy-to-learn method for automating and managing various IT processes such as provisioning, configuration management, and application deployment. Ansible uses YAML (Yet Another Markup Language) and playbooks written in YAML, which are a series of instructions that specify what actions need to be performed.&lt;/p&gt;</description></item><item><title>Ansible: Building Inventory</title><link>https://samarthya.me/posts/ansible-building-inventory/</link><pubDate>Wed, 08 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-building-inventory/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="600"&#10; height="292"&#10; src="https://samarthya.me/posts/ansible-building-inventory/an-inventory.png"&#10; srcset="https://samarthya.me/posts/ansible-building-inventory/an-inventory.png 800w, https://samarthya.me/posts/ansible-building-inventory/an-inventory.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/ansible-building-inventory/an-inventory.png"&gt;&lt;/figure&gt;&#10;&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; The blog is adapted from the information available &lt;a href="https://docs.ansible.com/ansible/latest/getting_started/get_started_inventory.html#get-started-inventory" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;.&#10;— &lt;a href="https://docs.ansible.com/ansible/" target="_blank" rel="noreferrer"&gt;https://docs.ansible.com/ansible/&lt;/a&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;An Ansible inventory is a file that defines the hosts and groups of hosts that Ansible will manage. Inventory files are used to define the nodes (hosts) that will be managed by Ansible. These files can be in different formats, including INI and YAML.&lt;/p&gt;</description></item><item><title>Ansible: SSH Access</title><link>https://samarthya.me/posts/ansible-ssh-access/</link><pubDate>Wed, 08 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-ssh-access/</guid><description>&lt;p&gt;To set up SSH access for inventory hosts in &lt;code&gt;Ansible&lt;/code&gt;, follow these steps:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Generate an SSH key pair&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;ssh-keygen -t rsa&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Copy the public key to the remote host&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;ssh-copy-id user@hostname&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Test the connection to the remote host:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;ssh user@hostname&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Modify the &lt;code&gt;ansible.cfg&lt;/code&gt; file to set the remote user, if necessary.&lt;/li&gt;&#10;&lt;li&gt;Add the remote host to the Ansible inventory file.&lt;/li&gt;&#10;&lt;li&gt;Run the Ansible playbook to execute the desired tasks on the remote host.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Note: If you need to access multiple remote hosts, repeat steps 2-5 for each host.&lt;/p&gt;</description></item><item><title>Ansible: Templates</title><link>https://samarthya.me/posts/ansible-templates/</link><pubDate>Wed, 08 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-templates/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="How an Ansible template becomes a config file: a Jinja2 template and variables are rendered and copied to the host"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/ansible-templates/an-template_hu_52d5b4a217590b32.png"&#10; srcset="https://samarthya.me/posts/ansible-templates/an-template_hu_52d5b4a217590b32.png 800w, https://samarthya.me/posts/ansible-templates/an-template.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/ansible-templates/an-template.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;Templates in &lt;code&gt;Ansible&lt;/code&gt; are a type of file that contain configuration information or scripts written in a &lt;code&gt;Jinja2&lt;/code&gt; templating language.&lt;/p&gt;</description></item><item><title>Ansible: Variables</title><link>https://samarthya.me/posts/ansible-variables/</link><pubDate>Wed, 08 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-variables/</guid><description>&lt;p&gt;Ansible Variables are used to store values that can be reused throughout an Ansible playbook. They can be set in a number of ways, including being passed as command-line options, defined in an inventory file, or defined in a playbook itself. Variables can be used to store values such as file paths, user-defined parameters, and results of tasks.&lt;/p&gt;</description></item><item><title>Ansible: Structure of a playbook?</title><link>https://samarthya.me/posts/ansible-structure-of-a-playbook/</link><pubDate>Tue, 07 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-structure-of-a-playbook/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="An Ansible playbook made of inventory, variables, roles and tasks, beside a short example playbook"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/ansible-structure-of-a-playbook/ansible_hu_de247ee45393f43d.png"&#10; srcset="https://samarthya.me/posts/ansible-structure-of-a-playbook/ansible_hu_de247ee45393f43d.png 800w, https://samarthya.me/posts/ansible-structure-of-a-playbook/ansible.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/ansible-structure-of-a-playbook/ansible.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&lt;p&gt;The structure of an &lt;code&gt;Ansible playbook&lt;/code&gt; includes the following elements:&lt;/p&gt;</description></item><item><title>Ansible: Refresher</title><link>https://samarthya.me/posts/ansible-refresher/</link><pubDate>Thu, 02 Feb 2023 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-refresher/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Seven reasons to use Ansible: simple, agentless, idempotent, modular, integrates with other tools, large community, open source"&#10; width="1200"&#10; height="630"&#10; src="https://samarthya.me/posts/ansible-refresher/an-refresh_hu_8c3c6e601ccfcb3.png"&#10; srcset="https://samarthya.me/posts/ansible-refresher/an-refresh_hu_8c3c6e601ccfcb3.png 800w, https://samarthya.me/posts/ansible-refresher/an-refresh.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/ansible-refresher/an-refresh.png"&gt;&lt;figcaption&gt;Recreated in October 2026 from the post; the original image was lost&lt;/figcaption&gt;&lt;/figure&gt;&#10;&#10;&lt;h2 class="relative group"&gt;What is Ansible?&#10; &lt;div id="what-is-ansible" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-is-ansible" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;Ansible is an open-source software platform for automating and configuring computer systems. It allows you to manage, deploy and orchestrate applications, infrastructure, and network devices using a simple, human-readable language. Ansible uses a push-based architecture, where tasks are executed on remote hosts from a central control machine, and does not require agents to be installed on target systems.&lt;/p&gt;</description></item><item><title>Ansible: Notes</title><link>https://samarthya.me/posts/ansible-notes/</link><pubDate>Fri, 04 Mar 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/ansible-notes/</guid><description>&lt;div&#10; id="accordion-07a1fe5e372c56b6e0c0aa29f52abe3b"&#10; class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"&#10; data-accordion="collapse"&#10; data-accordion-separated="false"&#10;&gt;&#10;&#10;&#10;&#10;&#10; &#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&#10;&lt;details&#10; class="group border-none"&#10; data-accordion-item&#10; &#10;&gt;&#10; &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;&#10; &lt;span class="flex items-center gap-2"&gt;&#10; &#10; &lt;span&gt;Official documentation notes (Self Read)&lt;/span&gt;&#10; &lt;/span&gt;&#10; &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;&#10; &lt;span class="relative block icon"&gt;&lt;svg&#10; xmlns="http://www.w3.org/2000/svg"&#10; viewBox="0 0 20 20"&#10; fill="currentColor"&#10; aria-hidden="true"&#10;&gt;&#10; &lt;path&#10; fill-rule="evenodd"&#10; d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"&#10; clip-rule="evenodd"&#10; /&gt;&#10;&lt;/svg&gt;&#10;&lt;/span&gt;&#10; &lt;/span&gt;&#10; &lt;/summary&gt;&#10;&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;&#10; &lt;div&#10; class="tab__container w-full"&#10;&lt;blockquote&gt;&lt;/blockquote&gt; &lt;div class="tab__nav" role="tablist"&gt;&#10; &lt;div class="flex flex-wrap gap-1"&gt;&lt;button&#10; class="tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 tab--active"&#10; role="tab"&#10; aria-selected="true"&#10; data-tab-index="0"&#10; data-tab-label="Getting Started"&gt;&#10; &lt;span class="flex items-center gap-1"&gt;&#10;&lt;pre&gt;&lt;code&gt; Getting Started&#10; &amp;lt;/span&amp;gt;&#10; &amp;lt;/button&amp;gt;&amp;lt;button&#10; class=&amp;quot;tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 &amp;quot;&#10; role=&amp;quot;tab&amp;quot;&#10; aria-selected=&amp;quot;false&amp;quot;&#10; data-tab-index=&amp;quot;1&amp;quot;&#10; data-tab-label=&amp;quot;Playbooks&amp;quot;&amp;gt;&#10; &amp;lt;span class=&amp;quot;flex items-center gap-1&amp;quot;&amp;gt;&#10; &#10; Playbooks&#10; &amp;lt;/span&amp;gt;&#10; &amp;lt;/button&amp;gt;&amp;lt;button&#10; class=&amp;quot;tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 &amp;quot;&#10; role=&amp;quot;tab&amp;quot;&#10; aria-selected=&amp;quot;false&amp;quot;&#10; data-tab-index=&amp;quot;2&amp;quot;&#10; data-tab-label=&amp;quot;Control Node&amp;quot;&amp;gt;&#10; &amp;lt;span class=&amp;quot;flex items-center gap-1&amp;quot;&amp;gt;&#10; &#10; Control Node&#10; &amp;lt;/span&amp;gt;&#10; &amp;lt;/button&amp;gt;&amp;lt;button&#10; class=&amp;quot;tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 &amp;quot;&#10; role=&amp;quot;tab&amp;quot;&#10; aria-selected=&amp;quot;false&amp;quot;&#10; data-tab-index=&amp;quot;3&amp;quot;&#10; data-tab-label=&amp;quot;Managed Node&amp;quot;&amp;gt;&#10; &amp;lt;span class=&amp;quot;flex items-center gap-1&amp;quot;&amp;gt;&#10; &#10; Managed Node&#10; &amp;lt;/span&amp;gt;&#10; &amp;lt;/button&amp;gt;&amp;lt;button&#10; class=&amp;quot;tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 &amp;quot;&#10; role=&amp;quot;tab&amp;quot;&#10; aria-selected=&amp;quot;false&amp;quot;&#10; data-tab-index=&amp;quot;4&amp;quot;&#10; data-tab-label=&amp;quot;Inventory&amp;quot;&amp;gt;&#10; &amp;lt;span class=&amp;quot;flex items-center gap-1&amp;quot;&amp;gt;&#10; &#10; Inventory&#10; &amp;lt;/span&amp;gt;&#10; &amp;lt;/button&amp;gt;&amp;lt;button&#10; class=&amp;quot;tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 &amp;quot;&#10; role=&amp;quot;tab&amp;quot;&#10; aria-selected=&amp;quot;false&amp;quot;&#10; data-tab-index=&amp;quot;5&amp;quot;&#10; data-tab-label=&amp;quot;Modules&amp;quot;&amp;gt;&#10; &amp;lt;span class=&amp;quot;flex items-center gap-1&amp;quot;&amp;gt;&#10; &#10; Modules&#10; &amp;lt;/span&amp;gt;&#10; &amp;lt;/button&amp;gt;&amp;lt;button&#10; class=&amp;quot;tab__button px-3 py-2 text-sm font-semibold border-b-2 border-transparent rounded-t-md hover:bg-neutral-200 dark:hover:bg-neutral-700 &amp;quot;&#10; role=&amp;quot;tab&amp;quot;&#10; aria-selected=&amp;quot;false&amp;quot;&#10; data-tab-index=&amp;quot;6&amp;quot;&#10; data-tab-label=&amp;quot;Tasks&amp;quot;&amp;gt;&#10; &amp;lt;span class=&amp;quot;flex items-center gap-1&amp;quot;&amp;gt;&#10; &#10; Tasks&#10; &amp;lt;/span&amp;gt;&#10; &amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&#10; &lt;/div&gt;&#10; &lt;div class="tab__content mt-4"&gt;&lt;div class="tab__panel tab--active" data-tab-index="0"&gt;&#10; &lt;p&gt;&lt;a href="https://docs.ansible.com/ansible/2.9/user_guide/basic_concepts.html#control-node" target="_blank" rel="noreferrer"&gt;Control node&lt;/a&gt;&lt;br&gt;&#10;&lt;a href="https://docs.ansible.com/ansible/2.9/user_guide/basic_concepts.html#managed-nodes" target="_blank" rel="noreferrer"&gt;Managed nodes&lt;/a&gt;&lt;br&gt;&#10;&lt;a href="https://docs.ansible.com/ansible/2.9/user_guide/basic_concepts.html#inventory" target="_blank" rel="noreferrer"&gt;Inventory&lt;/a&gt;&lt;br&gt;&#10;&lt;a href="https://docs.ansible.com/ansible/2.9/user_guide/basic_concepts.html#modules" target="_blank" rel="noreferrer"&gt;Modules&lt;/a&gt;&lt;br&gt;&#10;&lt;a href="https://docs.ansible.com/ansible/2.9/user_guide/basic_concepts.html#tasks" target="_blank" rel="noreferrer"&gt;Tasks&lt;/a&gt;&lt;br&gt;&#10;&lt;a href="https://docs.ansible.com/ansible/2.9/user_guide/basic_concepts.html#playbooks" target="_blank" rel="noreferrer"&gt;Playbooks&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Building blocks for Ansible.&lt;/p&gt;&#10;&lt;pre&gt;&lt;code&gt; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;tab__panel &amp;quot; data-tab-index=&amp;quot;1&amp;quot;&amp;gt;&#10; &amp;lt;div class=&amp;quot;lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl&amp;quot;&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;A playbook is composed of one or more ‘plays’ in an ordered list.&#10;— Official documentation&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Ordered lists of tasks, saved so you can run those tasks in that order repeatedly.&lt;/li&gt;&#10;&lt;li&gt;Expressed in YAML format&lt;/li&gt;&#10;&lt;li&gt;It offers a multi-machine configuration &amp;amp; deployment system for complex applications that is&#10;&lt;ul&gt;&#10;&lt;li&gt;Repeatable&lt;/li&gt;&#10;&lt;li&gt;Re-usable &amp;amp;&lt;/li&gt;&#10;&lt;li&gt;Simple&#10; &lt;/div&gt;&lt;div class="tab__panel " data-tab-index="2"&gt;&#10; &lt;ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;li&gt;Controller machine&lt;/li&gt;&#10;&lt;li&gt;Has the Ansible executable installed (+Python)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;pre&gt;&lt;code&gt; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;tab__panel &amp;quot; data-tab-index=&amp;quot;3&amp;quot;&amp;gt;&#10; &amp;lt;ul&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;li&gt;List of nodes/hosts that will be managed by control node&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;pre&gt;&lt;code&gt; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;tab__panel &amp;quot; data-tab-index=&amp;quot;4&amp;quot;&amp;gt;&#10; &amp;lt;ul&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;li&gt;List of nodes&lt;/li&gt;&#10;&lt;li&gt;Can specify information like IP address for each managed node.&lt;/li&gt;&#10;&lt;li&gt;An inventory can also organise managed nodes in groups e.g. &lt;code&gt;[webserver]&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;pre&gt;&lt;code&gt; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;tab__panel &amp;quot; data-tab-index=&amp;quot;5&amp;quot;&amp;gt;&#10; &amp;lt;ul&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;li&gt;The units of code Ansible executes.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;pre&gt;&lt;code&gt; &amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;tab__panel &amp;quot; data-tab-index=&amp;quot;6&amp;quot;&amp;gt;&#10; The units of action in Ansible&#10; &amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;/div&gt;&#10;&#10; &lt;/div&gt;&#10;&lt;/details&gt;&#10;&#10;&#10;&lt;/div&gt;</description></item></channel></rss>