Puppet: how to use data from a MySQL table in Puppet 3.0 templates?

Posted by Luke404 on Server Fault See other posts from Server Fault or by Luke404
Published on 2012-11-27T10:52:16Z Indexed on 2012/11/27 11:05 UTC
Read the original article Hit count: 330

Filed under:
|
|
|

I have some data whose source-of-truth is in a MySQL database, size is expected to max out at the some-thousands-rows range (in a worst-case scenario) and I'd like to use puppet to configure files on some servers with that data (mostly iterating through those rows in a template).

I'm currently using Puppet 3.0.x, and I cannot change the fact that MySQL will be the authoritative source for that data. Please note, data comes from external sources and not from puppet or from the managed nodes.

What possible approaches are there? Which one would you recommend?

Would External Node Classifiers be useful here?

My "last resort" would be regularly dumping the table to a YAML file and reading that through Hiera to a Puppet template, or to directly dump the table in one or more pre-formatted text file(s) ready to be copied to the nodes.

There is an unanswered question on SF about system users but the fundamental issue is probably similar to mine - he's trying to get data out of MySQL.

© Server Fault or respective owner

Related posts about mysql

Related posts about database