I'm migrating a set of bash scripts that deploy a server to Puppet. Almost all of the functionality has been moved into Puppet, but I can't see how to migrate one bit of the bash script that does the following:
- Install PHP.
- With a PHP script, generate a random password and store it as a variable in the bash script.
- Use that variable elsewhere in the bash script to set the MySQL root password.
How can I set a puppet variable dynamically like this?
btw I'm using Puppet in a standalone version using
puppet apply as I don't have a separate server to act as the puppet master.
Also, in case anyone is wondering why it's done like this, it's so that the MySQL root password doesn't exist anywhere except on the box where it's used and isn't written to any (readable) files.