Hi, I''m running puppet 3.1.1 I have something similar to the following configuration. class my_roles::puppet_master { file { ''/etc/default/puppetmaster'': ensure => present, source => ''puppet:///modules/my_roles/puppetmaster/etc/default/puppetmaster'', # before => Class[''puppet''], } class {''puppet'' : require => File[''/etc/default/puppetmaster''], } } I would expect that the file type gets applied before the class type further down. I''ve tried both the before, and the require keywords, but no matter what, they never get honoured. I could use the stage''s to force the puppet class into a stage after main, but that really shouldn''t be necessary here. Does anyone have any ideas about what I''m doing wrong? Regards, Dave -- 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.
Nikola Petrov
2013-Apr-03 06:35 UTC
Re: [Puppet Users] before and after not being honoured
I think that this is because classes are not applied but are declared. Check the anchor pattern and declare that an puppet::start is declared before the file. I can give you more info when you actually give us the puppet class itself. You can find more info about the anchor pattern here http://projects.puppetlabs.com/issues/8040 and https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/type/anchor.rb -- Nikola On Tue, Apr 02, 2013 at 09:13:23AM -0700, Dave Bell wrote:> Hi, > > I''m running puppet 3.1.1 > > I have something similar to the following configuration. > > class my_roles::puppet_master { > file { ''/etc/default/puppetmaster'': > ensure => present, > source => > ''puppet:///modules/my_roles/puppetmaster/etc/default/puppetmaster'', > # before => Class[''puppet''], > } > > class {''puppet'' : > require => File[''/etc/default/puppetmaster''], > } > } > > I would expect that the file type gets applied before the class type > further down. I''ve tried both the before, and the require keywords, but no > matter what, they never get honoured. > > I could use the stage''s to force the puppet class into a stage after main, > but that really shouldn''t be necessary here. > > Does anyone have any ideas about what I''m doing wrong? > > Regards, > Dave > > -- > 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. > >-- 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 Tuesday, April 2, 2013 11:13:23 AM UTC-5, Dave Bell wrote:> > Hi, > > I''m running puppet 3.1.1 > > I have something similar to the following configuration. > > class my_roles::puppet_master { > file { ''/etc/default/puppetmaster'': > ensure => present, > source => > ''puppet:///modules/my_roles/puppetmaster/etc/default/puppetmaster'', > # before => Class[''puppet''], > } > > class {''puppet'' : > require => File[''/etc/default/puppetmaster''], > } > } > > I would expect that the file type gets applied before the class type > further down. I''ve tried both the before, and the require keywords, but no > matter what, they never get honoured. >I''m sure they do get honored, but what that means is not what you expect. For one thing, it would be pretty hard to tell whether they were honored or not with the example code you provide, because applying a class itself is a no-op. The nature of your problem would be easier to discern if you provided a minimal, complete manifest set that genuinely exhibited it, but Nikola is probably right that it involves a containment issue that could be addressed by applying the Anchor pattern. John -- 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.