Ansible windows client or host with Ansible linux server? Possible? - windows

I am using Ansible for some infrastructure management problem for my project. I achieved this task using a Linux client like say to copy a bin file from Ansible server and install it on a client machine. This involves tasks in my playbooks using normal Linux commands like ssh, scp, ./bin etc.,
Now I want to achieve the same in a windows client. I couldn't find any good documentation to try it out. If anyone of you have tried using Ansible with Windows client then it would be great if you could share the procedures or prototype or any piece of information to start with and progress further on my problem.

There's no built-in Windows support for Ansible today. If you search the mailing list, you'll find some references to people having some minimal success with things like CygWin. You should probably check out the mailing list and stay tuned.

Starting in version 1.7, Ansible also contains support for managing Windows machines. This uses native powershell remoting, rather than SSH. See the Ansible documentation website for details on Windows support for Ansible.

Ansible Windows support (including Azure) has been extended a great deal in 2.2 which released in June. https://www.ansible.com/blog/ansible-2.1 For what it's worth, I've also released a course on Pluralsight for managing Windows targets with Ansible

You can use powershell remoting. But i'm using SSH with Cygwin installed in windows so that the same linux code will work smoothly in windows as well.

Related

Possible ways to run windows batch command from Unix

I am trying to run a windows batch command from CentOS 6. I would like to know the best way to achieve this. I explored PsExec and WinExe utilities in unix to connect to windows machine and run the required commands.
I am trying this on a windows VM which is within company network, hence kindly highlight any specific network issues that I may have to check for the setup to run.
Any pointers would help.
Have you seen the examples from the PowerShell for Linux GitHub pages, as the working examples seem to cover this off nicely?
https://github.com/PowerShell/PowerShell/tree/master/demos/SSHRemoting
It will require SSH installed onto your Windows server, but otherwise seems to tick all of your boxes.

Can Ansible be used for deployment to an IBM mainframe z/OS OMVS

From what I understand, Ansible is agentless and can connect using OpenSSH. I believe that Ansible requires Python. We currently do not have Python available (Jython is available) on this mainframe, and I'm not sure that a reliable port exists, although I have found some possibilities (e.g. http://www.rocketsoftware.com/zos-open-source/python?ver=2.7.6).
Is Python, or anything else, required on the target server/mainframe to use Ansible to deploy files?
According to
the install docs,
the target machine should only need a functioning sshd and a pretty
old Python version.
You may be somewhat limited on the
modules
you can use with ZOS, but some will work, and you could probably write
more yourself.

Invoke-VMScript - PowerCli - compatibility

I wonder what guest OS are compatible to the invoke-VMScript cmdlet. The reason I'm asking: I plan to include VMWare in my (automated) test environment. What I read so far:
Windows Server 2008
Windows Server 2012
A Fedora-Version
I would like to know, what windows and linux guest you have experience with and (if appliable) what languages are invokeable. E.g. CMD at windows, or maybe Bash or Powershell at Linux.
According to the documentation powershell bat(cmd) and bash are all supported, I don't have a linux machine handy to confirm but based on this link it looks like you can run powershell on Linux VM's as long as .Net and Powershell have been installed and the machine has been rebooted since this install. Beyond that depending on the VM config you can use any of those methods to create and launch scripts that target just about any language by building them as strings inside of the script that is delivered, writing them to a temp file and then launching the correct interpreter and calling the newly created file. note that there seem to be a bunch of edge-cases here so you may want to review the requirements here

executing command on a Windows Machine from a UNIX/LINUX Machine

is it possible to execute a command (ex: launching a .bat file located on the remote machine) on a Windows Remote Machine, using a UNIX or Linux Machine ?
Is there something like a scp/ssh mechanism or at least a way to connect to a Windows Machine passing through the network ?
Thanks for your help.
By default, recent Windows versions only support the Remote Desktop protocol. As far as I know, client versions only allow a single user, while server versions with installed Terminal Services allow for multiple simultaneous users.
Windows Server versions also support the Telnet protocol, but the server is disabled by default - it may not even be installed. Therefore you will have to enable it manually. Do you really want to use Telnet of all things, though? Just the security concerns are enough to make it mostly useless.
There is also a version of OpenSSH for Windows, that uses the Cygwin DLL. I have not tried it, but using an SSH implementation from the Unix world does have its appeal (and probably a few disadvantages). See also this.
EDIT:
Recent Windows versions also support the Windows Remote Management system, which allows you to launch an interactive session throuh a bit of trickery.
You may want to try Vandyke VShell.

Is it possible to run a batch script remotely on a Windows machine from Linux without installing ssh?

I am looking for a way in Linux to run a batch script on a remote Windows machine. I already searched some forums and the Internet and found e.g. this question.
It seems that the easiest way so far is using ssh. But do Linux or Windows also offer some built-in tools to solve this problem (something like at-command for Linux-to-Windows)?
Have a look at this. It seems to be the linux counter part to the Windows Sysinternals PsExec tool.
.
Another option is to use ad-hoc services for remote execution, e.g. Nagios NRPE for windows. It is not exactly what the developers had in mind, but it can be (ab)used in this way.

Resources