Hamburger Icon
  • Labs icon Lab
  • Core Tech
Google Cloud Platform icon
Labs

Automate Common Admin Tasks with Ansible

In this lab, you’ll practice building an Ansible project automating common systems administration tasks, such as file and user account management. When you’re finished, you’ll have a basic Ansible playbook that manages a fleet of Linux servers.

Google Cloud Platform icon
Labs

Path Info

Rating
(229 reviews)
Level
Clock icon Beginner
Duration
Clock icon 1h 35m
Published
Clock icon Jan 28, 2025

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Get Started in the Lab Environment

    Here are the initial instructions and explanation of the lab environment. Read this while your environment is busy creating itself from nothing. Yes, this violates physics; we know. How fun!

  2. Challenge

    Build YAML-Based Ansible Inventory

    To start with, you will build a simple Ansible inventory from scratch by creating and populating a YAML file containing reachability and authentication information for two Linux hosts that will be managed by Ansible. You will also learn how to confirm the Ansible inventory is structured properly through the "ansible-inventory" command.

  3. Challenge

    Confirming Host Reachability with Ansible

    You will verify that Ansible can connect to both Linux hosts using information within the Ansible inventory file, and will do this via a series of ad hoc Ansible commands.

  4. Challenge

    Creating Files and Directories with Ansible

    Here, you will create a simple Ansible playbook that creates specific directories and files on Ansible-managed hosts. You will use a simple technique to have Ansible populate specific files with static content. You will also manage the permissions and ownership of files and directories on Ansible-managed hosts. Through this challenge, the concept of idempotency–where Ansible automation does not make changes to managed hosts unless changes need to be made–will be reinforced.

  5. Challenge

    Creating and Managing User Accounts on Hosts

    You will now build off the Ansible playbook developed in the previous challenge by adding tasks to create user accounts on your Ansible-managed hosts. You will also learn how to manage group membership of the newly created user accounts.

  6. Challenge

    Managing File Permissions and Ownership

    In prior challenges, you created a new file and a new directory, as well as a new user account and a new group. Now, you will tie both concepts together; in this challenge, you will augment your Ansible playbook to factor in file permissions and ownership.

  7. Challenge

    Scoping Ansible Execution against Hosts

    Finally, you will continue to iterate on the Ansible playbook developed in previous challenges by adding tags to tasks within your Ansible playbook. You will then learn how to leverage tags, as well as limit the execution of Ansible automation to specific hosts in your inventory.

  8. Challenge

    The Last Challenge

    Welcome to the final challenge! This is your last chance to experiment in the environment. Clicking Finish Lab will end this little world that flittered into existence just for you.

Christopher Hart is a Technical Consulting Engineer for Cisco specializing in enterprise and data center network solutions, Python, and network automation solutions.

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.