ansible.posix.at (1.5.4) — module

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

| "added in version" 1.0.0 of ansible.posix"

Authors: Richard Isaacson (@risaacson)

Install collection

Install with ansible-galaxy collection install ansible.posix:==1.5.4


Add to requirements.yml

  collections:
    - name: ansible.posix
      version: 1.5.4

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Schedule a command to execute in 20 minutes as root
  ansible.posix.at:
    command: ls -d / >/dev/null
    count: 20
    units: minutes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Match a command to an existing job and delete the job
  ansible.posix.at:
    command: ls -d / >/dev/null
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
count:
    description:
    - The count of units in the future to execute the command or script file.
    type: int

state:
    choices:
    - absent
    - present
    default: present
    description:
    - The state dictates if the command or script file should be evaluated as present(added)
      or absent(deleted).
    type: str

units:
    choices:
    - minutes
    - hours
    - days
    - weeks
    description:
    - The type of units in the future to execute the command or script file.
    type: str

unique:
    default: false
    description:
    - If a matching job is present a new job will not be added.
    type: bool

command:
    description:
    - A command to be executed in the future.
    type: str

script_file:
    description:
    - An existing script file to be executed in the future.
    type: str