2

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 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.