arillso.system.ansible role – Configure Ansible automation with systemd timer

Note

This role is part of the arillso.system collection (version 1.0.5).

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 arillso.system.

To use it in a playbook, specify: arillso.system.ansible.

Entry point main – Configure Ansible automation with systemd timer

Synopsis

  • Installs and configures Ansible for automated execution using systemd timers

  • Supports both ansible-pull and ansible-playbook modes

  • Handles SSH key generation for Git repository access

  • Configures OpenTelemetry integration for observability

Parameters

Parameter

Comments

ansible_branch

string

Git branch to checkout

Default: "main"

ansible_checkout_dir

string

Directory where repository will be checked out

Default: "/var/lib/ansible-automation"

ansible_environment

dictionary

Additional environment variables for Ansible execution

Default: {}

ansible_extra_args

string

Additional arguments to pass to ansible-pull or ansible-playbook

Default: ""

ansible_host_limit

string

Limit execution to specific hosts

Default: "{{ inventory_hostname }}"

ansible_install_collections

boolean

Install collections from requirements.yml before playbook execution. Note: ansible-pull does NOT automatically install collections, so this ensures dependencies are available in both pull and playbook modes.

Choices:

  • false

  • true ← (default)

ansible_install_method

string

Installation method - ‘pipx’ or ‘package’

Choices:

  • "pipx" ← (default)

  • "package"

ansible_install_roles

boolean

Install roles from requirements.yml before playbook execution. Note: ansible-pull does NOT automatically install roles, so this ensures dependencies are available in both pull and playbook modes.

Choices:

  • false ← (default)

  • true

ansible_inventory

string

Inventory file path (relative to repository root)

Default: "inventory/hosts"

ansible_mode

string

Execution mode - ‘pull’ for ansible-pull or ‘playbook’ for ansible-playbook

Choices:

  • "pull" ← (default)

  • "playbook"

ansible_otel_enabled

boolean

Enable OpenTelemetry integration

Choices:

  • false ← (default)

  • true

ansible_otel_endpoint

string

OpenTelemetry collector endpoint

Default: "http://localhost:4318"

ansible_otel_environment

string

Deployment environment tag

Default: "production"

ansible_otel_service_name

string

Service name for OpenTelemetry traces

Default: "ansible.infrastructure"

ansible_package_version

string

Specific Ansible version to install (empty for latest)

Default: ""

ansible_pipx_inject_packages

list / elements=string

Additional Python packages to inject into ansible pipx environment (e.g., kubernetes, boto3, pywinrm)

Default: []

ansible_playbook

string

Playbook file to execute (relative to repository root)

Default: "site.yml"

ansible_random_delay

integer

Maximum random delay in seconds before execution

Default: 300

ansible_repo

string / required

Git repository URL (SSH or HTTPS)

ansible_requirements_file

string

Path to requirements file (relative to repository root)

Default: "requirements.yml"

ansible_schedule

string

Systemd timer schedule (OnCalendar format)

Default: "*:0/15"

ansible_service_enabled

boolean

Enable the systemd timer

Choices:

  • false

  • true ← (default)

ansible_ssh_key_enabled

boolean

Generate SSH key for Git access

Choices:

  • false

  • true ← (default)

ansible_ssh_key_path

string

Path to SSH private key

Default: "/root/.ssh/ansible_automation"

ansible_ssh_key_prompt

boolean

Show prompt to add deploy key to Git repository

Choices:

  • false

  • true ← (default)

ansible_ssh_key_type

string

SSH key type

Default: "ed25519"

ansible_timer_state

string

State of the systemd timer (started/stopped)

Choices:

  • "started" ← (default)

  • "stopped"