DEBOPS.ATD(5)

NAME
debops.atd - Manage at and batch commands using Ansible

SYNOPSIS

debops service/atd [--limit group,host,...] [--diff] [--check] [--tags tag1,tag2,...] [--skip-tags tag1,tag2,...] [<ansible-playbook options>] ...

DESCRIPTION

The at and batch commands can be used to compliment cron and run one-off tasks either at a specified time, or when the host CPU utilization is on a low enough level.

The debops.atd role can be used to configure the atd service, including randomized load average threshold and randomized time between batch job execution, as well as access control to the at and batch commands by the users.

GETTING STARTED

  Initial configuration

debops.atd will install the at Debian package which provides the atd service as well as commands that allow you to schedule jobs at a specific time or when the host CPU load average is below a specific threshold.

By default the interval of the batch command checking if jobs can be run, as well as the level of CPU utilization which halts job scheduling are somewhat randomized to "smooth out" CPU utilization on hosts with multiple virtual machines and/or containers. See the default variables for the minimum and maximum values for each.

After installation, the role creates a /etc/at.allow file which only enables the use of the at and batch commands by the Ansible admin account (superuser has implicit access). You can either add specific users to this list by using atd_*_allow list variables, or enable access by all users not listed in /etc/at.deny by defining atd_default_allow as empty list ([]).

  Example inventory

debops.atd is included by default in the common.yml DebOps playbook; you don't need to do anything to have it installed.

If you want to disable the atd service on a host or set of hosts, you can do this by the setting variable:

atd_enabled: False

in Ansible's inventory.

  Example playbook

Here's an example playbook that can be used to enable and manage the atd service on a set of hosts:

---
- name: Configure atd service
  hosts: debops_atd
  become: True
  roles:
    - role: debops.atd
      tags: [ 'role::atd' ]

  Ansible tags

You can use Ansible --tags or --skip-tags parameters to limit what tasks are performed during Ansible run. This can be used after the host is first configured to speed up playbook execution, when you are sure that most of the configuration has not been changed.

Available role tags:

role::atd
    Main role tag, should be used in the playbook to execute all of the role tasks.

role::atd:users
    Configure contents of /etc/at.allow` and /etc/at.deny configuration files.

AUTHOR
Maciej Delmanowski

COPYRIGHT
2014-2022, Maciej Delmanowski, Nick Janetakis, Robin Schneider and others