1
votes

I am converting my linux ansible scripts into windows. There is a module named "script" is available which is running local script to remote target machine. But there is no equvalent win_script module is present. When i used win_shell module it was expecting the file to be in remote machine.

- name: Create a filesystem and perform IO operation using powershell script
  win_shell: "{{pshfile}} {{disc_ip}} {{storage_array_vol}} {{file1}}"

Is there any way to run local powershell script into remote machine via ansible?

1

1 Answers

2
votes

Copy the script first to the target node, then execute it. https://docs.ansible.com/ansible/latest/modules/win_copy_module.html