Hi Alex. Thanks for your video. If you'd like, I'd like to ask a few questions. I am working on an automation. The server on which AWX is installed is a linux server. Can I connect to a windows server via AWX and run a powershell script? and does awx use the tcp5985 port when doing this? So, does the command actually run on the linux server or does it connect from the relevant port and run remotely on my windows server? Is the ansible.windows module sufficient for this process? Or do I need to use the community module?
@Automationtoolsinfrastructure3 жыл бұрын
Hi, Kerem. 1. Can I connect to a windows server via AWX and run a powershell script? Yes, Sure. You can manage windows servers via AWX through WinRM. 2. Does awx use the tcp5985 port when doing this? Yes, It use WinRM http protocol on tcp 5985 port or safe SSL port 5986. 3.So, does the command actually run on the linux server or does it connect from the relevant port and run remotely on my windows server? AWX connect to windows host through WinRM and play powershell script on it. 4. Is the ansible.windows module sufficient for this process? Or do I need to use the community module? It depend on your AWX version. When I was on AWX 17(on docker-compose) module ansible.windows have been present and all windows modules worked properly but when I migrate to AWX 19 on MikroK8s some ansible.windows was absent. I added collecton in playbook for additional module.
@ahmadmujtabaahmadi456810 ай бұрын
Thanks for the video, but its still unclear to me. I would like your help in regards with that: I want to run in a Windows server a Powershell script which is already on c: drive of that remote server. how will i make my yml.playbook for that?
@Automationtoolsinfrastructure10 ай бұрын
Hi. Thanks for wathing. Is example here: --- - name: remotelogoff hosts: all tasks: - name: Run remote PowerShell Script win_command: powershell.exe -ExecutionPolicy ByPass -File C:/Scripts/remotelogoff.ps1
@ahmadmujtabaahmadi456810 ай бұрын
@@Automationtoolsinfrastructure Initially Thanks for the immediate support. I have tried the script , but unfortunately it failed as below: --- - name: windowscleanup hosts: all tasks: - name: Run remote PowerShell Script win_command: powershell.exe -ExecutionPolicy ByPass -File C:\Program Files (x86)\abc\Browser_Cache_DriveClean.ps1 Error: fatal: [sc.abc.local]: FAILED! => {"changed": true, "cmd": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -File C:\\Program Files (x86)\ \ethertec\\Browser_Cache_DriveClean.ps1", "delta": "0:00:01.920863", "end": "2024-01-29 11:34:59.756675", "msg": "non-zero return code", "rc": 1, "start": "2024-01-29 11:34:57.835811", "stderr": "x86 : The naming \"x86\" was not used as the name of a cmdlet, function, script file or an executable program detected. Check the spelling of the name, or whether the path is correct (if included), and repeat the process. On line:1 Character:171 + . .. shell.exe -ExecutionPolicy Bypass -File C:\\Program Files (x86)\\ethert ... + ~~~ + CategoryInfo : ObjectNotFound: (x86:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException", "stderr_lines": ["x86 : The naming…
@Automationtoolsinfrastructure10 ай бұрын
Look at the direction of the slashes in path "C:/Program Files (x86)/abc/Browser_Cache_DriveClean.ps1" And you need quotes as well
@ahmadmujtabaahmadi456810 ай бұрын
@@Automationtoolsinfrastructure Thank you ! its fixed now :)