Performing remote MySQL actions

asked 2015-06-02 03:55:15 -0500

Puffin gravatar image

Hi All,

I am setting up an application host which connects to a remote MySQL database. As part of this host's configuration, a large number of MySQL actions (i.e., grants, inserts etc) need to be performed against this remote host.

Is there a convention on how this should occur? I understand that Puppet configuration is on a per host basis, but this doesn't really fit our environment as it stands at the moment. It would be far easier and more logical if all host based dependencies could be performed as part of that host's configuration.

In other words, instead of adding the MySQL actions as part of the database server manifest, is there an accepted way to perform this from the application host?

Thanks

edit retag flag offensive close merge delete

Comments

Writing an exec resource which connects to the database and executes the statements for the application host is not an option? Simply check for the existence of the grants etc before executing. Does every apphost need to setup grants etc?

far4d gravatar imagefar4d ( 2015-06-03 03:14:27 -0500 )edit

Yes, every app host has to set scores of grants & inserts against a single db host. If I was to use an exec to accomplish this, how would I go about authenticating with MySQL? Storing a password in plain text isn't an option, nor is using a .my.conf file with the password stored in this.

Puffin gravatar imagePuffin ( 2015-06-03 10:47:21 -0500 )edit

So there is a resource type in the mysql module which allows grants and inserts to occur (see https://forge.puppetlabs.com/puppetlabs/mysql). But, is there an option to run this on a remote host? And furthermore, how are permissions for Puppet with MySQL generally configured?

Puffin gravatar imagePuffin ( 2015-06-03 10:58:18 -0500 )edit