RHCE study materials
RHCE study resources

RHCE: Installing and Configuring the Control Node

RHCE · Work through your exam, one topic at a time.

All guide sections

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:

  1. the file named by $ANSIBLE_CONFIG
  2. ./ansible.cfg in the current working directory
  3. ~/.ansible.cfg
  4. /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.