Couchdb facts terminus for Puppet
Starting in Puppet 2.6, its possible to store all facts in a couchdb database.
Installation for CentOS 5.x
- ensure that epel, base and updates yum repos are enabled:
- install couchdb
yum install couchdb - ensure that rubygem is installed
yum install rubygems - install gcc
yum install gcc
- Install couchrest 1.0.0 (note: 1.0.1 does not work with ruby 1.8.5)
gem install couchrest -v1.0.0 - ensure that a 2.6.x version of puppet is installed (I recommend 2.6.3)
Configure:
- configure the couchdb facts terminus in puppet.conf
#puppet.conf [master] couchdb_url=http://127.0.0.1:5984/puppet facts_terminus=couch
- Configure couch to bind to 0.0.0.0
[httpd] port = 5984 bind_address = 0.0.0.0
- start couchdb – I recommend starting it in the forground so that you can monitor the http requests.
couchdb
- start up puppetmasterd in the foreground
puppet master --no-daemonize --verbose
Create facts:
- run a puppet agent
puppet agent -t - run a few more to create more data to view in couch
puppet agent -t --certname foo puppet agent -t --certname bar puppet agent -t --certname baz
Profit!
Now facts from all of our clients will be stored as documents in couchdb.
Advantages:
- Facts can be aggregated to a separate service to be queried.
- We can now access a clients fact information using Couch's RESTful interface.
To view the facts documents in couchdb, access the document managment interface of couchdb;
http://puppet-test:5984/_utils/
To acess facts with curl:
curl --get http://localhost:5984/puppet/foo curl --get http://localhost:5984/puppet/bar curl --get http://localhost:5984/puppet/baz
3 Comments
Is there anyway to do this with passenger?
Chris – not sure what you mean? Can you clarify? Thanks.
CouchDB and Ruby on FreeBSD | My Wushu Blog
[...] Sometime last year, Puppet added the ability to store facts into a Couch Database: http://www.puppetlabs.com/blog/couchdb-facts-terminus-for-puppet/ [...]