Spent most of yesterday diving into Ansible and encoding much of what I do as playbooks. I was wondering if anyone had a solution for this?
Say you're installing WordPress or something. You want to set up a database likely just for WP, and a human won't interact with it at all. You could prompt for a password, but why when 99.999% of the access to this database will be the web app that created it?
Instead of prompting for these sorts of single-use passwords, is there a function or other method to generate them randomly? Perhaps a way of setting variables to a random string of characters can be added, similar to that for prompting?
Say you're installing WordPress or something. You want to set up a
database likely just for WP, and a human won't interact with it at all.
You could prompt for a password, but why when 99.999% of the access to
this database will be the web app that created it?
Instead of prompting for these sorts of single-use passwords, is there a
function or other method to generate them randomly? Perhaps a way of
setting variables to a random string of characters can be added, similar
to that for prompting?
Maybe a local action to a shell script or piece of python which returns a password as a fact. Simplest example (untested):-
#!/bin/sh
# mkrandompassword - put this in the library directory
# alongside the playbook
Coming back to this (catching up on the mailing list), this is what I do in one of my test scripts to validate changes I made (in this case it was to test changes to the shell and debug module):