Archive for » September, 2009 «

Wednesday, September 09th, 2009 | Author:

Pour cross-compiler des applis pour son drobo :

  • Décompresser le SDK (arm-2006q1-6-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2), par exemple /home/nico/drobo
  • Ajouter /home/nico/drobo/bin au PATH
  • créer un répertoire de build, par exemple /home/nico/drobo/build
  • créer un répertoire de destination, par exemple /home/nico/drobo/target
  • décompresser les sources à cross-compiler dans le rep de build
  • lancer le configure de l’appli comme suit :
  • ./configure --host=arm-none-linux-gnueabi --prefix=/home/nico/drobo/target
  • puis make & make install classique

hop !

Monday, September 07th, 2009 | Author:

After reading masterzen’s excellent blog post about puppet storedconfigs, it gave me the idea to create a system of subscription to services.

For example, if you want some client to subscribe to a “backup” service you can use the following little things :

# Subscription system through exported resources
# A stupid idea of Nico <nico@gcu.info>
# $subscribedir is defined somewhere else
define set_subscription_to($title)
{
   @@file { "$subscribedir/nodes/$title/$fqdn":
   content => "\n",
   tag => "$title"
}
 
define get_subscription_to($title)
{
   file { "$subscribedir":
      ensure => directory,
      owner => root
   }
 
   file { "$subscribedir/nodes":
      ensure => directory,
      owner => root,
      require => File["$subscribedir"]
   }
 
   file { "$subscribedir/nodes/$title":
      ensure => directory,
      owner => root,
      require => File["$subscribedir/nodes"]
   }
 
   File <<| tag == $title |>>
}

and in your manifests :

class client {
   set_subscription_to { "backup" : }
}
 
class server {
   get_subscription_to { "backup": }
}

Then the server will be able to know which machines subscribed to something and then treat them by walking the associated folder ( $subscribedir/nodes/$title )

This can be really enhanced of course :)

Have fun

Category: Puppet, SysAdmin, Tech  | One Comment