Run powershell command or script with AWX ansible tower on windows host.

  Рет қаралды 2,052

Automation tools

Automation tools

Күн бұрын

Пікірлер: 8
@Kalaycikerem
@Kalaycikerem 3 жыл бұрын
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?
@Automationtoolsinfrastructure
@Automationtoolsinfrastructure 3 жыл бұрын
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.
@ahmadmujtabaahmadi4568
@ahmadmujtabaahmadi4568 10 ай бұрын
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?
@Automationtoolsinfrastructure
@Automationtoolsinfrastructure 10 ай бұрын
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
@ahmadmujtabaahmadi4568
@ahmadmujtabaahmadi4568 10 ай бұрын
@@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…
@Automationtoolsinfrastructure
@Automationtoolsinfrastructure 10 ай бұрын
Look at the direction of the slashes in path "C:/Program Files (x86)/abc/Browser_Cache_DriveClean.ps1" And you need quotes as well
@ahmadmujtabaahmadi4568
@ahmadmujtabaahmadi4568 10 ай бұрын
@@Automationtoolsinfrastructure Thank you ! its fixed now :)
@Automationtoolsinfrastructure
@Automationtoolsinfrastructure 10 ай бұрын
@@ahmadmujtabaahmadi4568 I'm glad to help you.
Change timezone on windows hosts with AWX ansible tower.
8:03
Automation tools
Рет қаралды 195
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Ansible for the Windows Admin by Jeremy Murrah
1:40:09
PowerShell.org
Рет қаралды 41 М.
Manage Windows with Ansible with Kerberos Active Directory authentication
27:31
Use Windows PowerShell with Ansible
11:46
VirtualizationHowto
Рет қаралды 14 М.
Ansible Tower - Mithun Technologies - +91 99809 23226
1:32:16
Mithun Technologies DevOps
Рет қаралды 16 М.
This web UI for Ansible is so damn useful!
20:07
Christian Lempa
Рет қаралды 504 М.
Ansible For Network Engineers: Getting Started In Less Than 30 Minutes!
26:32
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
Learn How to Use Ansible to Manage Windows Servers (winrm) - Step by Step Guide
13:45
LondonIAC / Dennis McCarthy / Automation Engineer
Рет қаралды 43 М.
Installing Ansible AWX
31:18
Calvin Remsburg
Рет қаралды 38 М.
you need to learn Ansible RIGHT NOW!! (Linux Automation)
21:21
NetworkChuck
Рет қаралды 898 М.