Installing and Configuring the Control Node
Installation
On RHEL, dnf install ansible-core provides ansible, ansible-playbook, ansible-galaxy, ansible-doc, ansible-vault, ansible-inventory and ansible-config. Extra content (collections such as ansible.posix or redhat.rhel_system_roles, and community roles) is installed separately with ansible-galaxy collection install -r requirements.yml or ansible-galaxy role install.
Configuration precedence
ansible.cfg is found in a strict order, first match wins, with no merging:
- the file named by
$ANSIBLE_CONFIG ./ansible.cfgin the current working directory~/.ansible.cfg/etc/ansible/ansible.cfg
ansible --version prints the active config file and the collection search path - that is the fastest way to diagnose "my settings are ignored". ansible-config dump --only-changed shows every non-default setting and ansible-config view prints the active file. Relative paths inside ansible.cfg (for inventory, roles_path, collections_path) are resolved relative to the directory containing the config file, which is a classic trap when you keep the config one level up.
Common [defaults] keys: inventory, remote_user, host_key_checking, forks, stdout_callback, log_path. Privilege escalation lives in [privilege_escalation]: become=True, become_method=sudo, become_user=root, become_ask_pass. Secrets belong in ansible-vault-encrypted files or a vault password file referenced with --vault-id.
Rule of thumb
Keep ansible.cfg in the project directory, and always run playbooks from that directory so precedence resolves to your file instead of /etc/ansible/ansible.cfg.