Featured resource
Tech Upskilling Playbook 2025
Tech Upskilling Playbook

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

Learn more
  • Labs icon Lab
  • Cloud
Google Cloud Platform icon
Labs

Tackling Ansible Scheduling with the `at` Command

Being able to schedule tasks in Ansible is a valuable skill. This is shown by the fact that it is an objective of the *Red Hat Certified Ansible Specialist* exam. The `at` command and its associated commands (`atq` and `atrm`) can be used to schedule tasks in Linux-based systems or those that support the use of the `at` command. The `at` command is useful for scheduling one-time tasks. In this hands-on lab, we will make use of the `at` module to create scheduled tasks and show how to set and remove a task from the list of jobs. *This course is not approved or sponsored by Red Hat.*

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 30m
Last updated
Clock icon Aug 07, 2025

Contact sales

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

Table of Contents

  1. Challenge

    Log in to the Ansible Control Node Server and Change to the `ansible` User

    1. Sign in to the Ansible Control Node server using the cloud_user credentials, and change to the ansible user.

    2. Test that Ansible is working:

      ansible all -m ping
      

      Note: It may take several minutes after the start of the lab for the test to work as expected.

  2. Challenge

    Create and Run a Playbook Called `install-at.yml` that Installs, Enables, and Starts the `at` Service on All Nodes

    1. Create a playbook called install-at.yml that will install the at service on all nodes.
    2. Enable the atd service and start the service as part of the playbook.
    3. Run the playbook and ensure it installs, enables, and starts the service correctly.
  3. Challenge

    Create a Playbook Called `at-scheduled-task.yml` to Perform a Task on the Nodes in 20 Minutes

    1. Using the at module, create a playbook called at-scheduled-task.yml that adds a scheduled task to the nodes.
    2. The job should run in 20 minutes. The task to run is df -h > /tmp/diskspace.
  4. Challenge

    Run the `at-scheduled-task` Playbook and Test Each Node to Ensure the Task Is Scheduled

    1. Use the atq command to ensure the df -h task has been scheduled.
  5. Challenge

    Create a Playbook Called `remove-at-task.yml` to Remove the Previously Scheduled Task

    1. The remove-at-task.yml playbook should remove the task that was set in the at-scheduled-task.yml playbook.

    2. We can test with the atq command to ensure the task has been removed.

      Note: If they have not, we must troubleshoot why they have not been removed.

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.

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.