|
|
@ -198,6 +198,12 @@ class ModuleArgsParser:
|
|
|
|
delegate_to = None
|
|
|
|
delegate_to = None
|
|
|
|
args = dict()
|
|
|
|
args = dict()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# We can have one of action, local_action, or module specified
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# action
|
|
|
|
if 'action' in ds:
|
|
|
|
if 'action' in ds:
|
|
|
|
|
|
|
|
|
|
|
|
# an old school 'action' statement
|
|
|
|
# an old school 'action' statement
|
|
|
@ -205,7 +211,8 @@ class ModuleArgsParser:
|
|
|
|
delegate_to = None
|
|
|
|
delegate_to = None
|
|
|
|
action, args = self._normalize_parameters(thing)
|
|
|
|
action, args = self._normalize_parameters(thing)
|
|
|
|
|
|
|
|
|
|
|
|
elif 'local_action' in ds:
|
|
|
|
# local_action
|
|
|
|
|
|
|
|
if 'local_action' in ds:
|
|
|
|
|
|
|
|
|
|
|
|
# local_action is similar but also implies a delegate_to
|
|
|
|
# local_action is similar but also implies a delegate_to
|
|
|
|
if action is not None:
|
|
|
|
if action is not None:
|
|
|
@ -214,21 +221,17 @@ class ModuleArgsParser:
|
|
|
|
delegate_to = 'localhost'
|
|
|
|
delegate_to = 'localhost'
|
|
|
|
action, args = self._normalize_parameters(thing)
|
|
|
|
action, args = self._normalize_parameters(thing)
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
# module: <stuff> is the more new-style invocation
|
|
|
|
|
|
|
|
|
|
|
|
# module: <stuff> is the more new-style invocation
|
|
|
|
# walk the input dictionary to see we recognize a module name
|
|
|
|
if action is not None:
|
|
|
|
for (item, value) in iteritems(ds):
|
|
|
|
raise AnsibleParserError("conflicting action statements", obj=self._task)
|
|
|
|
if item in module_finder:
|
|
|
|
|
|
|
|
# finding more than one module name is a problem
|
|
|
|
# walk the input dictionary to see we recognize a module name
|
|
|
|
if action is not None:
|
|
|
|
for (item, value) in iteritems(ds):
|
|
|
|
raise AnsibleParserError("conflicting action statements", obj=self._task)
|
|
|
|
if item in module_finder:
|
|
|
|
action = item
|
|
|
|
# finding more than one module name is a problem
|
|
|
|
thing = value
|
|
|
|
if action is not None:
|
|
|
|
action, args = self._normalize_parameters(value, action=action)
|
|
|
|
raise AnsibleParserError("conflicting action statements", obj=self._task)
|
|
|
|
|
|
|
|
action = item
|
|
|
|
|
|
|
|
thing = value
|
|
|
|
|
|
|
|
action, args = self._normalize_parameters(value, action=action)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if we didn't see any module in the task at all, it's not a task really
|
|
|
|
# if we didn't see any module in the task at all, it's not a task really
|
|
|
|
if action is None:
|
|
|
|
if action is None:
|
|
|
|