Skip to content

Embedded Ansible - Add support for ansible.cfg files in user repositories #447

Open
@dmetzger57

Description

@dmetzger57

Original BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1737149

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 ManageIQ/manageiq#19079 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions