variable passing in win_shell module with powershell command

Hi All,

I am using win_shell module in playbook to execute a PowerShell script.
while execution of script it will prompt and ask for a domain and username
below is the synatx i am using need help on the variable part declartion.

  • name: Executing script on endpoint

ansible.windows.win_shell: .\winrm_configuration_wizardv3.0.ps1 -user {{ domain }}{{ username }} -unencrypted -http_port 5985 -max_requests 1000 -silent

args:

chdir: C:\Temp\

become_method: runas

become_user: Administrator

Regards
Kundan SIngh

That will not work. Use custom credentials with variable options to achieve what you are after

OK I reread this. Where are you having problems? The variables are set correctly? In this case you will just pass in the variables from the job template or where ever you have placed the vars