Skip to content

docs: fix ansible-playbook invocation to load ansible.cfg (PRODENG-3628) - #49

Closed
james-nesbitt wants to merge 1 commit into
mainfrom
PRODENG-3628-ansible-cfg-doc
Closed

docs: fix ansible-playbook invocation to load ansible.cfg (PRODENG-3628)#49
james-nesbitt wants to merge 1 commit into
mainfrom
PRODENG-3628-ansible-cfg-doc

Conversation

@james-nesbitt

Copy link
Copy Markdown
Contributor

Problem observed

Running the documented step 4 command exactly as written —
ansible-playbook -i <path-to-your-inventory> ansible/mke-install-playbook.yml
from the bootc-mke3 checkout root — silently skips ansible/ansible.cfg.
Ansible only auto-loads ansible.cfg from the current working directory,
$ANSIBLE_CONFIG, or the user's home directory, never from the playbook's
own directory. As a result host_key_checking = false (set in that cfg)
never applies, and the very first task run against a fresh host fails
non-interactively with ssh_askpass: exec(...) / Host key verification failed (no TTY available to prompt interactively, so it's a hard failure,
not a warning). Reproduced deterministically on 3 fresh EC2 managers while
running the bootc-e2e-test skill (bootc-mke3 source build MCR
29.4.1/MKE 3.9.4/Rocky 9.8, account 533267045383, us-east-2, 2026-08-05).

Change

Updated docs/installation-guide/install-bootc-mke3.md step 4 to
cd ansible && ansible-playbook -i <path-to-your-inventory> mke-install-playbook.yml
so ansible.cfg actually loads, plus one sentence explaining why (so a
future editor doesn't silently revert it) and a note that
<path-to-your-inventory> must now be absolute or relative to ansible/
since the working directory changed.

I picked the cd ansible && prefix over exporting ANSIBLE_CONFIG
inline because it matches how every other relative path in this doc
(vars/common-vars.yml, vars/mke-creds.yml, etc.) is already expressed
relative to ansible/, and it doesn't require introducing an env var the
reader has to remember to unset afterwards.

Diff is scoped to this one Procedure step; no other doc sections touched.

Ref: PRODENG-3628

Written by AI: claude-sonnet-5

The documented step 4 command ran ansible-playbook from the checkout
root with a path to the playbook inside ansible/. Ansible only
auto-loads ansible.cfg from the current working directory (or
$ANSIBLE_CONFIG / home dir), never from the playbook's own directory,
so ansible/ansible.cfg (host_key_checking = false, etc.) was silently
skipped. Against a fresh host with no known_hosts entry and no TTY to
prompt interactively, this produced a hard, non-interactive failure
(ssh_askpass / Host key verification failed) on the very first task.
Reproduced deterministically on 3 fresh EC2 managers.

Change the documented command to cd into ansible/ first so
ansible.cfg loads as intended, and call out that the inventory path
must now be absolute or relative to ansible/.

Written by AI: claude-sonnet-5
@james-nesbitt
james-nesbitt marked this pull request as ready for review August 5, 2026 14:56
@james-nesbitt
james-nesbitt requested review from alex-shl, Copilot, nekwar and sgajlekar-spec and removed request for alex-shl August 5, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the installation guide to ensure Ansible loads the repository’s ansible/ansible.cfg by running the playbook from the ansible/ directory, preventing non-interactive SSH host key verification failures during first contact with fresh hosts.

Changes:

  • Adjusted the documented ansible-playbook invocation to run from ansible/ so ansible.cfg is auto-loaded.
  • Added explanation of Ansible config auto-discovery and the resulting host key verification failure mode.
  • Noted that the inventory path must now be absolute (or relative to ansible/) due to the working directory change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

2. To override any default values, specify the desired values in the `vars/common-vars.yml` and `vars/mke-creds.yml` files
3. Optionally: You can set the MCR and MKE licenses via the `mcr_license` and `mke_license` variables respectively.
4. Run ansible: `ansible-playbook -i <path-to-your-inventory> ansible/mke-install-playbook.yml`
4. Run ansible from the `ansible/` directory: `cd ansible && ansible-playbook -i <path-to-your-inventory> mke-install-playbook.yml`. Ansible only auto-loads `ansible.cfg` (which sets `host_key_checking = false`, among other defaults) from the current working directory, so running the playbook from the checkout root instead silently skips it and the first SSH connection to a fresh host fails with a non-interactive host key verification error. Use an absolute path for `<path-to-your-inventory>` (or one relative to `ansible/`) since the working directory has changed.
2. To override any default values, specify the desired values in the `vars/common-vars.yml` and `vars/mke-creds.yml` files
3. Optionally: You can set the MCR and MKE licenses via the `mcr_license` and `mke_license` variables respectively.
4. Run ansible: `ansible-playbook -i <path-to-your-inventory> ansible/mke-install-playbook.yml`
4. Run ansible from the `ansible/` directory: `cd ansible && ansible-playbook -i <path-to-your-inventory> mke-install-playbook.yml`. Ansible only auto-loads `ansible.cfg` (which sets `host_key_checking = false`, among other defaults) from the current working directory, so running the playbook from the checkout root instead silently skips it and the first SSH connection to a fresh host fails with a non-interactive host key verification error. Use an absolute path for `<path-to-your-inventory>` (or one relative to `ansible/`) since the working directory has changed.
@james-nesbitt

Copy link
Copy Markdown
Contributor Author

#48 contains the same fix, and will likely take precedence over this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants