I’m working with digital ocean and I would really like to wrap our DO keys we use for deployment in a vault. I also want to use digital ocean for my inventory. Unfortunately the inventory is instantiated before any playbook processing…
https://github.com/ansible/ansible/blob/devel/bin/ansible-playbook#L150
The only work around I can think off hand is to write a module to load the inventory at runtime and run it from a bastion host, like when provisioning cloud servers or modify ansible-playbook to parse the playbooks first, looking for attempts to set environment, then instantiate the inventory.
I can easily get the digital ocean hosts at runtime, I’ve already modified the digital_ocean module to do that. It looks like it should be pretty easy, note sure if library modules can BYPASS_HOST_LOOP.
Any suggestions or ideas?