Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Deploying Ansible

Ansible is a powerful automation tool that can be used for managing configuration state or even performing coordinated multi-system deployments. This activity is intended to provide the steps to get started with a simple Ansible configuration.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Beginner
Last updated
Sep 23, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Install Ansible on the control host.

    Run the following commands on the control host:

    sudo yum install epel-release

    sudo yum install ansible

  2. Challenge

    Create an `ansible` user on both the control host and workstation host being sure to set a password you can remember.

    On each host, run the noted commands below. Make sure you set a password you can remember (you will need it later).

    Assuming you are logged in as cloud_user:

    sudo useradd ansible

    sudo passwd ansible

  3. Challenge

    Configure a pre-shared key for Ansible that allows the user to log in from `control` to `workstation` without a password.

    Assuming you are logged into control as cloud_user, run the following commands providing the appropriate passwords when prompted and default options otherwise:

    sudo -i -u ansible (provide cloud_user a sudo password)

    ssh-keygen (accept default options by pressing enter )

    ssh-copy-id workstation (provide ansible user a password)

    logout

  4. Challenge

    Configure the Ansible user on the workstation host so that Ansible may sudo without a password.
    1. Log into the workstation host as cloud_user and run the following commands:
      sudo visudo
    • Add text at the end of the file that is opened:
      ansible ALL=(ALL) NOPASSWD: ALL
    • Save file:
      (:wq in vim)
  5. Challenge

    Create a simple inventory in `/home/ansible/inventory` consisting of only the `workstation` host.
    1. On the control host as the ansible user run the following commands:

    vim /home/ansible/inventory (note: you may use any text editor with which you are comfortable)

    • Add the text "workstation" to the file and save using (:wq in vim).
  6. Challenge

    Write an Ansible playbook in `/home/ansible/git-setup.yml` on the control node that installs `git` on `workstation` then execute the playbook.
    1. On the control host as the ansible user run the following commands:
      vim /home/ansible/git-setup.yml (You may use any text editor with which your are comfortable.)
    • Add the following text to the file:
        --- # install git on target host
        - hosts: workstation
          become: yes
          tasks:
          - name: install git
            yum:
              name: git
              state: latest
    
    • Save (:wq in vim) and quit the text editor.

    • Run ansible-playbook -i /home/ansible/inventory /home/ansible/git-setup.yml.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

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.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight