ansible.posix.at module – Schedule the execution of a command or script file via the at command
Note
This module is part of the ansible.posix collection (version 1.5.4).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ansible.posix
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: ansible.posix.at
.
New in ansible.posix 1.0.0
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 |
Comments |
---|---|
A command to be executed in the future. |
|
The count of units in the future to execute the command or script file. |
|
An existing script file to be executed in the future. |
|
The state dictates if the command or script file should be evaluated as present(added) or absent(deleted). Choices:
|
|
If a matching job is present a new job will not be added. Choices:
|
|
The type of units in the future to execute the command or script file. Choices:
|
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