Ansible & Windows Management

Hi Folks,

I’m a new user for Ansible and I would like to get some help from experts.

Project: Customer would like to use Ansible to switch OFF hosts on a public cloud [the public cloud is OpenStack based]

My issue is that I’m not sure how to set up my inventory file and how I can connect to hosts, especially that we should do it via APIs.

any idea, a suggestion is highly appreciated.

Thanking you in advance.

To connect to windows from ansible you can use wintm instead of the default winrm connection type

Thank you for your reply
I will check and revert back

You should not use ansible to connect to each and every host and try to turn it off. That’s a load of overhead and there is no way to turn them back on again later.

Instead, use ansible to connect to the openstack cluster and switch off hosts from there, for instance with

https://docs.ansible.com/ansible/latest/modules/os_server_action_module.html

You can optionally first fetch a list of hosts on the cluster and filter that in a useful way:

https://docs.ansible.com/ansible/latest/plugins/inventory/openstack.html

Dick

Thank you very much for your help & advise.
may I ask you if you can help me with just some example or tutoriel, as I’m new and any assistance is highly appreciated.

if possible we can try to discuss further on slack or hangout…

Again thank you