Skip to content

Ansible configuration

  1. ansible.cfg in the current directory
  2. ANSIBLE_CONFIG environment var
# Provides also current config file in use
ansible --version

Example ansible.cfg

[defualts]
inventory = ./myInventoru
remote_user: devovs
collections_paths = ./collections/
collbacks_enabled: ansible.posix.profile_roles

Error Message Readability

Improve error message readability

# file: ansible.cfg
# stdout_callback = debug
# or
# stdout_callback = error

Profiling Tasks Executions

# ansible.cfg
[defaults]
CALLBACKS_ENABLED=ansible.posix.profile_tasks
# Output:
# oTASKS RECAP ***************************************************************************************************************************************************
# Friday 04 April 2025  01:15:58 +0200 (0:00:00.006)       0:00:00.050 **********
# ===============================================================================
# Debug Task 1 ------------------------------------------------------------------------------------------------------------------------------------------- 0.01s
# Debug Task 2 ------------------------------------------------------------------------------------------------------------------------------------------- 0.01s
# Debug Task 4 ------------------------------------------------------------------------------------------------------------------------------------------- 0.01s
# Debug Task 3 ------------------------------------------------------------------------------------------------------------------------------------------- 0.01s