Hey!
First, I seriously want to thank every single person who takes the time to read this, AWX is amazing and I don’t doubt that it owes a lot of that to the community behind it, I hope to become more involved with it in the future.
I have a dynamic inventory script pulling devices from a 3rd party application. I have setup the script to only pull in online hosts, as the hosts we are working with may be online or offline at any given time.
My question is, what way would you remove items from the inventory or disable them based on this script? I have a few ideas using the API but am I missing a trick here, as in is there an easy way to do it?
Thanks very much!
Sean.
Hi Sean
So when you say in the title ‘without predictable connectivity’ you mean the end devices may not be online rather than a non-reliable connection to them?
If your script is already only pulling in online hosts, so doing the filtering, I’m not sure why you need to do more?
When you run a Job Template, have ‘update on launch’ set against that inventory so it’ll run the dynamic discovery before the JT run and you should be good to go?
Otherwise, you might have run something like the ping module, capture register output, check and use add_hosts during plays to make an in-memory inventory.
If ansible cannot connect to the end node, it’ll fail for that host anyway, so you could just ignore it?
I don’t think you need to consider ^^^ unless I’m misinterpreting things.
Regards
Phil.