Hello, What''s the problem with this syntax: package { ''redhat-lsb'': ensure => present, before => File[''/etc/yum.repos.d/rpmforge.repo''], } file { ''/etc/yum.repos.d/rpmforge.repo'': mode => 644, owner => root, content => template("base/rpmforge.repo.erb"), require => Package["redhat-lsb"], } The "before" and "require" its not working, ''Cause I still getting this message: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template base/rpmforge.repo.erb: Could not find value for ''lsbmajdistrelease'' at 4:/etc/puppet/modules/base/templates/rpmforge.repo.erb at /etc/puppet/modules/base/manifests/repository.pp:23 I''m using "lsbmajdistrelease" to discover the verstion of CentOS, but I''ve noticed that some hosts has broken, because the package "redhat-lsb" is missing. If I install the package with yum, everything works well, but I would like to solve this with puppet. Thanks!! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Feb 15, 2013 at 10:42 AM, Tiago Cruz <tiago.tuxkiller@gmail.com>wrote:> Hello, > > What''s the problem with this syntax: > > package { ''redhat-lsb'': > ensure => present, > before => File[''/etc/yum.repos.d/rpmforge.repo''], > } > > file { ''/etc/yum.repos.d/rpmforge.repo'': > mode => 644, > owner => root, > content => template("base/rpmforge.repo.erb"), > require => Package["redhat-lsb"], > } > > The "before" and "require" its not working, ''Cause I still getting this > message: > > Could not retrieve catalog from remote server: Error 400 on SERVER: Failed > to parse template base/rpmforge.repo.erb: Could not find value for > ''lsbmajdistrelease'' at > 4:/etc/puppet/modules/base/templates/rpmforge.repo.erb at > /etc/puppet/modules/base/manifests/repository.pp:23 > > > I''m using "lsbmajdistrelease" to discover the verstion of CentOS, but I''ve > noticed that some hosts has broken, because the package "redhat-lsb" is > missing. If I install the package with yum, everything works well, but I > would like to solve this with puppet. >You can''t update fact information during a puppet run. Puppet either have or don''t have lsb facts when applying the catalog, installing the package to satisfy the dependency won''t help that particular puppet run (only the next one). I also find redhat-lsb package to be hideously large dependency for answering such a basic fact. Here''s one possible work around (as long you don''t need lsbrelease): https://forge.puppetlabs.com/nanliu/lsb HTH, Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Hello Nan, So this is the problem: I think that puppet must fail on the fist attempt, but install the package to be sucess on the second try. But not, it always failing: Feb 15 16:37:49 alog228 puppet-agent[18960]: Starting Puppet client version 2.7.9 Feb 15 16:37:57 alog228 puppet-agent[18960]: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template base/rpmforge.repo.erb: Could not find value for ''lsbmajdistrelease'' at 4:/etc/puppet/modules/base/templates/rpmforge.repo.erb at /etc/puppet/modules/base/manifests/repository.pp:23 on node alog228 Feb 15 16:37:57 alog228 puppet-agent[18960]: Using cached catalog Feb 15 16:37:57 alog228 puppet-agent[18960]: Could not retrieve catalog; skipping run Feb 15 17:08:00 alog228 puppet-agent[18960]: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template base/rpmforge.repo.erb: Could not find value for ''lsbmajdistrelease'' at 4:/etc/puppet/modules/base/templates/rpmforge.repo.erb at /etc/puppet/modules/base/manifests/repository.pp:23 on node alog228 Feb 15 17:08:00 alog228 puppet-agent[18960]: Using cached catalog Feb 15 17:08:00 alog228 puppet-agent[18960]: Could not retrieve catalog; skipping run Feb 15 17:27:05 alog228 puppet-agent[18960]: Caught TERM; calling stop Feb 15 17:27:06 alog228 puppet-agent[21508]: Reopening log files Feb 15 17:27:06 alog228 puppet-agent[21508]: Starting Puppet client version 2.7.9 Feb 15 17:27:08 alog228 puppet-agent[21508]: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template base/rpmforge.repo.erb: Could not find value for ''lsbmajdistrelease'' at 4:/etc/puppet/modules/base/templates/rpmforge.repo.erb at /etc/puppet/modules/base/manifests/repository.pp:23 on node alog228 I saw your module, sounds really nice! Did you know if it works with puppet 2.7.9? Thanks!! Em sexta-feira, 15 de fevereiro de 2013 17h11min14s UTC-2, Nan Liu escreveu:> > > You can''t update fact information during a puppet run. Puppet either have > or don''t have lsb facts when applying the catalog, installing the package > to satisfy the dependency won''t help that particular puppet run (only the > next one). I also find redhat-lsb package to be hideously large dependency > for answering such a basic fact. Here''s one possible work around (as long > you don''t need lsbrelease): https://forge.puppetlabs.com/nanliu/lsb > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Feb 15, 2013 at 11:30 AM, Tiago Cruz <tiago.tuxkiller@gmail.com>wrote:> Hello Nan, > > So this is the problem: I think that puppet must fail on the fist attempt, > but install the package to be sucess on the second try. > > But not, it always failing: > > Feb 15 16:37:49 alog228 puppet-agent[18960]: Starting Puppet client > version 2.7.9 > Feb 15 16:37:57 alog228 puppet-agent[18960]: Could not retrieve catalog > from remote server: Error 400 on SERVER: Failed to parse template > base/rpmforge.repo.erb: Could not find value for ''lsbmajdistrelease'' at > 4:/etc/puppet/modules/base/templates/rpmforge.repo.erb at > /etc/puppet/modules/base/manifests/repository.pp:23 on node alog228 > Feb 15 16:37:57 alog228 puppet-agent[18960]: Using cached catalog > Feb 15 16:37:57 alog228 puppet-agent[18960]: Could not retrieve catalog; > skipping run > Feb 15 17:08:00 alog228 puppet-agent[18960]: Could not retrieve catalog > from remote server: Error 400 on SERVER: Failed to parse template > base/rpmforge.repo.erb: Could not find value for ''lsbmajdistrelease'' at > 4:/etc/puppet/modules/base/templates/rpmforge.repo.erb at > /etc/puppet/modules/base/manifests/repository.pp:23 on node alog228 > Feb 15 17:08:00 alog228 puppet-agent[18960]: Using cached catalog > Feb 15 17:08:00 alog228 puppet-agent[18960]: Could not retrieve catalog; > skipping run > Feb 15 17:27:05 alog228 puppet-agent[18960]: Caught TERM; calling stop > Feb 15 17:27:06 alog228 puppet-agent[21508]: Reopening log files > Feb 15 17:27:06 alog228 puppet-agent[21508]: Starting Puppet client > version 2.7.9 > Feb 15 17:27:08 alog228 puppet-agent[21508]: Could not retrieve catalog > from remote server: Error 400 on SERVER: Failed to parse template > base/rpmforge.repo.erb: Could not find value for ''lsbmajdistrelease'' at > 4:/etc/puppet/modules/base/templates/rpmforge.repo.erb at > /etc/puppet/modules/base/manifests/repository.pp:23 on node alog228 >Two different manifests (in two different environments) need to exist, one to install the facter dependency, the second for the template. Putting them in the same deployment will always result in a catalog compilation error since the master doesn''t have the required fact, and the client will not receive a catalog to install the package to fulfill the fact. I saw your module, sounds really nice! Did you know if it works with puppet> 2.7.9? >It should, facts are usually not sensitive to Puppet version. Thanks, Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On 02/16/2013 01:21 AM, Nan Liu wrote:> Two different manifests (in two different environments) need to exist, > one to install the facter dependency, the second for the template. > Putting them in the same deployment will always result in a catalog > compilation error since the master doesn''t have the required fact, and > the client will not receive a catalog to install the package to fulfill > the fact.Of course, if at all possible, do design your template in such a fashion that it will not fail the whole catalog if the fact is missing, but imply a sensible default instead (that may mean not generating parts of the file at all e.g.) Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On 02/15/2013 07:42 PM, Tiago Cruz wrote:> I''m using "lsbmajdistrelease" to discover the verstion of CentOS, but > I''ve noticed that some hosts has broken, because the package > "redhat-lsb" is missing. If I install the package with yum, everything > works well, but I would like to solve this with puppet.You can try and use $::operatingsystemrelease instead of lsbmajdistrelease. That way you won''t need to install redhat-lsb on your machines... I really hate to install few dozen of packages just to get that one fact going... This is the way I use $::operatingsystemrelease instead of $::lsbmajdistrelease : case $::operatingsystemrelease { default: { some code } /^5.*/: { some code for rhel 5 } /^6.*/: { some code for rhel 6 } } Hope it helps. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.