ansible.cfg
Ansible's INI-format settings file; a copy in the project directory sets options such as the inventory location and forks for everyone who runs there.
In more detail
Ansible checks, in order, the ANSIBLE_CONFIG environment variable, ansible.cfg in the current directory, ~/.ansible.cfg and /etc/ansible/ansible.cfg, and uses the first it finds. Keeping settings in a reviewed project file beats every engineer remembering the same flags. Most options sit under the [defaults] section.
Example
[defaults]
inventory = inventory
forks = 10Related terms
- INI — A simple text file format of [section] headings followed by key=value lines.
- inventory — The list of hosts Ansible may manage, arranged into groups and optionally carrying variables for each host or group.
- forks — The setting for how many hosts Ansible works on at the same time, using that many parallel worker processes on the control node.
- host key checking — SSH's check that a server's identity key matches the one recorded the first time you connected, protecting you from impostor servers.
- retry file — A file Ansible can write after a failed run listing the hosts that failed, so you can rerun against just those.
Taught in
- Ansible Architecture And The Control Node — Ansible Configuration Management at Scale
- Performance, Forks And Best Practices — Ansible Configuration Management at Scale
- Graded On A Machine You Never Touched — RHCE in Ansible (EX294): Automate Red Hat Systems
- Exam Strategy: The First Fifteen Minutes And ansible-doc — RHCE in Ansible (EX294): Automate Red Hat Systems
- Static Inventories: Hosts, Groups And Groups Of Groups — RHCE in Ansible (EX294): Automate Red Hat Systems
- ansible.cfg: Which File Wins, And The Settings That Matter — RHCE in Ansible (EX294): Automate Red Hat Systems
- Privilege Escalation: sudo Rules And become — RHCE in Ansible (EX294): Automate Red Hat Systems
- Facts And Magic Variables: Let Each Node Describe Itself — RHCE in Ansible (EX294): Automate Red Hat Systems
- Finding Modules In Collections: ansible-doc And navigator — RHCE in Ansible (EX294): Automate Red Hat Systems
- Git And VS Code: Clone, Commit, Push, And The Dev Container — RHCE in Ansible (EX294): Automate Red Hat Systems
- RHEL System Roles: timesync And selinux From A Collection — RHCE in Ansible (EX294): Automate Red Hat Systems
- Ansible Vault: Secrets Encrypted, Runs Without A Prompt — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: People, Passwords And sudo From The Vault — RHCE in Ansible (EX294): Automate Red Hat Systems
- Mock Exam, Part 1: Seven Tasks Across Three Sections — RHCE in Ansible (EX294): Automate Red Hat Systems