Skip to content

at

Collection Note

This module is part of the ansible.posix collection. To install the collection, use:

ansible-galaxy collection install ansible.posix
Added in version 1.0.0.

You need further requirements to be able to use this module, see the Requirements section for details.

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 following Python packages are needed on the host that executes this module:

Parameters

Parameter Defaults / Choices Comments
command
str
A command to be executed in the future.
count
int
The count of units in the future to execute the command or script file.
script_file
str
An existing script file to be executed in the future.
state
str
Default: present
Choices: absent, present
The state dictates if the command or script file should be evaluated as V(present) (added) or V(absent) (deleted).
unique
bool
If a matching job is present a new job will not be added.
units
str
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
  ansible.posix.at:
    command: ls -d / >/dev/null
    count: 20
    units: minutes

- name: Match a command to an existing job and delete the job
  ansible.posix.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
  ansible.posix.at:
    command: ls -d / >/dev/null
    count: 20
    units: minutes
    unique: true

Authors

  • Richard Isaacson (@risaacson)