Hello, I am facing some problems in setting up patch automation in my organization.
For a quick walk through: We have 5 domains for the purpose of Production, Staging, Testing and Application.
I am working on machines in Test domain that has windows machines.
I have my Ansible server setup in UAT(staging) domain.
Ansible Jumpstation: RHEL 6 (64 bit)
Windows Hosts: Windows Server 2012 R2, 2008 R2.
Power Shell version 3.0
I have used following reference sources:
Setting up a Windows Host
Unable to run ConfigureRemotingForAnsible.ps1 on windows hosts. The Power Shell window closes after some execution.
Checked services on machine: winrm service running.
According to Sys. Admin: Ansible machine has no firewall restrictions (can communicate to any and listen from any)
I am using following fashion to definemy Hosts file:
#Window’s Servers
[abctst-win]
abc012.abctst.lcl ansible_connection=local ansible_host= ip address
[abctst-win:vars]
ansible_ssh_port= 5985
ansible_connection= winrm
Output 1:
[root@ansiblejmpst ansible]# ansible abctst-win -i hosts -m win_ping
abc012.abctst.lcl | FAILED! => {
“changed”: false,
“module_stderr”: “/bin/sh: powershell: command not found\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE”,
“rc”: 127
}
Output 2:
[root@ansiblejmpst ansible]# ansible abctst-win -i hosts -m ping
abc012.abctst.lcl | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
Question:
Where am I doing wrong?
What is that I am doing wrong?
Is my way of defining host file correct? Am I passing all required information in hosts file correct?
Is there something I did wrong in setting up windows machine?
Can I get a help here in this? I have to automate windows and linux patching and I am stuck at start.