Hello,
I have created a custom inventory. I would like to have the on/off button for the hosts listed in the inventory work. I have attempted to follow the format of other inventory sources such as setting the “status” value to down but that does not seem to work. Any advice on how to make this show as “off” for unavailable hosts?
To be specific, this is the toggle that says, “Indicates if a host is available and should be included in running jobs”.
I've created a disabled[1] inventory group, which I add hosts into if I
don't want to run plays against it. Then, all my playbooks do the
following[2]:
- hosts: foo-group:!disabled
tasks: ...
All hosts in the foo-group, minus the ones in disabled will run the
play.
[1] http://git.openstack.org/cgit/openstack/windmill/tree/inventory/testing/hosts#n3
[2] http://git.openstack.org/cgit/openstack/windmill/tree/playbooks/nodepool.yaml#n15
That is a way to go about it. This feature does exist and I would like to use it though. Here you can see it working from an oVirt inventory source. Notice the ManageIQ host is set to "off". What must exist in my custom inventory to do the same for specific hosts?
> Hello,
>
> I have created a custom inventory. I would like to have the on/off button
> for the hosts listed in the inventory work. I have attempted to follow the
> format of other inventory sources such as setting the "status" value to
> down but that does not seem to work. Any advice on how to make this show
> as "off" for unavailable hosts?
>
> To be specific, this is the toggle that says, "Indicates if a host is
> available and should be included in running jobs".
>
I've created a disabled[1] inventory group, which I add hosts into if I
don't want to run plays against it. Then, all my playbooks do the
following[2]:
- hosts: foo-group:!disabled
tasks: ...
All hosts in the foo-group, minus the ones in disabled will run the
play.
[1] http://git.openstack.org/cgit/openstack/windmill/tree/inventory/testing/hosts#n3
[2] windmill/nodepool.yaml at master - windmill - OpenDev: Free Software Needs Free Tools
(attachments)