<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ansible Playbooks :: Flywheel Data Labs - Workshops</title>
    <link>http://localhost:8080/ansible_101/3.playbooks/index.html</link>
    <description>An Ansible playbook is a YAML-formatted file that defines a series of automation tasks to be executed on one or more managed hosts, allowing administrators to consistently configure systems, deploy applications, and orchestrate infrastructure through repeatable, human-readable automation.&#xA;Core Components of an Ansible Playbook Playbook - The overall YAML file that contains one or more plays. Play - A set of tasks applied to a specified group of hosts. Hosts - The target systems or inventory groups on which the play runs. Tasks - Individual actions executed in sequence, such as installing packages or creating files. Modules - The built-in or custom units of work that tasks invoke (for example, package, service, copy, or user). Variables - User-defined values that make playbooks reusable and customizable. Handlers - Special tasks that run only when notified, typically used to restart services after a configuration change. Roles - A standardized structure for organizing playbooks, tasks, variables, templates, and files into reusable components. Templates - Dynamic configuration files, usually written with Jinja2 syntax, that are rendered with variable values before deployment. Inventory - The list of managed hosts and groups that Ansible targets during execution. Facts - Information automatically gathered about managed hosts, such as operating system, IP addresses, and memory details. Tags - Labels that allow selective execution of specific tasks or plays. Together, these components enable Ansible to automate infrastructure management in a modular, repeatable, and maintainable way.</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 08 Jun 2026 10:40:21 -0400</lastBuildDate>
    <atom:link href="http://localhost:8080/ansible_101/3.playbooks/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Ansible Playbook Structure</title>
      <link>http://localhost:8080/ansible_101/3.playbooks/playbook_structure/index.html</link>
      <pubDate>Fri, 05 Jun 2026 10:40:21 -0400</pubDate>
      <guid>http://localhost:8080/ansible_101/3.playbooks/playbook_structure/index.html</guid>
      <description>Following is a sample playbook file to show the possible components:&#xA;--- - name: Configure web servers hosts: webservers become: true vars: package_name: httpd tasks: # this is a comment - name: Install Apache ansible.builtin.package: name: &#34;{{ package_name }}&#34; state: present The first line is the name of ansible play contained int he playbook. The second line lists the hosts that the play is run against. This must match one or more entries in the inventory file. It can be individual servers or a group.</description>
    </item>
    <item>
      <title>Ansible Facts</title>
      <link>http://localhost:8080/ansible_101/3.playbooks/facts/index.html</link>
      <pubDate>Fri, 05 Jun 2026 10:40:21 -0400</pubDate>
      <guid>http://localhost:8080/ansible_101/3.playbooks/facts/index.html</guid>
      <description>By default, the first step ansible does is to gather facts about the hosts it’s going to execute against. These facts can be used in variables for more complex plays. If you are concerned about performance, you disable fact gathering by setting gather_facts: false in the top section of the playbook.&#xA;Let’s run our first playbook to see the facts that are returned. First, have a look at playbooks/facts.yml, then execute it.</description>
    </item>
    <item>
      <title>Ansible Modules</title>
      <link>http://localhost:8080/ansible_101/3.playbooks/modules/index.html</link>
      <pubDate>Fri, 05 Jun 2026 10:40:21 -0400</pubDate>
      <guid>http://localhost:8080/ansible_101/3.playbooks/modules/index.html</guid>
      <description>Ansible has built-in modules for a great number of tasks. In the last lab we used the built-in package module to install software. The documentation for ansible is very useful.&#xA;Browse to https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/package_module.html#ansible-collections-ansible-builtin-package-module&#xA;Here you will see the documentation for the package module. The docs show parameters and attributes, include what’s required and what default values are. It also has a good examples section that give practical use cases for the module.</description>
    </item>
    <item>
      <title>Ansible Template</title>
      <link>http://localhost:8080/ansible_101/3.playbooks/template/index.html</link>
      <pubDate>Mon, 08 Jun 2026 10:40:21 -0400</pubDate>
      <guid>http://localhost:8080/ansible_101/3.playbooks/template/index.html</guid>
      <description>One way to make changes to files is using templates. Ansibe uses the Jinja2 template format.&#xA;In the ansible-workshop/playbooks/templates directory you’ll see a file motd.j2 template file that we’ll use to modify the /etc/motd file on our target systems. The template takes advantage of ansible facts to make changes to the file that are custom to the system by using variables derived from facts.&#xA;After reviewing the template file, review the motd.yml playbook. Notice that you set the ownership and permissions for the file. Alls file related modules support these same directives.</description>
    </item>
    <item>
      <title>Webserver</title>
      <link>http://localhost:8080/ansible_101/3.playbooks/webserver/index.html</link>
      <pubDate>Mon, 08 Jun 2026 10:40:21 -0400</pubDate>
      <guid>http://localhost:8080/ansible_101/3.playbooks/webserver/index.html</guid>
      <description>We are now going to install, configure and enable a web server on our target systems. Take a look at the webserver.yml playbook. It’s first installing the packages, then using systemctl to enable the webserver and making sure it’s started.&#xA;Execute the playbook&#xA;ansible-playbook webserver.yml After the playbook completes successfully, run the following commands to ensure the package is installed and the service is started and enabled:&#xA;ansible all -m command -a &#34;rpm -q httpd&#34; ansible all -m command -a &#34;systemctl is-active httpd&#34; ansible all -m command -a &#34;systemctl is-enabled httpd&#34; Edit the playbook and add another task to create a custom web page.</description>
    </item>
    <item>
      <title>SSH Config</title>
      <link>http://localhost:8080/ansible_101/3.playbooks/ssh_config/index.html</link>
      <pubDate>Mon, 08 Jun 2026 10:40:21 -0400</pubDate>
      <guid>http://localhost:8080/ansible_101/3.playbooks/ssh_config/index.html</guid>
      <description>A lot of security hardening has to do with editing existing files so that they comply with security baselines. Review the ssh_hardening.yml playbook. It uses the lineinfile module to change the contents of the SSH config file. It uses a regular expression to make content and to change it to the value that we want.&#xA;Note that backup is set to true. This is not the default behavior but is very important when manipulating files. It’s very easy to get the syntax wrong when making changes and clobber the file.</description>
    </item>
  </channel>
</rss>