Need a help on manage various OS

23 views
Skip to first unread message

Thirumalai Raja A

unread,
Aug 28, 2024, 7:57:01 AMAug 28
to ansible...@googlegroups.com
hi all,

We are using AWX to perform ansible jobs. I need help because I wanted to apply a restart schedule for a set of linux and windows vms. for linux we have a local account with ssh key and for windows we have a service account of AD.

So how can I run my single job handling windows and linux hosts in single playbook?
(i can only add once machine credential in a AWX template).


Regards,
Thirumalai.

Rowe, Walter P. (Fed)

unread,
Aug 28, 2024, 8:22:13 AMAug 28
to ansible...@googlegroups.com
I would split your inventory into groups by platform since Windows login requires a different method. For the Windows group you can configure the login method for Windows as needed to use RDP.

You could have two plays in the playbook that target the different groups in the "hosts" tag.

- name: reboot windows hosts
  hosts: windows_hosts
  tasks:
    ... do the reboots via winrm

- name: reboot linux hosts
  hosts: linux_hosts
  tasks:
    ... do the reboots via SSH

Walter
--
Walter Rowe, Division Chief
Infrastructure Services Division
Mobile: 202.355.4123

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALyK%3Dg-VzGVBv_9bYzAVDhuh08QKGuPNzY4CGriBAW6LatBe4g%40mail.gmail.com.

Thirumalai Raja A

unread,
Aug 28, 2024, 8:34:33 AMAug 28
to ansible...@googlegroups.com
I can create a group in inventory but how can I use credentials for that? You ask me to have two different playbooks.
if its single playbook how can i mention credentials for windows and linux separately 

Rowe, Walter P. (Fed)

unread,
Aug 28, 2024, 9:06:54 AMAug 28
to Ansible Project


Walter
--
Walter Rowe, Division Chief
Infrastructure Services Division
Mobile: 202.355.4123

Rowe, Walter P. (Fed)

unread,
Aug 28, 2024, 9:09:41 AMAug 28
to ansible...@googlegroups.com


Walter
--
Walter Rowe, Division Chief
Infrastructure Services Division
Mobile: 202.355.4123
Reply all
Reply to author
Forward
0 new messages