diff --git a/examples/plugin_filters.yml b/examples/plugin_filters.yml index b089a4d1f89..4495676a4a9 100644 --- a/examples/plugin_filters.yml +++ b/examples/plugin_filters.yml @@ -1,6 +1,6 @@ --- filter_version: '1.0' -module_blacklist: - # List the modules to blacklist here +module_rejectlist: + # List the modules to reject here #- easy_install #- s3 diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py index d09138b12f3..9d1a72694c2 100644 --- a/lib/ansible/plugins/loader.py +++ b/lib/ansible/plugins/loader.py @@ -1385,14 +1385,21 @@ def _load_plugin_filter(): version = to_text(version) version = version.strip() + # Modules and action plugins share the same reject list since the difference between the + # two isn't visible to the users if version == u'1.0': - # Modules and action plugins share the same blacklist since the difference between the - # two isn't visible to the users + + if 'module_blacklist' in filter_data: + display.deprecated("'module_blacklist' is being removed in favor of 'module_rejectlist'", version='2.18') + if 'module_rejectlist' not in filter_data: + filter_data['module_rejectlist'] = filter_data['module_blacklist'] + del filter_data['module_blacklist'] + try: - filters['ansible.modules'] = frozenset(filter_data['module_blacklist']) + filters['ansible.modules'] = frozenset(filter_data['module_rejectlist']) except TypeError: display.warning(u'Unable to parse the plugin filter file {0} as' - u' module_blacklist is not a list.' + u' module_rejectlist is not a list.' u' Skipping.'.format(filter_cfg)) return filters filters['ansible.plugins.action'] = filters['ansible.modules'] @@ -1404,11 +1411,11 @@ def _load_plugin_filter(): display.warning(u'The plugin filter file, {0} does not exist.' u' Skipping.'.format(filter_cfg)) - # Specialcase the stat module as Ansible can run very few things if stat is blacklisted. + # Specialcase the stat module as Ansible can run very few things if stat is rejected if 'stat' in filters['ansible.modules']: - raise AnsibleError('The stat module was specified in the module blacklist file, {0}, but' + raise AnsibleError('The stat module was specified in the module reject list file, {0}, but' ' Ansible will not function without the stat module. Please remove stat' - ' from the blacklist.'.format(to_native(filter_cfg))) + ' from the reject list.'.format(to_native(filter_cfg))) return filters diff --git a/test/integration/targets/plugin_filtering/filter_lookup.yml b/test/integration/targets/plugin_filtering/filter_lookup.yml index 694ebfcb729..5f183e9f1a0 100644 --- a/test/integration/targets/plugin_filtering/filter_lookup.yml +++ b/test/integration/targets/plugin_filtering/filter_lookup.yml @@ -1,6 +1,6 @@ --- filter_version: 1.0 -module_blacklist: +module_rejectlist: # Specify the name of a lookup plugin here. This should have no effect as # this is only for filtering modules - list diff --git a/test/integration/targets/plugin_filtering/filter_modules.yml b/test/integration/targets/plugin_filtering/filter_modules.yml index 6cffa67614d..bef7d6d8099 100644 --- a/test/integration/targets/plugin_filtering/filter_modules.yml +++ b/test/integration/targets/plugin_filtering/filter_modules.yml @@ -1,6 +1,6 @@ --- filter_version: 1.0 -module_blacklist: +module_rejectlist: # A pure action plugin - pause # A hybrid action plugin with module diff --git a/test/integration/targets/plugin_filtering/filter_ping.yml b/test/integration/targets/plugin_filtering/filter_ping.yml index 08e56f24397..8604716e911 100644 --- a/test/integration/targets/plugin_filtering/filter_ping.yml +++ b/test/integration/targets/plugin_filtering/filter_ping.yml @@ -1,5 +1,5 @@ --- filter_version: 1.0 -module_blacklist: +module_rejectlist: # Ping is special - ping diff --git a/test/integration/targets/plugin_filtering/filter_stat.yml b/test/integration/targets/plugin_filtering/filter_stat.yml index c1ce42efd71..132bf03f31c 100644 --- a/test/integration/targets/plugin_filtering/filter_stat.yml +++ b/test/integration/targets/plugin_filtering/filter_stat.yml @@ -1,5 +1,5 @@ --- filter_version: 1.0 -module_blacklist: +module_rejectlist: # Stat is special - stat diff --git a/test/integration/targets/plugin_filtering/no_blacklist_module.ini b/test/integration/targets/plugin_filtering/no_blacklist_module.ini deleted file mode 100644 index 65b51d67121..00000000000 --- a/test/integration/targets/plugin_filtering/no_blacklist_module.ini +++ /dev/null @@ -1,3 +0,0 @@ -[defaults] -retry_files_enabled = False -plugin_filters_cfg = ./no_blacklist_module.yml diff --git a/test/integration/targets/plugin_filtering/no_blacklist_module.yml b/test/integration/targets/plugin_filtering/no_rejectlist_module.yml similarity index 55% rename from test/integration/targets/plugin_filtering/no_blacklist_module.yml rename to test/integration/targets/plugin_filtering/no_rejectlist_module.yml index 52a55dff3c4..91e60a1fcd8 100644 --- a/test/integration/targets/plugin_filtering/no_blacklist_module.yml +++ b/test/integration/targets/plugin_filtering/no_rejectlist_module.yml @@ -1,3 +1,3 @@ --- filter_version: 1.0 -module_blacklist: +module_rejectlist: diff --git a/test/integration/targets/plugin_filtering/runme.sh b/test/integration/targets/plugin_filtering/runme.sh index aa0e2b0c2aa..03d78abc618 100755 --- a/test/integration/targets/plugin_filtering/runme.sh +++ b/test/integration/targets/plugin_filtering/runme.sh @@ -22,11 +22,11 @@ if test $? != 0 ; then fi # -# Check that if no modules are blacklisted then Ansible should not through traceback +# Check that if no modules are rejected then Ansible should not through traceback # -ANSIBLE_CONFIG=no_blacklist_module.ini ansible-playbook tempfile.yml -i ../../inventory -vvv "$@" +ANSIBLE_CONFIG=no_rejectlist_module.ini ansible-playbook tempfile.yml -i ../../inventory -vvv "$@" if test $? != 0 ; then - echo "### Failed to run tempfile with no modules blacklisted" + echo "### Failed to run tempfile with no modules rejected" exit 1 fi @@ -87,7 +87,7 @@ fi ANSIBLE_CONFIG=filter_lookup.ini ansible-playbook lookup.yml -i ../../inventory -vvv "$@" if test $? != 0 ; then - echo "### Failed to use a lookup plugin when it is incorrectly specified in the *module* blacklist" + echo "### Failed to use a lookup plugin when it is incorrectly specified in the *module* reject list" exit 1 fi @@ -107,10 +107,10 @@ ANSIBLE_CONFIG=filter_stat.ini export ANSIBLE_CONFIG CAPTURE=$(ansible-playbook copy.yml -i ../../inventory -vvv "$@" 2>&1) if test $? = 0 ; then - echo "### Copy ran even though stat is in the module blacklist" + echo "### Copy ran even though stat is in the module reject list" exit 1 else - echo "$CAPTURE" | grep 'The stat module was specified in the module blacklist file,.*, but Ansible will not function without the stat module. Please remove stat from the blacklist.' + echo "$CAPTURE" | grep 'The stat module was specified in the module reject list file,.*, but Ansible will not function without the stat module. Please remove stat from the reject list.' if test $? != 0 ; then echo "### Stat did not give us our custom error message" exit 1 @@ -124,10 +124,10 @@ ANSIBLE_CONFIG=filter_stat.ini export ANSIBLE_CONFIG CAPTURE=$(ansible-playbook stat.yml -i ../../inventory -vvv "$@" 2>&1) if test $? = 0 ; then - echo "### Stat ran even though it is in the module blacklist" + echo "### Stat ran even though it is in the module reject list" exit 1 else - echo "$CAPTURE" | grep 'The stat module was specified in the module blacklist file,.*, but Ansible will not function without the stat module. Please remove stat from the blacklist.' + echo "$CAPTURE" | grep 'The stat module was specified in the module reject list file,.*, but Ansible will not function without the stat module. Please remove stat from the reject list.' if test $? != 0 ; then echo "### Stat did not give us our custom error message" exit 1