diff --git a/changelogs/fragments/65262_ansible_inventory.yml b/changelogs/fragments/65262_ansible_inventory.yml new file mode 100644 index 00000000000..bc2dd6c57d3 --- /dev/null +++ b/changelogs/fragments/65262_ansible_inventory.yml @@ -0,0 +1,2 @@ +bugfixes: +- Suppress warning when user directory used in --playbook-dir option with ansible-inventory command (https://github.com/ansible/ansible/issues/65262). diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py index 49b85e57ace..755be2ffb8b 100644 --- a/lib/ansible/plugins/loader.py +++ b/lib/ansible/plugins/loader.py @@ -61,7 +61,7 @@ def get_all_plugin_loaders(): def add_all_plugin_dirs(path): ''' add any existing plugin dirs in the path provided ''' - b_path = to_bytes(path, errors='surrogate_or_strict') + b_path = os.path.expanduser(to_bytes(path, errors='surrogate_or_strict')) if os.path.isdir(b_path): for name, obj in get_all_plugin_loaders(): if obj.subdir: