# AWX - gcp source inventory how to exclude windows hosts

**URL:** <https://forum.ansible.com/t/awx-gcp-source-inventory-how-to-exclude-windows-hosts/10616>\
**Category:** Get Help\
**Tags:** windows, gcp, documentation, awx, inventory\
**Created:** [October 31, 2024, 2:53pm UTC](https://forum.ansible.com/t/awx-gcp-source-inventory-how-to-exclude-windows-hosts/10616 "2024-10-31T14:53:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Perdomo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/juan_perdomo/32/5313_2.png) [@Juan\_Perdomo](https://forum.ansible.com/u/Juan_Perdomo)\
**Post date:** [October 31, 2024, 2:53pm UTC](https://forum.ansible.com/t/awx-gcp-source-inventory-how-to-exclude-windows-hosts/10616/1 "2024-10-31T14:53:25Z")

</div>

Hello! I was wondering if perhaps someone could help me with more insight on dynamic inventories/smart inventories.

Currently I have a inventory with multiple sources all using gcp source dynamic inventory. Had to do multiple sources because for some reason I was getting a bug when setting retrieve\_image\_info: “true” and having multiple projects.

Currently each source looks like this for each project.

```auto
---
projects:
  - foo-infra-prd
retrieve_image_info: "true"
keyed_groups:
  - prefix: NETWORK
    key: networkInterfaces[0].network.name
  - prefix: PROJECT
    key: project
  - prefix: IMAGE
    key: image
hostnames:
  # List host by name instead of the default public ip
  - name
filters:
  - NOT labels.goog-gke-node = "" # no k8 machines
compose:
  # Set an inventory parameter to use the Public IP address to connect to the host
  # For Private ip use "networkInterfaces[0].networkIP"
  ansible_host: networkInterfaces[0].networkIP

```

I am able to get a good hosts list and I then created a smart inventory to split out based on the network I want to target.

However some issues I faced are that there are some windows hosts I do not want to target in the host list.

My question is, is there a way to add exclusions in SMART inventory or Perhaps using the Enabled Variable/enabled Value area in the Google cloud engine source.

- Include the version(s) of the relevant software tools, libraries, collections etc  
AWX 24.3.1

---

<div class="post-metadata">

**Author:** ![Juan\_Perdomo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/juan_perdomo/32/5313_2.png) [@Juan\_Perdomo](https://forum.ansible.com/u/Juan_Perdomo)\
**Post date:** [November 4, 2024, 5:04pm UTC](https://forum.ansible.com/t/awx-gcp-source-inventory-how-to-exclude-windows-hosts/10616/2 "2024-11-04T17:04:57Z")

</div>

I was able to solve this by using constructed inventories.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [December 4, 2024, 5:05pm UTC](https://forum.ansible.com/t/awx-gcp-source-inventory-how-to-exclude-windows-hosts/10616/3 "2024-12-04T17:05:53Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
