Getting started with Ansible 15 – Host Variables and Handlers


    Ansible is an incredible configuration management and provisioning utility that enables you to automate all the things. In this series, you’ll learn everything you need to know in order to use Ansible for your day-to-day administration duties. In video 15, we’ll learn how we can benefit from host variables, and we’ll also take a look at handlers as well which is a more efficient method of restarting services after a configuration change is made.

    Full series:
    Part 1 (Introduction):
    Part 2 (SSH Overview & Setup):
    Part 3 (Setting up the Git Repository):
    Part 4 (Running Commands):
    Part 5 (Running Elevated Commands):
    Part 6 (Writing our First Playbook):
    Part 7 (The ‘when’ Conditional):
    Part 8 (Improving your Playbook):
    Part 9 (Targeting Specific Nodes):
    Part 10 (Tags):
    Part 11 (Managing Files):
    Part 12 (Managing Services):
    Part 13 (Adding Users):
    Part 14 (Roles):
    Part 15 (Host Variables): This video
    Part 16 (Templates):

    🙌 Support me on Patreon and get early access to new content!

    Wiki article for this video:

    Getting Started with Ansible 15 – Host Variables

    🛒 Affiliate store for Linux compatible hardware/accessories (commission earned):

    💻 Check out the Tiny Pilot KVM for your Homelab (commission earned):

    💻 Check out and spin up your very own Linux or Windows desktop in the cloud (commission earned):

    🐦 Follow me on Twitter!

    💬 Official Community:

    📖 Check out jay’s latest book, Mastering Ubuntu Server 3rd Edition.
    Available in the USA late December 2020, and in other countries early January 2021

    👨 More about me:

    💽 How to create a bootable flash drive for installing Linux:

    🐧 Which distro do I use?

    🔐 How to better secure OpenSSH:

    ☁️ How to create a cloud Linux server with Linode:

    #Ansible #LearnAnsible #AnsibleTutorial


    Previous articleBuilding an Ansible Tower Cluster
    Next articleHow to create Ansible Playbook on Centos7


    1. You're a gifted teacher :). Seriously appreciate these videos.

      Note: Wiki page for Ansible 15 has "Template" functionality listed in it (should be in Anisble 16). I was a little confused because I thought it was directly related to host_vars, but the video itself clarifies it beautifully.

      Sorry for sounding nit-picky. I just thought it might help.

    2. Hello! Do you know how to install lightdm and define lightdm and not gdm3 as the login method from ansible? I wouldn't be finding anything on the internet!

      Post in reddit:

      The error (lightdm set to manually installed):

      fatal: [MAYO-SRV-5]: FAILED! => {"changed": false, "msg": "'/usr/bin/apt-mark manual lightdm' failed: E: Could not create temporary file for /var/lib/apt/extended_states – mkstemp (13: Permission denied)nE: Failed to write temporary StateFile /var/lib/apt/extended_statesn", "rc": 100, "stderr": "E: Could not create temporary file for /var/lib/apt/extended_states – mkstemp (13: Permission denied)nE: Failed to write temporary StateFile /var/lib/apt/extended_statesn", "stderr_lines": ["E: Could not create temporary file for /var/lib/apt/extended_states – mkstemp (13: Permission denied)", "E: Failed to write temporary StateFile /var/lib/apt/extended_states"], "stdout": "lightdm set to manually installed.n", "stdout_lines": ["lightdm set to manually installed."]}


    3. In Ubuntu 20.04 while running sudo apt update it is showing the error
      message hash mismatched , I tried with apt clean and rm -rf
      /var/lib/apt/lists/* and try to update it but still it showing error it
      happening with every mirror evevn with main server too .. 🙁