Bug 1737149

Summary: Support ansible.cfg files in user repositories
Product: Red Hat CloudForms Management Engine Reporter: Nick Carboni <ncarboni>
Component: ApplianceAssignee: dmetzger
Status: CLOSED DEFERRED QA Contact: Gaurav Talreja <gtalreja>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.11.0CC: abellott, dmetzger, gtalreja, mshriver, obarenbo
Target Milestone: GA   
Target Release: 5.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-17 17:23:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Ansible Target Upstream Version:
Embargoed:

Description Nick Carboni 2019-08-02 20:01:21 UTC
Description of problem:
If a user adds a git repository to be used with embedded ansible and it contains an ansible.cfg file we should use that file when running playbooks.


Version-Release number of selected component (if applicable): 5.11.0.17


Steps to Reproduce:
1. Add a repo with an ansible.cfg file that overrides some settings (like roles_path)
2. Run a playbook

Actual results:
Config settings from the repo file are not used.

Expected results:
Repo file config is used.

Additional info:
This is a core ansible feature. The priority for finding config files to use when running a playbook is described here https://docs.ansible.com/ansible/latest/reference_appendices/config.html#the-configuration-file

As a solution for this, we could ensure that our working directory is the one where the ansible.cfg exists when trying to run a playbook.

A word of warning for this though, we install the plugin-provided roles to a custom directory then set roles_path in /root/.ansible.cfg on the appliance.

If we put a user's ansible.cfg in front of ours in that priority list then those roles will be inaccessible for that playbook run. This behavior might be worth documenting.

This issue was originally raised in a comment here https://github.com/ManageIQ/manageiq/pull/19079#issuecomment-517392226

Comment 2 dmetzger 2020-07-17 17:23:35 UTC
A Github Issue has been open to track resolution of the reported defect. Moving to a Github Issue provides access to the larger ManageIQ community for assistance in resolving this defect.

Please refer to https://github.com/ManageIQ/manageiq-automation_engine/issues/447 for future updates regarding this issue.

Lifecycle page: https://access.redhat.com/support/policy/updates/cloudforms
Directional Update: https://access.redhat.com/articles/4639821
FAQ: https://access.redhat.com/articles/4647061

If you have any concerns about this, please let us know.

Thanks and regards!