I’m using a database system for passwords. It has a CLI for pulling data. For each server I would like to do something like
hosts: all
gather_facts: no
tasks:
local_action: ansible_ssh_pass=db_cli cli_params
I realize this code is complete invalid. Can I do this in a task, a programatic variables section or do I need to write a dynamic inventory to access my database?
There is a slight question of whether this actually works, as I haven’t tested it
Really, it sounds like you should look into an external inventory script for me, but if you have a CLI interface, it will hit that CLI lots of times and potentially overwhelm the local or remote end if you use large fork counts or large numbers of hosts - I’d see if it had an API if possible.
It sounds like you should look into an external inventory script.
What I working with is CyberArk. It’s primarily a secure password management system that does things like automatic rollover and hidden login. So I’m looking for ways to pull the passwords into my existing inventory.
Can Ansible reference two inventories? Or is there a sample external inventory script that pulls in a ‘normal’ inventory and then allows me to add to it dynamically? I suppose I could build off your existing inventory import code.