Getting started with Ansible 15 – Host Variables and Handlers

    8
    13



    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): https://linux.video/ansible1
    Part 2 (SSH Overview & Setup): https://linux.video/ansible2
    Part 3 (Setting up the Git Repository): https://linux.video/ansible3
    Part 4 (Running Commands): https://linux.video/ansible4
    Part 5 (Running Elevated Commands): https://linux.video/ansible5
    Part 6 (Writing our First Playbook): https://linux.video/ansible6
    Part 7 (The ‘when’ Conditional): https://linux.video/ansible7
    Part 8 (Improving your Playbook): https://linux.video/ansible8
    Part 9 (Targeting Specific Nodes): https://linux.video/ansible9
    Part 10 (Tags): https://linux.video/ansible10
    Part 11 (Managing Files): https://linux.video/ansible11
    Part 12 (Managing Services): https://linux.video/ansible12
    Part 13 (Adding Users): https://linux.video/ansible13
    Part 14 (Roles): https://linux.video/ansible14
    Part 15 (Host Variables): This video
    Part 16 (Templates): https://linux.video/ansible16

    🙌 Support me on Patreon and get early access to new content!
    ➡️ https://learnlinux.link/patron

    Wiki article for this video:

    Getting Started with Ansible 15 – Host Variables

    🛒 Affiliate store for Linux compatible hardware/accessories (commission earned):
    ➡️ https://learnlinux.link/amazon

    💻 Check out the Tiny Pilot KVM for your Homelab (commission earned):
    ➡️ https://learnlinux.link/tinypilot

    💻 Check out Shells.com and spin up your very own Linux or Windows desktop in the cloud (commission earned):
    ➡️ https://learnlinux.link/shells

    🐦 Follow me on Twitter!
    ➡️ https://learnlinux.link/twitter

    💬 Official LearnLinux.tv Community:
    ➡️ https://community.learnlinux.tv

    📖 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
    ➡️ https://ubuntuserverbook.com

    👨 More about me:
    ➡️ https://www.jaylacroix.com
    ➡️ https://www.learnlinux.tv/about-me

    💽 How to create a bootable flash drive for installing Linux:
    ➡️ https://linux.video/flash-usb

    🐧 Which distro do I use?
    ➡️ https://learnlinux.link/mydistro

    🔐 How to better secure OpenSSH:
    ➡️ https://linux.video/secure-ssh

    ☁️ How to create a cloud Linux server with Linode:
    ➡️ https://learnlinux.link/create-linode

    #Ansible #LearnAnsible #AnsibleTutorial

    source

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

    13 COMMENTS

    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: https://www.reddit.com/r/awx/comments/jndus6/como_instalar_lightdm_con_ansible_awx_how_to/

      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."]}

      Thanks!

    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 .. 🙁