I mount Cloudfuse to access Rackspace's Cloudfiles using Puppet, but on a new host, mount runs too soon, even though I require the whole class. In Pro Puppet, James recommends splitting class definitions like this:
class cloudfuse{
include cloudfuse::install, cloudfuse::service, cloudfuse::config
}
class cloudfuse::install{
# download and install
}
class cloudfuse::config{
file{'/root/.cloudfuse':
notify => Class['cloudfuse::service'],
}
}
class cloudfuse::service{
service{'cloudfuse':
ensure => running,
}
}
That works just fine. When I'm ready to mount, I require the top-level, parent class, like this:
exec{'mount /data/cloudfiles':
command => "/usr/local/bin/cloudfuse /data/cloudfiles",
require => [
File['/data/cloudfiles'],
Class['cloudfuse'],
]
}
Questions are:
- Is this idiomatic? I've seen this elsewhere, so I'd say it is.
- Should I actually require
cloudfuse::install
instead of the parent?
I know that requiring cloudfuse::install
will fix my problem, but if I have a very simple class, maybe I won't split in three like this, then I'd have to guess / look at the manifest to know how to declare the dependency.