# Custom Inventory On/Off

**URL:** <https://forum.ansible.com/t/custom-inventory-on-off/29511>\
**Category:** AWX Project\
**Created:** [January 24, 2019, 4:08am UTC](https://forum.ansible.com/t/custom-inventory-on-off/29511 "2019-01-24T04:08:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deloreandave](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@deloreandave](https://forum.ansible.com/u/deloreandave)\
**Post date:** [January 24, 2019, 4:08am UTC](https://forum.ansible.com/t/custom-inventory-on-off/29511/1 "2019-01-24T04:08:31Z")

</div>

I have created a custom inventory and I am attempting to set hosts to off. I have tried to follow the output of the ovirt inventory source plugin. I notice it creates groups named status\_up and status\_down and adds an attribute named status to entries that say “up” or “down” as part of \_meta-\>hostvars for individual host entries. Neither of these have been successful for me when attempting to do the same for a custom inventory and I am not finding much on the topic in documentation either. Anyway, you will see what I mean in the attached image. Notice how the ManageIQ vm is down. How do I get a custom inventory to do the same?

 ![Greenshot 2019-01-21 12.10.46.png](https://us1.discourse-cdn.com/ansible/original/2X/4/49836661a0154057cabb4474863b3be5efee2833.png)

---

<div class="post-metadata">

**Author:** ![AlanCoding](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/alancoding/32/301_2.png) [@AlanCoding](https://forum.ansible.com/u/AlanCoding)\
**Post date:** [January 24, 2019, 1:07pm UTC](https://forum.ansible.com/t/custom-inventory-on-off/29511/2 "2019-01-24T13:07:59Z")

</div>

In your file-based settings you have to set CUSTOM\_ENABLED\_VAR and CUSTOM\_ENABLED\_VALUE to reflect how your import’s hostvars signal on/off state.

[https://github.com/ansible/awx/blob/f223df303f6ef548ccdc0d1c7bb89a980376dd3e/awx/settings/defaults.py#L905](https://github.com/ansible/awx/blob/f223df303f6ef548ccdc0d1c7bb89a980376dd3e/awx/settings/defaults.py#L905)

Note that is for custom inventory script. If you add an inventory source source from a project, there are different variables for those, like SCM\_ENABLED\_VAR.

> **(attachments)**
>
> ![Greenshot 2019-01-21 12.10.46.png](https://us1.discourse-cdn.com/ansible/original/2X/4/49836661a0154057cabb4474863b3be5efee2833.png)
