W3cubDocs

/Ansible 2.9

at – Schedule the execution of a command or script file via the at command

Synopsis

  • Use this module to schedule a command or script file to run once in the future.
  • All jobs are executed in the ‘a’ queue.

Requirements

The below requirements are needed on the host that executes this module.

  • at

Parameters

Parameter Choices/Defaults Comments
command
string
A command to be executed in the future.
count
integer / required
The count of units in the future to execute the command or script file.
script_file
string
An existing script file to be executed in the future.
state
string
    Choices:
  • absent
  • present
The state dictates if the command or script file should be evaluated as present(added) or absent(deleted).
unique
boolean
    Choices:
  • no
  • yes
If a matching job is present a new job will not be added.
units
string / required
    Choices:
  • minutes
  • hours
  • days
  • weeks
The type of units in the future to execute the command or script file.

Examples

- name: Schedule a command to execute in 20 minutes as root
  at:
    command: ls -d / >/dev/null
    count: 20
    units: minutes

- name: Match a command to an existing job and delete the job
  at:
    command: ls -d / >/dev/null
    state: absent

- name: Schedule a command to execute in 20 minutes making sure it is unique in the queue
  at:
    command: ls -d / >/dev/null
    count: 20
    units: minutes
    unique: yes

Status

Red Hat Support

More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.

Authors

  • Richard Isaacson (@risaacson)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/at_module.html