Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail


Sunday, September 09, 2012

Puppet and modules

I've been working with puppet and the good impression of the product balances with the few really good modules around.
There are lots of modules, some are good, but most are build to statisfy the specific needs of the author and not a generic management of the software also there is little integration or common approach: one uses wget another curl, one manage different ps, one require dependecy to a module from the same author and not to more official ones ( comprehensible but can be problematic when the dependancy is with things like apache or Java ).
Obviously this is the normal characteristic of oss project but I think that this calls for more control from project' developers.
The project is a good one and with version 3 has lots of good features: we need a bunch of basic modules designed with the state of the art so that there can be a common solution over which people can develop new more complex or dedicated mods.
This could help the grown of the contributing community.

Thursday, September 06, 2012

Puppet and exported resources

I've recently started using puppet for the european project Open-DAI I'm working on and I can say that after a steep learning period the tool is really nice.

I expecially like the exported resources that allow for "piloting" the creation of resources on a remote node from a first node.

The use case is installing stuff like a DB on a remote DB host for the application we are installing.
My example case is Zabbix.
I want to install zabbix in a distributed configuration using an existing MySQL server I have on the cloud and placing the application on a new cloud host.

Usually all the example and modules I find around imply to have all the stuff on the same host.

The idea id to declare on the application node the fact that you need a DB and to transform this declaration to a command execution on the Db to provision the required DB.

I'm using puppet 3.0.rc4 and opting to use puppet-mysql from puppetlabs (I must say that there is a bit of jungle on the puppet modules around and prefer to stick and possibly contribute to the puppetlabs collection)

The solution I found is to use exported resources on the application node and collecting them on the DB node in this way

In the zabbix host

@@mysql::db { zabbix1:
user => 'zabbix1',
password => 'mypass',
host => $::fqdn,
grant => ['all'],
tag => 'new_db_nodeDBname'

On the MySQL node

class { 'mysql::server':
config_hash => {root_password => 'changeme',}
Mysql::Db <<| tag == 'new_db_nodeDBname' |>>

Now I'll have to solve the orchestration and piloting of the whole process that is after created the DB I'll have to issue a sql creation and to do so I'll need to be sure to have the DB installed so this will require to:
force a puppet agent execution on the MySQL node (possibly using mcollective)
a second run of the puppect agent on the zabbix node to check the availability of the DB and proceed with the installation.

In any case a nice start.