On 17/02/11 08:52, Felix Frank wrote:
> Hi,
>
> On 02/16/2011 05:35 PM, Daniel Piddock wrote:
>> Hey all,
>>
>> I was installing puppet on a freshly installed node and the catalog
>> fails to apply. It immediately bails out with:
>> err: Could not run Puppet configuration client: Could not find init
>> script for 'ssh'
>>
>> This is annoying and odd. ssh service is run by a module in main stage,
>> there is a stage before that which isn't being applied. The service
>> subscribes to a file which in turn requires the package.
>>
>> Can anyone shed light/guess at why puppet is bailing on an init script
>> for a service it hasn't installed yet and shouldn't be worrying about at
>> this stage?
>>
>> Running puppet 2.6.2 on Debian Squeeze. Master is also 2.6.2 on Squeeze.
>>
>> Cheers,
>> Dan
>>
>>
>> modules/ssh/manifests/init.pp
>> class ssh {
>> require ssh::install, ssh::config
>> }
> Why do you use the require function? I think it's dangerous in this
> case, because it probably tries to enforce an ordering. I.e.,
> ssh::config is to be done before the "class ssh" proper. However,
> service "sshd" should require the ssh::install class.
>
> Use include instead of require, and make sure the service requires the
> install class as well. That may just solve your problem.
include doesn't provide a tight enough binding. It simply says "this
would be useful, please process it at some point". With your suggested
change, if another package puts a dependency on ssh module there's no
guarantee that the whole module will be processed in a usable state.
e.g.: file { 'something': require => Class['ssh'] }
class ssh gets processed but ssh::install and ssh::config might not be,
unless I put a depend on something deeper within it. Which defeats the
idea of organising into classes a bit.
I should probably just rewrite all my modules to be single classes
unless there's a clear use for a proper subclass. Puppet's classing
seems broken and my design with requires isn't helping.
I also think this is a tangent to the issue of failing a catalog due to
an init script not being present on a service that has dependencies to
process.
Dan
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.