I am using win_shell module to execute a command op remote host. But ansible is not setting the value the right way (or me of course)
I set a variable that enable or disable scheduled tasks based on user input in Ansible Tower
tasks:
- name: disable enable tasks without ebs based on user input
win_shell: '"{{ command_to_execute }}" -TaskName "{{ task_name }}"'
the user input in Ansible tower:
- command_to_execute: Enable-ScheduledTask
or
- command_to_execute: Disable-ScheduledTask
The job succeded but not enabeling or disableing anything. in the output i can see that:
"cmd": "\"[u'Enable-ScheduledTask']\" -TaskName
\"start_something\"",
so instead of
Enable-ScheduledTask
i get
[u'Enable-ScheduledTask'] .
Why is that?