# Using delegate\_to: localhost on Windows servers not working as expected

**URL:** <https://forum.ansible.com/t/using-delegate-to-localhost-on-windows-servers-not-working-as-expected/35386>\
**Category:** AWX Project\
**Tags:** windows, awx\
**Created:** [June 21, 2021, 11:09pm UTC](https://forum.ansible.com/t/using-delegate-to-localhost-on-windows-servers-not-working-as-expected/35386 "2021-06-21T23:09:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shane.do](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@shane.do](https://forum.ansible.com/u/shane.do)\
**Post date:** [June 21, 2021, 11:09pm UTC](https://forum.ansible.com/t/using-delegate-to-localhost-on-windows-servers-not-working-as-expected/35386/1 "2021-06-21T23:09:30Z")

</div>

Hi all,

I’ve got a playbook that I’ve run on some linux servers for a long time without issue. I’m trying to expand this to cover some windows servers but having an issue with delegate\_to.

Basically, we need something that will

- use localhost to check some ec2 instances are running, defined by a group in AWX
- run patching command on each host in the group
- use localhost to then shut some of the instances down

After a lot of mucking around some time ago I got this working with linux servers with the below playbook:
