I’m trying to work out a system that will accommodate user specific settings for things like credentials (using vault) and user specific facts. I’d like to be able to load .yml and .ini style.
I use --start-at-task a lot, so ideally, i would like something like ansible_facts that will always be run. There are so many ways to almost do what I want…
The new /etc/ansible/facts.d would work, but I need it on the ansible_controller not the remote hosts.
- include_vars: user_settings.ini
or
vars_files:
- user_settings.ini
would be good enough, but it only works for .yml files.
It looked like vars_plugins should do the trick but i haven’t figured it out and it hangs with no useful message.
So I’m confused by this post since it talks about so many different things.
Can you step back and explain the use case without jumping into Ansible terms so we can offer a suggestion?
I’d like to have a multi-user ansible controller vm (partly for training purposes). This vm should run site.yml using the credentials and other settings of the current user.
Sometimes, it is less translation work to use existing .ini style files (like .gitconfig) to populate those settings.
One use case is setting up a bunch of git repositories (we haven’t got a workflow around a local git mirror yet) with a particular users github credentials.
Another is adding plugins and patches to distribute a “tweaked” distro of ansible itself . For this i need access to variables like “lookup_plugins” defined in .ansible.cfg.
I see many ways of loading variables via .yml files, but on the controller machine itself, i’m not sure how to load a .ini file that will keep those vars available throughout the playbook.
My ideal solution would have the .ini style variables loaded like ansible_managed (automatically regardless of starting location).
kesten