Skip to content

ansible.cfg lookup paths for ansible-playbook #11175

Description

@tkellen
ISSUE TYPE

Feature Idea

COMPONENT NAME

ansible.cfg

ANSIBLE VERSION

N/A

SUMMARY

Would ya'll be open to a PR that adds a new location for finding ansible.cfg?
I would like for ansible-playbook to search sibling to the playbook being used. I think it should be possible to run ansible-playbook from any directory without modifying global or per-user configuration files and have customized ansible.cfg settings respected.
I'm proposing a lookup precedence of:

  • ANSIBLE_CONFIG (an environment variable)
  • ansible.cfg (in the current directory)
  • ansible.cfg (sibling to the playbook when ansible-playbook is used)
  • .ansible.cfg (in the home directory)\n- /etc/ansible/ansible.cfg
    I understand this wouldn't make sense for the ansible command, but I'm hopeful that isn't considered an issue."

Metadata

Metadata

Assignees

Labels

featureThis issue/PR relates to a feature request.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions