So I am doing a digital ocean thing. I saw the dynamic inventory scripts and thought my problems were solved. But turns out, it only covers the simplest case and doesn’t help you further.
The background here is I’m doing a little bit of a hbase thing. So I have created some hosts using the digital ocean commands, but first I had to fix the private networking bug (https://github.com/ansible/ansible-modules-core/pull/677)
So I create my hosts with a standalone playbook:
Ryan,
I am facing the same issue as you. In your case you can actually reference your hosts from a play like this :
hosts: hbase0:hbase1:hbase2 (and so on)
Which is not ideal but it does “work”. In my case I need to create servers in DO and I need to reference them with groups like “prod” and “prod-appname”. The solution I came up with involves making changes to the digital_ocean.py inventory script. The changes were quite simple and you can follow a similar approach.
See here https://gist.github.com/boris317/5fc7bf6d003c7df3ae74
In your case you would do something like this:
if the droplet[‘name’].startswith(‘hbase’):
self.push(self.inventory, “hbase”, dest)