# Ansible & Windows Management

**URL:** <https://forum.ansible.com/t/ansible-windows-management/30152>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 19, 2019, 9:48am UTC](https://forum.ansible.com/t/ansible-windows-management/30152 "2019-04-19T09:48:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CHARCHOUF\_SABRI](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@CHARCHOUF\_SABRI](https://forum.ansible.com/u/CHARCHOUF_SABRI)\
**Post date:** [April 19, 2019, 9:48am UTC](https://forum.ansible.com/t/ansible-windows-management/30152/1 "2019-04-19T09:48:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tchia04](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Tchia04](https://forum.ansible.com/u/Tchia04)\
**Post date:** [April 23, 2019, 1:55am UTC](https://forum.ansible.com/t/ansible-windows-management/30152/2 "2019-04-23T01:55:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CHARCHOUF\_SABRI](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@CHARCHOUF\_SABRI](https://forum.ansible.com/u/CHARCHOUF_SABRI)\
**Post date:** [April 23, 2019, 11:47am UTC](https://forum.ansible.com/t/ansible-windows-management/30152/3 "2019-04-23T11:47:07Z")

</div>

Thank you for your reply  
I will check and revert back

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 23, 2019, 5:13pm UTC](https://forum.ansible.com/t/ansible-windows-management/30152/4 "2019-04-23T17:13:43Z")

</div>

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](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](https://docs.ansible.com/ansible/latest/plugins/inventory/openstack.html)

Dick

---

<div class="post-metadata">

**Author:** ![CHARCHOUF\_SABRI](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@CHARCHOUF\_SABRI](https://forum.ansible.com/u/CHARCHOUF_SABRI)\
**Post date:** [April 23, 2019, 8:18pm UTC](https://forum.ansible.com/t/ansible-windows-management/30152/5 "2019-04-23T20:18:16Z")

</div>

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
