mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 05:31:22 -03:30
do not allow ansible connection type of local for ad_hoc
This commit is contained in:
parent
00afc87af1
commit
02e3f45422
@ -2139,6 +2139,9 @@ class RunAdHocCommand(BaseTask):
|
||||
args.append('-%s' % ('v' * min(5, ad_hoc_command.verbosity)))
|
||||
|
||||
if ad_hoc_command.extra_vars_dict:
|
||||
if ad_hoc_command.extra_vars_dict.get('ansible_connection') == 'local':
|
||||
raise ValueError(_("unable to use the `local` connection plugin with ad hoc commands"))
|
||||
|
||||
args.extend(['-e', json.dumps(ad_hoc_command.extra_vars_dict)])
|
||||
|
||||
args.extend(['-m', ad_hoc_command.module_name])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user