my base/default includes this ntp manifest # cat modules/ntp/manifests/ntp.pp # ntp.pp class ntp { case $operatingsystem { centos, redhat: { $service_name = ''ntpd'' $conf_file = ''ntp.conf.el'' } debian, ubuntu: { $service_name = ''ntp'' $conf_file = ''ntp.conf.debian'' } } package { ''ntp'': ensure => installed, } service { ''ntp'': name => $service_name, ensure => running, enable => true, subscribe => File[''ntp.conf''], } file { ''ntp.conf'': path => ''/etc/ntp.conf'', ensure => file, require => Package[''ntp''], source => "puppet:///ntp/files/${conf_file}", } } # class {''ntp'': } So my questions... 1. I tested this by moving /etc/ntp.conf on my test client but it doesn''t seem to replace the file though it clearly says ''ensure => file'' Is my understanding wrong? 2. Files ntp.conf.el & ntp.conf.debian are located in /etc/puppet/modules/ntp/files - source => ''puppet://puppet:///ntp/files/${conf_file} is this correct? -- Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ craig.white@ttiltd.com 1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ www.ttiassessments.com Need help communicating between generations at work to achieve your desired success? Let us help! -- 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 Mon, 20 Jun 2011 14:17:46 -0700, Craig White wrote:> > my base/default includes this ntp manifest > > # cat modules/ntp/manifests/ntp.pp > # ntp.pp > > class ntp { > case $operatingsystem { > centos, redhat: { > $service_name = ''ntpd'' > $conf_file = ''ntp.conf.el'' > } > debian, ubuntu: { > $service_name = ''ntp'' > $conf_file = ''ntp.conf.debian'' > } > } > > package { ''ntp'': > ensure => installed, > } > > service { ''ntp'': > name => $service_name, > ensure => running, > enable => true, > subscribe => File[''ntp.conf''], > } > > file { ''ntp.conf'': > path => ''/etc/ntp.conf'', > ensure => file, > require => Package[''ntp''], > source => "puppet:///ntp/files/${conf_file}", > } > } > > # class {''ntp'': } > > So my questions... > > 1. I tested this by moving /etc/ntp.conf on my test client but it doesn''t seem to replace the file though it clearly says ''ensure => file'' > Is my understanding wrong? >That should replace the file. What output are you getting (if anything)? % cat ../test.pp file { ''blab'': path => ''/tmp/blab.txt'', ensure => ''file'', content => ''asdf'', } % puppet apply ../test.pp notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' notice: Finished catalog run in 0.06 seconds % rm /tmp/blab.txt % puppet apply ../test.pp notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' notice: Finished catalog run in 0.06 seconds % puppet apply ../test.pp notice: Finished catalog run in 0.04 seconds> 2. Files ntp.conf.el & ntp.conf.debian are located in /etc/puppet/modules/ntp/files - source => ''puppet://puppet:///ntp/files/${conf_file} is this correct? >You should include ''modules'' in the ''puppet://'' URI, since the form without it has been deprecated for a while. IIRC it should look something like: puppet:///modules/ntp/files/${conf_file} -- Jacob Helwig
On Jun 20, 2011, at 2:35 PM, Jacob Helwig wrote:> On Mon, 20 Jun 2011 14:17:46 -0700, Craig White wrote: >> >> my base/default includes this ntp manifest >> >> # cat modules/ntp/manifests/ntp.pp >> # ntp.pp >> >> class ntp { >> case $operatingsystem { >> centos, redhat: { >> $service_name = ''ntpd'' >> $conf_file = ''ntp.conf.el'' >> } >> debian, ubuntu: { >> $service_name = ''ntp'' >> $conf_file = ''ntp.conf.debian'' >> } >> } >> >> package { ''ntp'': >> ensure => installed, >> } >> >> service { ''ntp'': >> name => $service_name, >> ensure => running, >> enable => true, >> subscribe => File[''ntp.conf''], >> } >> >> file { ''ntp.conf'': >> path => ''/etc/ntp.conf'', >> ensure => file, >> require => Package[''ntp''], >> source => "puppet:///ntp/files/${conf_file}", >> } >> } >> >> # class {''ntp'': } >> >> So my questions... >> >> 1. I tested this by moving /etc/ntp.conf on my test client but it doesn''t seem to replace the file though it clearly says ''ensure => file'' >> Is my understanding wrong? >> > > That should replace the file. What output are you getting (if > anything)? > > % cat ../test.pp > file { ''blab'': > path => ''/tmp/blab.txt'', > ensure => ''file'', > content => ''asdf'', > } > > % puppet apply ../test.pp > notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' > notice: Finished catalog run in 0.06 seconds > > % rm /tmp/blab.txt > > % puppet apply ../test.pp > notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' > notice: Finished catalog run in 0.06 seconds > > % puppet apply ../test.pp > notice: Finished catalog run in 0.04 seconds > >> 2. Files ntp.conf.el & ntp.conf.debian are located in /etc/puppet/modules/ntp/files - source => ''puppet://puppet:///ntp/files/${conf_file} is this correct? >> > > You should include ''modules'' in the ''puppet://'' URI, since the form > without it has been deprecated for a while. IIRC it should look > something like: > > puppet:///modules/ntp/files/${conf_file}----- I sort of think it should just work but it doesn''t # mv /etc/ntp.conf /root/ root@ubuntu:/var/www/puppet-dashboard# puppet agent --test --verbose --server ubuntu.ttinet info: Retrieving plugin info: Caching catalog for ubuntu.ttinet info: Applying configuration version ''1308606646'' notice: Finished catalog run in 0.14 seconds still no /etc/ntp.conf root@ubuntu:/var/www/puppet-dashboard# puppet apply /etc/puppet/modules/ntp/manifests/ntp.pp notice: Finished catalog run in 0.01 seconds above is what I got from the ''puppet apply'' command and before from puppet agent command, neither replaced /etc/ntp.conf and neither indicated an error. root@ubuntu:/var/www/puppet-dashboard# ls -l /etc/ntp.conf ls: cannot access /etc/ntp.conf: No such file or directory and this was after I changed the source as you indicated... # tail -n 5 /etc/puppet/modules/ntp/manifests/ntp.pp source => "puppet:///modules/ntp/files/${conf_file}", } } # class {''ntp'': } Craig -- 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 Mon, 20 Jun 2011 15:11:09 -0700, Craig White wrote:> Date: Mon, 20 Jun 2011 15:11:09 -0700 > From: Craig White <craig.white@ttiltd.com> > To: puppet-users@googlegroups.com > Subject: Re: [Puppet Users] confused about file ensure/require > X-Mailer: Apple Mail (2.1084) > Message-Id: <290592DB-A4CD-4982-9EB0-4C5D09D2E42E@ttiltd.com> > > > On Jun 20, 2011, at 2:35 PM, Jacob Helwig wrote: > > > On Mon, 20 Jun 2011 14:17:46 -0700, Craig White wrote: > >> > >> my base/default includes this ntp manifest > >> > >> # cat modules/ntp/manifests/ntp.pp > >> # ntp.pp > >> > >> class ntp { > >> case $operatingsystem { > >> centos, redhat: { > >> $service_name = ''ntpd'' > >> $conf_file = ''ntp.conf.el'' > >> } > >> debian, ubuntu: { > >> $service_name = ''ntp'' > >> $conf_file = ''ntp.conf.debian'' > >> } > >> } > >> > >> package { ''ntp'': > >> ensure => installed, > >> } > >> > >> service { ''ntp'': > >> name => $service_name, > >> ensure => running, > >> enable => true, > >> subscribe => File[''ntp.conf''], > >> } > >> > >> file { ''ntp.conf'': > >> path => ''/etc/ntp.conf'', > >> ensure => file, > >> require => Package[''ntp''], > >> source => "puppet:///ntp/files/${conf_file}", > >> } > >> } > >> > >> # class {''ntp'': } > >> > >> So my questions... > >> > >> 1. I tested this by moving /etc/ntp.conf on my test client but it doesn''t seem to replace the file though it clearly says ''ensure => file'' > >> Is my understanding wrong? > >> > > > > That should replace the file. What output are you getting (if > > anything)? > > > > % cat ../test.pp > > file { ''blab'': > > path => ''/tmp/blab.txt'', > > ensure => ''file'', > > content => ''asdf'', > > } > > > > % puppet apply ../test.pp > > notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' > > notice: Finished catalog run in 0.06 seconds > > > > % rm /tmp/blab.txt > > > > % puppet apply ../test.pp > > notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' > > notice: Finished catalog run in 0.06 seconds > > > > % puppet apply ../test.pp > > notice: Finished catalog run in 0.04 seconds > > > >> 2. Files ntp.conf.el & ntp.conf.debian are located in /etc/puppet/modules/ntp/files - source => ''puppet://puppet:///ntp/files/${conf_file} is this correct? > >> > > > > You should include ''modules'' in the ''puppet://'' URI, since the form > > without it has been deprecated for a while. IIRC it should look > > something like: > > > > puppet:///modules/ntp/files/${conf_file} > ----- > I sort of think it should just work but it doesn''t > > # mv /etc/ntp.conf /root/ > root@ubuntu:/var/www/puppet-dashboard# puppet agent --test --verbose --server ubuntu.ttinet > info: Retrieving plugin > info: Caching catalog for ubuntu.ttinet > info: Applying configuration version ''1308606646'' > notice: Finished catalog run in 0.14 seconds > > still no /etc/ntp.conf > > root@ubuntu:/var/www/puppet-dashboard# puppet apply /etc/puppet/modules/ntp/manifests/ntp.pp > notice: Finished catalog run in 0.01 seconds > > above is what I got from the ''puppet apply'' command and before from puppet agent command, neither replaced /etc/ntp.conf and neither indicated an error. > > root@ubuntu:/var/www/puppet-dashboard# ls -l /etc/ntp.conf > ls: cannot access /etc/ntp.conf: No such file or directory > > and this was after I changed the source as you indicated... > > # tail -n 5 /etc/puppet/modules/ntp/manifests/ntp.pp > source => "puppet:///modules/ntp/files/${conf_file}", > } > } > > # class {''ntp'': } > > Craig >Doesn''t look like you''re including the ntp class? The line that would do it is commented out in /etc/puppet/modules/ntp/manifests/ntp.pp, if you''re going to apply /etc/puppet/modules/ntp/manifests/ntp.pp directly. -- Jacob Helwig
On Jun 20, 2011, at 3:37 PM, Jacob Helwig wrote:> On Mon, 20 Jun 2011 15:11:09 -0700, Craig White wrote: >> Date: Mon, 20 Jun 2011 15:11:09 -0700 >> From: Craig White <craig.white@ttiltd.com> >> To: puppet-users@googlegroups.com >> Subject: Re: [Puppet Users] confused about file ensure/require >> X-Mailer: Apple Mail (2.1084) >> Message-Id: <290592DB-A4CD-4982-9EB0-4C5D09D2E42E@ttiltd.com> >> >> >> On Jun 20, 2011, at 2:35 PM, Jacob Helwig wrote: >> >>> On Mon, 20 Jun 2011 14:17:46 -0700, Craig White wrote: >>>> >>>> my base/default includes this ntp manifest >>>> >>>> # cat modules/ntp/manifests/ntp.pp >>>> # ntp.pp >>>> >>>> class ntp { >>>> case $operatingsystem { >>>> centos, redhat: { >>>> $service_name = ''ntpd'' >>>> $conf_file = ''ntp.conf.el'' >>>> } >>>> debian, ubuntu: { >>>> $service_name = ''ntp'' >>>> $conf_file = ''ntp.conf.debian'' >>>> } >>>> } >>>> >>>> package { ''ntp'': >>>> ensure => installed, >>>> } >>>> >>>> service { ''ntp'': >>>> name => $service_name, >>>> ensure => running, >>>> enable => true, >>>> subscribe => File[''ntp.conf''], >>>> } >>>> >>>> file { ''ntp.conf'': >>>> path => ''/etc/ntp.conf'', >>>> ensure => file, >>>> require => Package[''ntp''], >>>> source => "puppet:///ntp/files/${conf_file}", >>>> } >>>> } >>>> >>>> # class {''ntp'': } >>>> >>>> So my questions... >>>> >>>> 1. I tested this by moving /etc/ntp.conf on my test client but it doesn''t seem to replace the file though it clearly says ''ensure => file'' >>>> Is my understanding wrong? >>>> >>> >>> That should replace the file. What output are you getting (if >>> anything)? >>> >>> % cat ../test.pp >>> file { ''blab'': >>> path => ''/tmp/blab.txt'', >>> ensure => ''file'', >>> content => ''asdf'', >>> } >>> >>> % puppet apply ../test.pp >>> notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' >>> notice: Finished catalog run in 0.06 seconds >>> >>> % rm /tmp/blab.txt >>> >>> % puppet apply ../test.pp >>> notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' >>> notice: Finished catalog run in 0.06 seconds >>> >>> % puppet apply ../test.pp >>> notice: Finished catalog run in 0.04 seconds >>> >>>> 2. Files ntp.conf.el & ntp.conf.debian are located in /etc/puppet/modules/ntp/files - source => ''puppet://puppet:///ntp/files/${conf_file} is this correct? >>>> >>> >>> You should include ''modules'' in the ''puppet://'' URI, since the form >>> without it has been deprecated for a while. IIRC it should look >>> something like: >>> >>> puppet:///modules/ntp/files/${conf_file} >> ----- >> I sort of think it should just work but it doesn''t >> >> # mv /etc/ntp.conf /root/ >> root@ubuntu:/var/www/puppet-dashboard# puppet agent --test --verbose --server ubuntu.ttinet >> info: Retrieving plugin >> info: Caching catalog for ubuntu.ttinet >> info: Applying configuration version ''1308606646'' >> notice: Finished catalog run in 0.14 seconds >> >> still no /etc/ntp.conf >> >> root@ubuntu:/var/www/puppet-dashboard# puppet apply /etc/puppet/modules/ntp/manifests/ntp.pp >> notice: Finished catalog run in 0.01 seconds >> >> above is what I got from the ''puppet apply'' command and before from puppet agent command, neither replaced /etc/ntp.conf and neither indicated an error. >> >> root@ubuntu:/var/www/puppet-dashboard# ls -l /etc/ntp.conf >> ls: cannot access /etc/ntp.conf: No such file or directory >> >> and this was after I changed the source as you indicated... >> >> # tail -n 5 /etc/puppet/modules/ntp/manifests/ntp.pp >> source => "puppet:///modules/ntp/files/${conf_file}", >> } >> } >> >> # class {''ntp'': } >> >> Craig >> > > Doesn''t look like you''re including the ntp class? > > The line that would do it is commented out in > /etc/puppet/modules/ntp/manifests/ntp.pp, if you''re going to apply > /etc/puppet/modules/ntp/manifests/ntp.pp directly.---- I thought it should work at least for the ''puppet agent'' commands... # cat manifests/site.pp import "templates" import "nodes" import "modules" root@ubuntu:/etc/puppet# cat manifests/templates.pp class baseclass { } node default { include baseclass include ntp include facts } and the nodes all have include baseclass in them Craig -- 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.
It does seem like its not being included :-) ... What does: echo "# foo" >> /etc/ntp.conf puppet apply -d -e ''include ntp'' Do? ken. On Mon, Jun 20, 2011 at 11:46 PM, Craig White <craig.white@ttiltd.com> wrote:> > On Jun 20, 2011, at 3:37 PM, Jacob Helwig wrote: > >> On Mon, 20 Jun 2011 15:11:09 -0700, Craig White wrote: >>> Date: Mon, 20 Jun 2011 15:11:09 -0700 >>> From: Craig White <craig.white@ttiltd.com> >>> To: puppet-users@googlegroups.com >>> Subject: Re: [Puppet Users] confused about file ensure/require >>> X-Mailer: Apple Mail (2.1084) >>> Message-Id: <290592DB-A4CD-4982-9EB0-4C5D09D2E42E@ttiltd.com> >>> >>> >>> On Jun 20, 2011, at 2:35 PM, Jacob Helwig wrote: >>> >>>> On Mon, 20 Jun 2011 14:17:46 -0700, Craig White wrote: >>>>> >>>>> my base/default includes this ntp manifest >>>>> >>>>> # cat modules/ntp/manifests/ntp.pp >>>>> # ntp.pp >>>>> >>>>> class ntp { >>>>> case $operatingsystem { >>>>> centos, redhat: { >>>>> $service_name = ''ntpd'' >>>>> $conf_file = ''ntp.conf.el'' >>>>> } >>>>> debian, ubuntu: { >>>>> $service_name = ''ntp'' >>>>> $conf_file = ''ntp.conf.debian'' >>>>> } >>>>> } >>>>> >>>>> package { ''ntp'': >>>>> ensure => installed, >>>>> } >>>>> >>>>> service { ''ntp'': >>>>> name => $service_name, >>>>> ensure => running, >>>>> enable => true, >>>>> subscribe => File[''ntp.conf''], >>>>> } >>>>> >>>>> file { ''ntp.conf'': >>>>> path => ''/etc/ntp.conf'', >>>>> ensure => file, >>>>> require => Package[''ntp''], >>>>> source => "puppet:///ntp/files/${conf_file}", >>>>> } >>>>> } >>>>> >>>>> # class {''ntp'': } >>>>> >>>>> So my questions... >>>>> >>>>> 1. I tested this by moving /etc/ntp.conf on my test client but it doesn''t seem to replace the file though it clearly says ''ensure => file'' >>>>> Is my understanding wrong? >>>>> >>>> >>>> That should replace the file. What output are you getting (if >>>> anything)? >>>> >>>> % cat ../test.pp >>>> file { ''blab'': >>>> path => ''/tmp/blab.txt'', >>>> ensure => ''file'', >>>> content => ''asdf'', >>>> } >>>> >>>> % puppet apply ../test.pp >>>> notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' >>>> notice: Finished catalog run in 0.06 seconds >>>> >>>> % rm /tmp/blab.txt >>>> >>>> % puppet apply ../test.pp >>>> notice: /Stage[main]//File[blab]/ensure: defined content as ''{md5}912ec803b2ce49e4a541068d495ab570'' >>>> notice: Finished catalog run in 0.06 seconds >>>> >>>> % puppet apply ../test.pp >>>> notice: Finished catalog run in 0.04 seconds >>>> >>>>> 2. Files ntp.conf.el & ntp.conf.debian are located in /etc/puppet/modules/ntp/files - source => ''puppet://puppet:///ntp/files/${conf_file} is this correct? >>>>> >>>> >>>> You should include ''modules'' in the ''puppet://'' URI, since the form >>>> without it has been deprecated for a while. IIRC it should look >>>> something like: >>>> >>>> puppet:///modules/ntp/files/${conf_file} >>> ----- >>> I sort of think it should just work but it doesn''t >>> >>> # mv /etc/ntp.conf /root/ >>> root@ubuntu:/var/www/puppet-dashboard# puppet agent --test --verbose --server ubuntu.ttinet >>> info: Retrieving plugin >>> info: Caching catalog for ubuntu.ttinet >>> info: Applying configuration version ''1308606646'' >>> notice: Finished catalog run in 0.14 seconds >>> >>> still no /etc/ntp.conf >>> >>> root@ubuntu:/var/www/puppet-dashboard# puppet apply /etc/puppet/modules/ntp/manifests/ntp.pp >>> notice: Finished catalog run in 0.01 seconds >>> >>> above is what I got from the ''puppet apply'' command and before from puppet agent command, neither replaced /etc/ntp.conf and neither indicated an error. >>> >>> root@ubuntu:/var/www/puppet-dashboard# ls -l /etc/ntp.conf >>> ls: cannot access /etc/ntp.conf: No such file or directory >>> >>> and this was after I changed the source as you indicated... >>> >>> # tail -n 5 /etc/puppet/modules/ntp/manifests/ntp.pp >>> source => "puppet:///modules/ntp/files/${conf_file}", >>> } >>> } >>> >>> # class {''ntp'': } >>> >>> Craig >>> >> >> Doesn''t look like you''re including the ntp class? >> >> The line that would do it is commented out in >> /etc/puppet/modules/ntp/manifests/ntp.pp, if you''re going to apply >> /etc/puppet/modules/ntp/manifests/ntp.pp directly. > ---- > I thought it should work at least for the ''puppet agent'' commands... > > # cat manifests/site.pp > import "templates" > import "nodes" > import "modules" > > root@ubuntu:/etc/puppet# cat manifests/templates.pp > class baseclass { > } > > node default { > include baseclass > include ntp > include facts > } > > and the nodes all have > > include baseclass > > in them > > Craig > > -- > 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. > >-- 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.
I don''t know if it is or isn''t being included but the -d -e were certainly useful bits... err: /Stage[main]/Ntp/File[ntp.conf]: Could not evaluate: Could not retrieve information from source(s) puppet:///modules/ntp/files/ntp.conf.debian at /etc/puppet/modules/ntp/manifests/ntp.pp:31 notice: /Stage[main]/Ntp/Service[ntp]: Dependency File[ntp.conf] has failures: true but the file is clearly somewhere... # ls -l /etc/puppet/modules/ntp/files/ntp.conf.debian -rw-r--r-- 1 root root 535 2011-06-13 12:55 /etc/puppet/modules/ntp/files/ntp.conf.debian and as noted below, the source is indicated to be source => puppet:///modules/ntp/files/ntp.conf.debian which is the same 2 questions I started with since I have the ''Puppet Pro'' book in my hand and various references on the puppetlabs documentation web pages and I was pretty much of the opinion that this should be working. Craig On Jun 20, 2011, at 3:54 PM, Ken Barber wrote:> It does seem like its not being included :-) ... > > What does: > > echo "# foo" >> /etc/ntp.conf > puppet apply -d -e ''include ntp'' > > Do? > > ken. > >> ---- >> I thought it should work at least for the ''puppet agent'' commands... >> >> # cat manifests/site.pp >> import "templates" >> import "nodes" >> import "modules" >> >> root@ubuntu:/etc/puppet# cat manifests/templates.pp >> class baseclass { >> } >> >> node default { >> include baseclass >> include ntp >> include facts >> } >> >> and the nodes all have >> >> include baseclass >> >> in them >> >> Craig >>-- 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 Jun 20, 2011, at 3:54 PM, Ken Barber wrote:> It does seem like its not being included :-) ... > > What does: > > echo "# foo" >> /etc/ntp.conf > puppet apply -d -e ''include ntp'' > > Do?---- OK - I simplified the chaining so now the ntp is indeed included with all puppet agent and puppetd actions. but apparently I am caching the previous configuration and perhaps because I am set up to be in ''production'' mode, this means that configuration changes aren''t necessarily understood. on my puppet client... # puppet agent --test --verbose --server ubuntu.ttinet info: Retrieving plugin info: Loading facts in datacenter info: Loading facts in datacenter info: Caching catalog for ubuntu2.ttinet info: Applying configuration version ''1308612492'' err: /Stage[main]/Ntp/File[ntp.conf]: Could not evaluate: Could not retrieve information from source(s) puppet:///modules/ntp/files/ntp.conf.debian at /etc/puppet/modules/ntp/manifests/ntp.pp:31 notice: /Stage[main]/Ntp/Service[ntp]: Dependency File[ntp.conf] has failures: true warning: /Stage[main]/Ntp/Service[ntp]: Skipping because of failed dependencies notice: Finished catalog run in 0.11 seconds but I changed the source to source => "source => "puppet://$puppetserver/modules/ntp/files/${conf_file}" but even after restarting puppetd or just invoking the puppet agent command (above), it still seems to use the ''file'' based URL even after restarting puppetmaster on the server, still the same as above How do I clear the cached catalog? Craig -- 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.
I don''t think you should be specifying the "files" part of the source path: Try: source => puppet:///modules/ntp/ntp.conf.debian - Jeff On 06/20/2011 06:12 PM, Craig White wrote:> I don''t know if it is or isn''t being included but the -d -e were certainly useful bits... > > err: /Stage[main]/Ntp/File[ntp.conf]: Could not evaluate: Could not retrieve information from source(s) puppet:///modules/ntp/files/ntp.conf.debian at /etc/puppet/modules/ntp/manifests/ntp.pp:31 > notice: /Stage[main]/Ntp/Service[ntp]: Dependency File[ntp.conf] has failures: true > > but the file is clearly somewhere... > > # ls -l /etc/puppet/modules/ntp/files/ntp.conf.debian > -rw-r--r-- 1 root root 535 2011-06-13 12:55 /etc/puppet/modules/ntp/files/ntp.conf.debian > > and as noted below, the source is indicated to be > > source => puppet:///modules/ntp/files/ntp.conf.debian > > which is the same 2 questions I started with since I have the ''Puppet Pro'' book in my hand and various references on the puppetlabs documentation web pages and I was pretty much of the opinion that this should be working. > > Craig > > On Jun 20, 2011, at 3:54 PM, Ken Barber wrote: > >> It does seem like its not being included :-) ... >> >> What does: >> >> echo "# foo">> /etc/ntp.conf >> puppet apply -d -e ''include ntp'' >> >> Do? >> >> ken. >> >>> ---- >>> I thought it should work at least for the ''puppet agent'' commands... >>> >>> # cat manifests/site.pp >>> import "templates" >>> import "nodes" >>> import "modules" >>> >>> root@ubuntu:/etc/puppet# cat manifests/templates.pp >>> class baseclass { >>> } >>> >>> node default { >>> include baseclass >>> include ntp >>> include facts >>> } >>> >>> and the nodes all have >>> >>> include baseclass >>> >>> in them >>> >>> Craig >>> > >-- 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 Jun 20, 2011, at 3:54 PM, Ken Barber wrote:> It does seem like its not being included :-) ... > > What does: > > echo "# foo" >> /etc/ntp.conf > puppet apply -d -e ''include ntp'' > > Do?---- seems so basic - output at bottom I have gone over and over the Pro Puppet book and the http://docs.puppetlabs.com/guides/file_serving.html page and they both are the same and this should absolutely work. # cat modules/ntp/manifests/ntp.pp # ntp.pp class ntp { case $operatingsystem { centos, redhat: { $service_name = ''ntpd'' $conf_file = ''ntp.conf.el'' } debian, ubuntu: { $service_name = ''ntp'' $conf_file = ''ntp.conf.debian'' } } package { ''ntp'': ensure => installed, } service { ''ntp'': name => $service_name, ensure => running, enable => true, subscribe => File[''ntp.conf''], } file { ''ntp.conf'': path => ''/etc/ntp.conf'', ensure => file, require => Package[''ntp''], source => "puppet:///modules/ntp/files/${conf_file}", } } # class {''ntp'': } but no matter what I do, it always errors and says it can''t find /etc/puppet/modules/ntp/files/ntp.conf.debian but yet it is there and readable all the way... # ls -l /etc/puppet/modules/ntp/files/ntp.conf.debian -rw-r--r-- 1 root root 535 2011-06-13 12:55 /etc/puppet/modules/ntp/files/ntp.conf.debian anyway, the output as requested... Thanks Craig # puppet apply -d -e ''include ntp'' info: Loading facts in datacenter info: Loading facts in datacenter debug: importing ''/etc/puppet/modules/ntp/manifests/init.pp'' in environment production debug: importing ''/etc/puppet/modules/ntp/manifests/ntp.pp'' in environment production debug: Automatically imported ntp from ntp into production debug: Failed to load library ''selinux'' for feature ''selinux'' debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does not exist debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does not exist debug: Puppet::Type::Package::ProviderYum: file yum does not exist debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does not exist debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not exist debug: Puppet::Type::Package::ProviderAptrpm: file rpm does not exist debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not exist debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not exist debug: Puppet::Type::Package::ProviderPorts: file /usr/local/sbin/portversion does not exist debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_delete does not exist debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/local/sbin/portversion does not exist debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does not exist debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_delete does not exist debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox does not exist debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist debug: Puppet::Type::Package::ProviderSun: file /usr/sbin/pkgadd does not exist debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not exist debug: Puppet::Type::Service::ProviderRedhat: file /sbin/service does not exist debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not exist debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not exist debug: Puppet::Type::File::ProviderMicrosoft_windows: feature microsoft_windows is missing debug: Creating default schedules debug: Failed to load library ''shadow'' for feature ''libshadow'' debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist debug: Puppet::Type::User::ProviderPw: file pw does not exist debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist debug: Puppet::Type::User::ProviderLdap: true value when expecting false debug: /File[/etc/puppet/ssl/certs/ca.pem]: Autorequiring File[/etc/puppet/ssl/certs] debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/var/lib/puppet/state] debug: /File[/etc/puppet/ssl/certs]: Autorequiring File[/etc/puppet/ssl] debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet] debug: /File[/etc/puppet/ssl/crl.pem]: Autorequiring File[/etc/puppet/ssl] debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring File[/etc/puppet/ssl] debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet] debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet] debug: /File[/etc/puppet/ssl/certs/ubuntu.ttinet.pem]: Autorequiring File[/etc/puppet/ssl/certs] debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring File[/etc/puppet/ssl] debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet] debug: /File[/etc/puppet/ssl]: Autorequiring File[/etc/puppet] debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state] debug: /File[/etc/puppet/ssl/public_keys/ubuntu.ttinet.pem]: Autorequiring File[/etc/puppet/ssl/public_keys] debug: /File[/etc/puppet/ssl/private_keys/ubuntu.ttinet.pem]: Autorequiring File[/etc/puppet/ssl/private_keys] debug: /File[/var/lib/puppet/state/classes.txt]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring File[/var/lib/puppet/state] debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet] debug: /File[/etc/puppet/ssl/private]: Autorequiring File[/etc/puppet/ssl] debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet] debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring File[/etc/puppet/ssl] debug: Finishing transaction 23094380 debug: Loaded state in 0.00 seconds debug: Loaded state in 0.00 seconds debug: Prefetching apt resources for package debug: Executing ''/usr/bin/dpkg-query -W --showformat ''${Status} ${Package} ${Version}\n'''' debug: Puppet::Type::Package::ProviderApt: Executing ''/usr/bin/dpkg-query -W --showformat ''${Status} ${Package} ${Version}\n'''' debug: /Stage[main]/Ntp/Service[ntp]/subscribe: subscribes to File[ntp.conf] debug: /Stage[main]/Ntp/File[ntp.conf]/require: requires Package[ntp] info: Applying configuration version ''1308671777'' err: /Stage[main]/Ntp/File[ntp.conf]: Could not evaluate: Could not retrieve information from source(s) puppet:///modules/ntp/files/ntp.conf.debian at /etc/puppet/modules/ntp/manifests/ntp.pp:31 notice: /Stage[main]/Ntp/Service[ntp]: Dependency File[ntp.conf] has failures: true warning: /Stage[main]/Ntp/Service[ntp]: Skipping because of failed dependencies debug: Finishing transaction 22597140 debug: Storing state debug: Stored state in 0.00 seconds notice: Finished catalog run in 0.08 seconds root@ubuntu:/etc/puppet# -- 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 Tue, Jun 21, 2011 at 9:03 AM, Craig White <craig.white@ttiltd.com> wrote:> > On Jun 20, 2011, at 3:54 PM, Ken Barber wrote: > > > It does seem like its not being included :-) ... > > > > What does: > > > > echo "# foo" >> /etc/ntp.conf > > puppet apply -d -e ''include ntp'' > > > > Do? > ---- > seems so basic - output at bottom > > I have gone over and over the Pro Puppet book and the > http://docs.puppetlabs.com/guides/file_serving.html page and they both are > the same and this should absolutely work. > > # cat modules/ntp/manifests/ntp.pp > # ntp.pp > > class ntp { > case $operatingsystem { > centos, redhat: { > $service_name = ''ntpd'' > $conf_file = ''ntp.conf.el'' > } > debian, ubuntu: { > $service_name = ''ntp'' > $conf_file = ''ntp.conf.debian'' > } > } > > package { ''ntp'': > ensure => installed, > } > > service { ''ntp'': > name => $service_name, > ensure => running, > enable => true, > subscribe => File[''ntp.conf''], > } > > file { ''ntp.conf'': > path => ''/etc/ntp.conf'', > ensure => file, > require => Package[''ntp''], > source => "puppet:///modules/ntp/files/${conf_file}", >Take the "files" out of the source settings. the filesystem path: $modulepath/ntp/files/foo translates to the puppet:// url: puppet:///modules/ntp/foo> } > } > > # class {''ntp'': } > > but no matter what I do, it always errors and says it can''t find > /etc/puppet/modules/ntp/files/ntp.conf.debian but yet it is there and > readable all the way... > > # ls -l /etc/puppet/modules/ntp/files/ntp.conf.debian > -rw-r--r-- 1 root root 535 2011-06-13 12:55 > /etc/puppet/modules/ntp/files/ntp.conf.debian > > anyway, the output as requested... > > Thanks > > Craig > > # puppet apply -d -e ''include ntp'' > info: Loading facts in datacenter > info: Loading facts in datacenter > debug: importing ''/etc/puppet/modules/ntp/manifests/init.pp'' in environment > production > debug: importing ''/etc/puppet/modules/ntp/manifests/ntp.pp'' in environment > production > debug: Automatically imported ntp from ntp into production > debug: Failed to load library ''selinux'' for feature ''selinux'' > debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist > debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does > not exist > debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist > debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does > not exist > debug: Puppet::Type::Package::ProviderYum: file yum does not exist > debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does not > exist > debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not > exist > debug: Puppet::Type::Package::ProviderAptrpm: file rpm does not exist > debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not > exist > debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not > exist > debug: Puppet::Type::Package::ProviderPorts: file > /usr/local/sbin/portversion does not exist > debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_delete does not > exist > debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist > debug: Puppet::Type::Package::ProviderPortupgrade: file > /usr/local/sbin/portversion does not exist > debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does > not exist > debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_delete > does not exist > debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox > does not exist > debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist > debug: Puppet::Type::Package::ProviderSun: file /usr/sbin/pkgadd does not > exist > debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not > exist > debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not > exist > debug: Puppet::Type::Service::ProviderRedhat: file /sbin/service does not > exist > debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not > exist > debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does > not exist > debug: Puppet::Type::File::ProviderMicrosoft_windows: feature > microsoft_windows is missing > debug: Creating default schedules > debug: Failed to load library ''shadow'' for feature ''libshadow'' > debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not > exist > debug: Puppet::Type::User::ProviderPw: file pw does not exist > debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl > does not exist > debug: Puppet::Type::User::ProviderLdap: true value when expecting false > debug: /File[/etc/puppet/ssl/certs/ca.pem]: Autorequiring > File[/etc/puppet/ssl/certs] > debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring > File[/var/lib/puppet/state] > debug: /File[/etc/puppet/ssl/certs]: Autorequiring File[/etc/puppet/ssl] > debug: /File[/var/lib/puppet/client_data]: Autorequiring > File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl/crl.pem]: Autorequiring File[/etc/puppet/ssl] > debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring > File[/etc/puppet/ssl] > debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet] > debug: /File[/var/lib/puppet/client_yaml]: Autorequiring > File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl/certs/ubuntu.ttinet.pem]: Autorequiring > File[/etc/puppet/ssl/certs] > debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring > File[/etc/puppet/ssl] > debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl]: Autorequiring File[/etc/puppet] > debug: /File[/var/lib/puppet/state/graphs]: Autorequiring > File[/var/lib/puppet/state] > debug: /File[/etc/puppet/ssl/public_keys/ubuntu.ttinet.pem]: Autorequiring > File[/etc/puppet/ssl/public_keys] > debug: /File[/etc/puppet/ssl/private_keys/ubuntu.ttinet.pem]: Autorequiring > File[/etc/puppet/ssl/private_keys] > debug: /File[/var/lib/puppet/state/classes.txt]: Autorequiring > File[/var/lib/puppet/state] > debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring > File[/var/lib/puppet/state] > debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring > File[/var/lib/puppet/state] > debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl/private]: Autorequiring File[/etc/puppet/ssl] > debug: /File[/var/lib/puppet/clientbucket]: Autorequiring > File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring > File[/etc/puppet/ssl] > debug: Finishing transaction 23094380 > debug: Loaded state in 0.00 seconds > debug: Loaded state in 0.00 seconds > debug: Prefetching apt resources for package > debug: Executing ''/usr/bin/dpkg-query -W --showformat ''${Status} ${Package} > ${Version}\n'''' > debug: Puppet::Type::Package::ProviderApt: Executing ''/usr/bin/dpkg-query > -W --showformat ''${Status} ${Package} ${Version}\n'''' > debug: /Stage[main]/Ntp/Service[ntp]/subscribe: subscribes to > File[ntp.conf] > debug: /Stage[main]/Ntp/File[ntp.conf]/require: requires Package[ntp] > info: Applying configuration version ''1308671777'' > err: /Stage[main]/Ntp/File[ntp.conf]: Could not evaluate: Could not > retrieve information from source(s) > puppet:///modules/ntp/files/ntp.conf.debian at > /etc/puppet/modules/ntp/manifests/ntp.pp:31 > notice: /Stage[main]/Ntp/Service[ntp]: Dependency File[ntp.conf] has > failures: true > warning: /Stage[main]/Ntp/Service[ntp]: Skipping because of failed > dependencies > debug: Finishing transaction 22597140 > debug: Storing state > debug: Stored state in 0.00 seconds > notice: Finished catalog run in 0.08 seconds > root@ubuntu:/etc/puppet# > > -- > 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. > >-- Nigel Kersten Product, Puppet Labs @nigelkersten -- 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.
Daniel Piddock
2011-Jun-21 16:09 UTC
Re: [Puppet Users] confused about file ensure/require
On 21/06/11 17:03, Craig White wrote:> On Jun 20, 2011, at 3:54 PM, Ken Barber wrote: > >> It does seem like its not being included :-) ... >> >> What does: >> >> echo "# foo" >> /etc/ntp.conf >> puppet apply -d -e ''include ntp'' >> >> Do? > ---- > seems so basic - output at bottom > > I have gone over and over the Pro Puppet book and the http://docs.puppetlabs.com/guides/file_serving.html page and they both are the same and this should absolutely work. > > # cat modules/ntp/manifests/ntp.pp > # ntp.pp > > class ntp { > case $operatingsystem { > centos, redhat: { > $service_name = ''ntpd'' > $conf_file = ''ntp.conf.el'' > } > debian, ubuntu: { > $service_name = ''ntp'' > $conf_file = ''ntp.conf.debian'' > } > } > > package { ''ntp'': > ensure => installed, > } > > service { ''ntp'': > name => $service_name, > ensure => running, > enable => true, > subscribe => File[''ntp.conf''], > } > > file { ''ntp.conf'': > path => ''/etc/ntp.conf'', > ensure => file, > require => Package[''ntp''], > source => "puppet:///modules/ntp/files/${conf_file}", > } > } > > # class {''ntp'': } > > but no matter what I do, it always errors and says it can''t find /etc/puppet/modules/ntp/files/ntp.conf.debian but yet it is there and readable all the way...You don''t want the /files/ bit. Puppet automatically looks for module files in the /files/ subfolder. Currently puppet is trying to access /etc/puppet/modules/ntp/files/files/ntp.conf.debian which doesn''t exist :) All you need is: source => "puppet:///modules/ntp/${conf_file}" HTH Dan> # ls -l /etc/puppet/modules/ntp/files/ntp.conf.debian > -rw-r--r-- 1 root root 535 2011-06-13 12:55 /etc/puppet/modules/ntp/files/ntp.conf.debian > > anyway, the output as requested... > > Thanks > > Craig-- 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 Jun 21, 2011, at 9:09 AM, Nigel Kersten wrote:> > > On Tue, Jun 21, 2011 at 9:03 AM, Craig White <craig.white@ttiltd.com> wrote: > > On Jun 20, 2011, at 3:54 PM, Ken Barber wrote: > > > It does seem like its not being included :-) ... > > > > What does: > > > > echo "# foo" >> /etc/ntp.conf > > puppet apply -d -e ''include ntp'' > > > > Do? > ---- > seems so basic - output at bottom > > I have gone over and over the Pro Puppet book and the http://docs.puppetlabs.com/guides/file_serving.html page and they both are the same and this should absolutely work. > > # cat modules/ntp/manifests/ntp.pp > # ntp.pp > > class ntp { > case $operatingsystem { > centos, redhat: { > $service_name = ''ntpd'' > $conf_file = ''ntp.conf.el'' > } > debian, ubuntu: { > $service_name = ''ntp'' > $conf_file = ''ntp.conf.debian'' > } > } > > package { ''ntp'': > ensure => installed, > } > > service { ''ntp'': > name => $service_name, > ensure => running, > enable => true, > subscribe => File[''ntp.conf''], > } > > file { ''ntp.conf'': > path => ''/etc/ntp.conf'', > ensure => file, > require => Package[''ntp''], > source => "puppet:///modules/ntp/files/${conf_file}", > > Take the "files" out of the source settings. > > the filesystem path: > > $modulepath/ntp/files/foo > > translates to the puppet:// url: > > puppet:///modules/ntp/foo---- Indeed - thanks - it was making me crazy. I suspect that there was a very good reason for doing that (omitting the ''files'' from the path) but it completely eludes me. Craig -- 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.
Check your source declaration.> source => "puppet:///modules/ntp/files/${conf_file}",If your files are in modules/ntp/files you don''t include that in your source declaration> source => "puppet:///modules/ntp/${conf_file}",http://docs.puppetlabs.com/guides/file_serving.html Cheers, Den On 22/06/2011, at 2:03, Craig White <craig.white@ttiltd.com> wrote:> > On Jun 20, 2011, at 3:54 PM, Ken Barber wrote: > >> It does seem like its not being included :-) ... >> >> What does: >> >> echo "# foo" >> /etc/ntp.conf >> puppet apply -d -e ''include ntp'' >> >> Do? > ---- > seems so basic - output at bottom > > I have gone over and over the Pro Puppet book and the http://docs.puppetlabs.com/guides/file_serving.html page and they both are the same and this should absolutely work. > > # cat modules/ntp/manifests/ntp.pp > # ntp.pp > > class ntp { > case $operatingsystem { > centos, redhat: { > $service_name = ''ntpd'' > $conf_file = ''ntp.conf.el'' > } > debian, ubuntu: { > $service_name = ''ntp'' > $conf_file = ''ntp.conf.debian'' > } > } > > package { ''ntp'': > ensure => installed, > } > > service { ''ntp'': > name => $service_name, > ensure => running, > enable => true, > subscribe => File[''ntp.conf''], > } > > file { ''ntp.conf'': > path => ''/etc/ntp.conf'', > ensure => file, > require => Package[''ntp''], > source => "puppet:///modules/ntp/files/${conf_file}", > } > } > > # class {''ntp'': } > > but no matter what I do, it always errors and says it can''t find /etc/puppet/modules/ntp/files/ntp.conf.debian but yet it is there and readable all the way... > > # ls -l /etc/puppet/modules/ntp/files/ntp.conf.debian > -rw-r--r-- 1 root root 535 2011-06-13 12:55 /etc/puppet/modules/ntp/files/ntp.conf.debian > > anyway, the output as requested... > > Thanks > > Craig > > # puppet apply -d -e ''include ntp'' > info: Loading facts in datacenter > info: Loading facts in datacenter > debug: importing ''/etc/puppet/modules/ntp/manifests/init.pp'' in environment production > debug: importing ''/etc/puppet/modules/ntp/manifests/ntp.pp'' in environment production > debug: Automatically imported ntp from ntp into production > debug: Failed to load library ''selinux'' for feature ''selinux'' > debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist > debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does not exist > debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist > debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does not exist > debug: Puppet::Type::Package::ProviderYum: file yum does not exist > debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does not exist > debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not exist > debug: Puppet::Type::Package::ProviderAptrpm: file rpm does not exist > debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not exist > debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not exist > debug: Puppet::Type::Package::ProviderPorts: file /usr/local/sbin/portversion does not exist > debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_delete does not exist > debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist > debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/local/sbin/portversion does not exist > debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does not exist > debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_delete does not exist > debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox does not exist > debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist > debug: Puppet::Type::Package::ProviderSun: file /usr/sbin/pkgadd does not exist > debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist > debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not exist > debug: Puppet::Type::Service::ProviderRedhat: file /sbin/service does not exist > debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not exist > debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not exist > debug: Puppet::Type::File::ProviderMicrosoft_windows: feature microsoft_windows is missing > debug: Creating default schedules > debug: Failed to load library ''shadow'' for feature ''libshadow'' > debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist > debug: Puppet::Type::User::ProviderPw: file pw does not exist > debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist > debug: Puppet::Type::User::ProviderLdap: true value when expecting false > debug: /File[/etc/puppet/ssl/certs/ca.pem]: Autorequiring File[/etc/puppet/ssl/certs] > debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/var/lib/puppet/state] > debug: /File[/etc/puppet/ssl/certs]: Autorequiring File[/etc/puppet/ssl] > debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl/crl.pem]: Autorequiring File[/etc/puppet/ssl] > debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring File[/etc/puppet/ssl] > debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet] > debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl/certs/ubuntu.ttinet.pem]: Autorequiring File[/etc/puppet/ssl/certs] > debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring File[/etc/puppet/ssl] > debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl]: Autorequiring File[/etc/puppet] > debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state] > debug: /File[/etc/puppet/ssl/public_keys/ubuntu.ttinet.pem]: Autorequiring File[/etc/puppet/ssl/public_keys] > debug: /File[/etc/puppet/ssl/private_keys/ubuntu.ttinet.pem]: Autorequiring File[/etc/puppet/ssl/private_keys] > debug: /File[/var/lib/puppet/state/classes.txt]: Autorequiring File[/var/lib/puppet/state] > debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring File[/var/lib/puppet/state] > debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring File[/var/lib/puppet/state] > debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl/private]: Autorequiring File[/etc/puppet/ssl] > debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet] > debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring File[/etc/puppet/ssl] > debug: Finishing transaction 23094380 > debug: Loaded state in 0.00 seconds > debug: Loaded state in 0.00 seconds > debug: Prefetching apt resources for package > debug: Executing ''/usr/bin/dpkg-query -W --showformat ''${Status} ${Package} ${Version}\n'''' > debug: Puppet::Type::Package::ProviderApt: Executing ''/usr/bin/dpkg-query -W --showformat ''${Status} ${Package} ${Version}\n'''' > debug: /Stage[main]/Ntp/Service[ntp]/subscribe: subscribes to File[ntp.conf] > debug: /Stage[main]/Ntp/File[ntp.conf]/require: requires Package[ntp] > info: Applying configuration version ''1308671777'' > err: /Stage[main]/Ntp/File[ntp.conf]: Could not evaluate: Could not retrieve information from source(s) puppet:///modules/ntp/files/ntp.conf.debian at /etc/puppet/modules/ntp/manifests/ntp.pp:31 > notice: /Stage[main]/Ntp/Service[ntp]: Dependency File[ntp.conf] has failures: true > warning: /Stage[main]/Ntp/Service[ntp]: Skipping because of failed dependencies > debug: Finishing transaction 22597140 > debug: Storing state > debug: Stored state in 0.00 seconds > notice: Finished catalog run in 0.08 seconds > root@ubuntu:/etc/puppet# > > -- > 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. >-- 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.