Run batch file in windows using indispensable

I want to run the run.bat file present in my remote node windows using my node control (CentOS). Is it possible? If not, is there an alternative?

+5
source share
3 answers

Take a look at this section of Windows Support

So, you want to create a task that looks something like this:

- name: run simple script
  script: run.bat
+8
source

This bat file must be inside the local system. How can I launch a bat from a remote machine? My requirement: I need to download MSI from the network and deploy it to the remote and run it using a batch file.

0

Save the script (batch file) to the management server. Ansible copies the script to the remote host and then runs it there. See the example below - it is assumed that the file is run.batstored in run.bat /tmp(not recommended) on your management server.

- name: execute batch
  script: /tmp/run.bat
0
source

Source: https://habr.com/ru/post/1608937/


All Articles