docs: fix ansible-playbook invocation to load ansible.cfg (PRODENG-3628) - #49
Closed
james-nesbitt wants to merge 1 commit into
Closed
docs: fix ansible-playbook invocation to load ansible.cfg (PRODENG-3628)#49james-nesbitt wants to merge 1 commit into
james-nesbitt wants to merge 1 commit into
Conversation
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
marked this pull request as ready for review
August 5, 2026 14:56
james-nesbitt
requested review from
alex-shl,
Copilot,
nekwar and
sgajlekar-spec
and removed request for
alex-shl
August 5, 2026 14:56
Contributor
There was a problem hiding this comment.
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-playbookinvocation to run fromansible/soansible.cfgis 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. |
Contributor
Author
|
#48 contains the same fix, and will likely take precedence over this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem observed
Running the documented step 4 command exactly as written —
ansible-playbook -i <path-to-your-inventory> ansible/mke-install-playbook.ymlfrom the bootc-mke3 checkout root — silently skips
ansible/ansible.cfg.Ansible only auto-loads
ansible.cfgfrom the current working directory,$ANSIBLE_CONFIG, or the user's home directory, never from the playbook'sown 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-testskill (bootc-mke3 source build MCR29.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.mdstep 4 tocd ansible && ansible-playbook -i <path-to-your-inventory> mke-install-playbook.ymlso
ansible.cfgactually loads, plus one sentence explaining why (so afuture editor doesn't silently revert it) and a note that
<path-to-your-inventory>must now be absolute or relative toansible/since the working directory changed.
I picked the
cd ansible &&prefix over exportingANSIBLE_CONFIGinline because it matches how every other relative path in this doc
(
vars/common-vars.yml,vars/mke-creds.yml, etc.) is already expressedrelative to
ansible/, and it doesn't require introducing an env var thereader 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