diff --git a/lib/ansible/plugins/action/template.py b/lib/ansible/plugins/action/template.py index d134f80a8d..d8339e57b9 100644 --- a/lib/ansible/plugins/action/template.py +++ b/lib/ansible/plugins/action/template.py @@ -63,8 +63,13 @@ class ActionModule(ActionBase): dest = self._task.args.get('dest', None) faf = self._task.first_available_file force = boolean(self._task.args.get('force', True)) + state = self._task.args.get('state', None) - if (source is None and faf is not None) or dest is None: + if state is not None: + result['failed'] = True + result['msg'] = "'state' cannot be specified on a template" + return result + elif (source is None and faf is not None) or dest is None: result['failed'] = True result['msg'] = "src and dest are required" return result