diff --git a/changelogs/fragments/help_paths_fixes.yml b/changelogs/fragments/help_paths_fixes.yml new file mode 100644 index 0000000000..a14d89e7b5 --- /dev/null +++ b/changelogs/fragments/help_paths_fixes.yml @@ -0,0 +1,3 @@ +bugfixes: + - re-fix CLI help for module path, previous fix which was lost in parser switch + - Clarify roles path target behaviour for ansible-galaxy diff --git a/lib/ansible/cli/arguments/option_helpers.py b/lib/ansible/cli/arguments/option_helpers.py index 46b7117185..334a854232 100644 --- a/lib/ansible/cli/arguments/option_helpers.py +++ b/lib/ansible/cli/arguments/option_helpers.py @@ -282,8 +282,9 @@ def add_meta_options(parser): def add_module_options(parser): """Add options for commands that load modules""" + module_path = C.config.get_configuration_definition('DEFAULT_MODULE_PATH').get('default', '') parser.add_argument('-M', '--module-path', dest='module_path', default=None, - help="prepend colon-separated path(s) to module library (default=%s)" % C.DEFAULT_MODULE_PATH, + help="prepend colon-separated path(s) to module library (default=%s)" % module_path, type=unfrack_path(pathsep=True), action=PrependListAction) diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index cf29618d40..6d8f9ee90a 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -63,11 +63,12 @@ class GalaxyCLI(CLI): offline.add_argument('--offline', dest='offline', default=False, action='store_true', help="Don't query the galaxy API when creating roles") + default_roles_path = C.config.get_configuration_definition('DEFAULT_ROLES_PATH').get('default', '') roles_path = opt_help.argparse.ArgumentParser(add_help=False) roles_path.add_argument('-p', '--roles-path', dest='roles_path', type=opt_help.unfrack_path(pathsep=True), default=C.DEFAULT_ROLES_PATH, action=opt_help.PrependListAction, - help='The path to the directory containing your roles. The default is the roles_path ' - 'configured in your ansible.cfg file (/etc/ansible/roles if not configured)') + help='The path to the directory containing your roles. The default is the first writable one' + 'configured via DEFAULT_ROLES_PATH: %s ' % default_roles_path) force = opt_help.argparse.ArgumentParser(add_help=False) force.add_argument('-f', '--force', dest='force', action='store_true', default=False, help='Force overwriting an existing role')