Win_Task module doesn't seem to work with module.run state.
Here's an example of a state:
someId:
module.run:
- name: task.create_task
- m_name: 'TaskName'
- user_name: System
- action_type: Execute
- cmd: 'cmd /c C:\\some.bat'
- trigger_enabled: True
- trigger_type: Once
- start_date: 2016-12-1
- start_time: 01:00
- repeat_interval: '10 minutes'
The state run fails. Get message about incorrect argument or parameter. The same data passed via the CLI works.
Salt Version:
Salt: 2016.11.3
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.5 (default, Nov 6 2016, 00:28:07)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: centos 7.3.1611 Core
machine: x86_64
release: 3.10.0-514.el7.x86_64
system: Linux
version: CentOS Linux 7.3.1611 Core
ZD 1330
Do you guys have any estimate on when this will be fixed?
Just ran into this issue again :/
You need to put your start time in quotes.
Hi @twangboy ,
thx for your answer. Sadly though, that doesn't work for me:
someId:
module.run:
- name: task.create_task
- m_name: 'TaskName'
- user_name: System
- action_type: Execute
- cmd: 'del /Q /S C:\\Temp'
- trigger_type: Once
- start_date: 2017-12-12
- start_time: "01:00"
- repeat_interval: '10 minutes'
leads to:
root@salt:~# salt 'MINION01MS001' state.apply core.tasks.installed
MINION01MS001:
----------
ID: someId
Function: module.run
Name: task.create_task
Result: False
Comment: Module function task.create_task executed
Started: 00:10:39.002000
Duration: 15.0 ms
Changes:
----------
ret:
False
Summary for MINION01MS001
------------
Succeeded: 0 (changed=1)
Failed: 1
The same happens when I put the start time in single quotes.
Do you have any other ideas @twangboy
I have it on my "todo" list
As a workaround I use this:
create_nsclient_task:
module.run:
- name: cmd.run
- cmd: 'C:/Windows/System32/schtasks.exe /create /tn UpdateNSClientAtBoot /tr C:\scripts\sched_tasks\update_nsclient.ps1 /sc ONSTART /ru {{ user }} /rp {{ password }}'
Hi guys,
I am still seeing this issue in Salt 2018.3.3.. is there an ETA for the fix?
thanks a lot,
Marius
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Thank you for updating this issue. It is no longer marked as stale.
ZD ticket is closed removing label
Most helpful comment
As a workaround I use this: