Hello. I have an need to be able to run a playbook against a Windows system and a Linux system with different accounts and different methods of connection.
The windows server of course uses winrm and the linux system uses ssh. I need to get files from the windows server over the the linux server and process those files on linux and get them back to the windows server for installation.
The issue I have is the primary account is a windows account which does not have access to the linux server. And the same goes for the linux account does not have access to the windows server. Both access methods of course are different and both accounts and passwords differ.
How can I create a playbook which can access both hosts within the same play or in separate plays but in the same playbook. I am using Ansible Tower to execute the playbooks.
So here is what I’m finding in short:
- Connection to windows works just find but SSH connection to the linux host is not working because it’s expecting a winrm connection to the linux host. How do I get this to use a SSH connection in the task itself or in a separate play in the same playbook.
- How do I pass the linux account name and password either in the same task or same play in the same playbook. I setup a generic account in tower and setup the template to have both the machine account and generic account available in the playbook.
- I use separate inventories for both Windows and Linux. How do I add the Linux host so it will be seen and not say it cannot match the host in the existing inventory?
Any help would be appreciated. I hope I expressed properly what I’m trying to accomplish.
Thanks.
Glen