Hi,
I''m trying to add a require field to my "define
apache::module" just
like in the recipe
http://reductivelabs.com/trac/puppet/wiki/Recipes/DebianApache2Recipe.
But when I run puppet all I got is that error:
err: Could not create /usr/sbin/a2enmod php5: Parameter require
failed: Invalid relationship "php5" at /appli/trunk/FOTV-INSTALL/
puppet/modules/socle_apache/manifests/init.pp:30
Here is my code:
define module ( $ensure = ''present'', $require =
''apache2-mpm-
prefork'' ) {
case $ensure {
''present'' : {
exec { "/usr/sbin/a2enmod $name":
unless => "/bin/sh -c ''[ -L
${apache2_mods}-enabled/$
{name}.load ] \
&& [ ${apache2_mods}-enabled/${name}.load -ef $
{apache2_mods}-available/${name}.load ]''",
notify => Exec["force-reload-apache2"],
require => Package[$require],
}
}
''absent'': {
exec { "/usr/sbin/a2dismod $name":
onlyif => "/bin/sh -c ''[ -L
${apache2_mods}-enabled/$
{name}.load ] \
&& [ ${apache2_mods}-enabled/${name}.load -ef $
{apache2_mods}-available/${name}.load ]''",
notify => Exec["force-reload-apache2"],
require => Package[$require],
}
}
default: { err ( "Valeur inconnue:
''$ensure''" ) }
}
socle_apache::module { "php5" : ensure => "present",
require =>
"php5", }
I''m running puppet v0.24.4.
Have you any idea ?
Thx !!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Hi> socle_apache::module { "php5" : ensure => "present", require => > "php5", }require is a metaparameter: http://reductivelabs.com/trac/puppet/wiki/MetaparameterReference If you don''t do your own require-parameter then you can make the whole thing a lot more flexible. However you''ll need to write "require => Package[''php5'']", which is imho anyway more declarative than only php5. It looks like the receipe online is imho a bit out of date and should be updated. Maybe you like to do it? cheers pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
>> socle_apache::module { "php5" : ensure => "present", require => >> "php5", } > > require is a metaparameter: > http://reductivelabs.com/trac/puppet/wiki/MetaparameterReference > > If you don''t do your own require-parameter then you can make the whole > thing a lot more flexible. However you''ll need to write "require => > Package[''php5'']", which is imho anyway more declarative than only php5.oh and you even don''t need to pass down the require anymore to the individual resources. cheers pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On 16 nov, 12:09, Peter Meier <peter.me...@immerda.ch> wrote:> >> socle_apache::module { "php5" : ensure => "present", require => > >> "php5", } > > > require is a metaparameter: > >http://reductivelabs.com/trac/puppet/wiki/MetaparameterReference > > > If you don''t do your own require-parameter then you can make the whole > > thing a lot more flexible. However you''ll need to write "require => > > Package[''php5'']", which is imho anyway more declarative than only php5. > > oh and you even don''t need to pass down the require anymore to the > individual resources. > > cheers peteOk, that''s just cool :) I have remove the require part from my define and now I call it like that: socle_apache::module { "php5" : ensure => "present", require => Package[''php5''], } Everything works, thank you !! Matt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---