Dynamic role include (#17401)

* dynamic role_include

* more fixes for dynamic include roles

* set play yfrom iterator when dynamic

* changes from jimi-c

* avoid modules that break ad hoc

TODO: should really be a config
This commit is contained in:
Brian Coca 2016-09-05 20:07:58 -04:00 committed by GitHub
commit ff34f5548d
9 changed files with 148 additions and 49 deletions

View file

@ -155,6 +155,10 @@ class AdHocCLI(CLI):
err = err + ' (did you mean to run ansible-playbook?)'
raise AnsibleOptionsError(err)
# Avoid modules that don't work with ad-hoc
if self.options.module_name in ('include', 'include_role'):
raise AnsibleOptionsError("'%s' is not a valid action for ad-hoc commands" % self.options.module_name)
# dynamically load any plugins from the playbook directory
for name, obj in get_all_plugin_loaders():
if obj.subdir: