jasper.hargreaves@m-w.co.uk
2011-Nov-29 14:06 UTC
[Puppet Users] ensure => file, creating directories
Hi all, Recently upgraded one of our puppet servers from 2.6.4 to 2.7.5, and we''re noticing some rather odd behaviour. What''s always traditionally worked for creating ini files and the like, is now creating directories instead of files (indeed, replacing my existing files with directories, which had some rather catastrophic consequences for the poor poor test systems). Even when hard coding ensure => file, instead of a passing a parameter... it creates a directory. The type parameter just doesn''t seem to be doing as it''s told. Roll back to previous version of puppet server, it''s all happy again (though it can''t convert the directory back to a file, but that''ll be a separate issue entirely). Anybody have any clues as where else would be worth looking in trying to resolve this? relevant section of files: file { $name: name => "${path}${name}", mode => $mode, owner => $owner, group => $group, backup => $backup, recurse => $recurse, ensure => $ensure, source => [ "puppet://puppet/modules/standalone-configs/$folder/$name-$type- $fqdn", "puppet://puppet/modules/standalone-configs/$folder/$name-$type- $operatingsystem", "puppet://puppet/modules/standalone-configs/$folder/$name-$type- $default", "puppet://puppet/modules/standalone-configs/$folder/$name-$fqdn", "puppet://puppet/modules/standalone-configs/$folder/$name- $operatingsystem", "puppet://puppet/modules/standalone-configs/$folder/$name-default" ], notify => $notify Thanks! -- 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, Nov 29, 2011 at 2:06 PM, jasper.hargreaves@m-w.co.uk <jasper.hargreaves@m-w.co.uk> wrote:> Hi all, > > Recently upgraded one of our puppet servers from 2.6.4 to 2.7.5, and > we''re noticing some rather odd behaviour. > What''s always traditionally worked for creating ini files and the > like, is now creating directories instead of files (indeed, replacing > my existing files with directories, which had some rather catastrophic > consequences for the poor poor test systems). > > Even when hard coding ensure => file, instead of a passing a > parameter... it creates a directory. > The type parameter just doesn''t seem to be doing as it''s told. Roll > back to previous version of puppet server, it''s all happy again > (though it can''t convert the directory back to a file, but that''ll be > a separate issue entirely). > > Anybody have any clues as where else would be worth looking in trying > to resolve this? > > > relevant section of files: > > file { $name: > name => "${path}${name}", > mode => $mode, > owner => $owner, > group => $group, > backup => $backup, > recurse => $recurse, > ensure => $ensure, > source => [ > "puppet://puppet/modules/standalone-configs/$folder/$name-$type- > $fqdn", > "puppet://puppet/modules/standalone-configs/$folder/$name-$type- > $operatingsystem", > "puppet://puppet/modules/standalone-configs/$folder/$name-$type- > $default", > "puppet://puppet/modules/standalone-configs/$folder/$name-$fqdn", > "puppet://puppet/modules/standalone-configs/$folder/$name- > $operatingsystem", > "puppet://puppet/modules/standalone-configs/$folder/$name-default" > ], > notify => $notifyI can''t say for sure, but a few things to help you troubleshoot. On the master run puppet master --compile $hostname and compare the output for the file resource in 2.6 v.s. 2.7. Here''s a simple example: { "exported": false, "line": 21, "title": "/tmp/sample", "parameters": { "ensure": "file" }, ... "type": "File", "file": "/etc/puppet/manifests/site.pp" }, So the first thing is making sure they are the same, the second is write a test manifests with all your attributes on the 2.7 system and see how it behaves: file { "/path/to/file": ensure => file, ... source => [...], } Thanks, Nan -- 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.
Russell Howe
2011-Nov-29 18:05 UTC
Re: [Puppet Users] ensure => file, creating directories
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 29/11/11 14:06, jasper.hargreaves@m-w.co.uk wrote:> Hi all, > > Recently upgraded one of our puppet servers from 2.6.4 to 2.7.5, and> "puppet://puppet/modules/standalone-configs/$folder/$name-$type- > $fqdn",Try "puppet://puppet/modules/standalone-configs/${folder}/${name}-${type}-${fqdn}", See http://projects.puppetlabs.com/issues/10146 I don''t know if that will fix your directories issue, but it can''t hurt and shouldn''t break even if you downgrade I think. - -- Russell Howe rhowe@moonfruit.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJO1R7gAAoJEJ2trZuuThLOUVUH/iMg+hNS18hrOtqx9+4NGlp4 1BJP4iWchjsdX3RCaj6jjJMnVFwwJ1UG8yJyS9+7WspjGnsQlZ04nBPz5JsLB9/H T3y4+2NdRvXTQeDctE4u9e3N330FSlRxvYp6A3NHjfldjX7zn6AQj6JYRedxq9NF afz0F5cSZYqkZ+gffcOhWwQS7ZxyPMD0XsgWftpA+G402GgZca2ZO8yIdb79iQlD Y3fuW4wH2CU+KUFDAcAEdqhN7NgChrUFJYAJpLeZ5EdZdznZFk9mQbyMfSZwvgxk sEShQTvYo1ft7EEQnBgCRSen2LwzQSIWAPeffxR/TajkJYHEnoSLEFCyWVZmdyw=07Ph -----END PGP SIGNATURE----- -- 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.
Stefan Schulte
2011-Nov-30 19:07 UTC
Re: [Puppet Users] ensure => file, creating directories
On Tue, Nov 29, 2011 at 06:05:20PM +0000, Russell Howe wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 29/11/11 14:06, jasper.hargreaves@m-w.co.uk wrote: > > Hi all, > > > > Recently upgraded one of our puppet servers from 2.6.4 to 2.7.5, and > > > > "puppet://puppet/modules/standalone-configs/$folder/$name-$type- > > $fqdn", > > Try > > "puppet://puppet/modules/standalone-configs/${folder}/${name}-${type}-${fqdn}", > > See http://projects.puppetlabs.com/issues/10146 > > I don''t know if that will fix your directories issue, but it can''t hurt > and shouldn''t break even if you downgrade I think.That should fix the issue. If you specify ensure => file but the source is actually not a file but a directory puppet will not complain. It will create the directory. And because of the ticket Russell just quoted I suspect that "puppet://puppet/modules/standalone-configs/$folder/$name-$type-$default", will be interpolated like this "puppet://puppet/modules/standalone-configs/$folder/" and all other sources will just be garbage. So in the end puppet will pick a directory, not a file, as the source. -Stefan
Hi, what was the solution finally? cause i receive directory after the following code: file { "/etc/apache2/htpasswd/${name}": ensure => "present", source => [ "puppet:///modules/sites/htpasswd/${name}", "puppet:///modules/sites/htpasswd/${sname}", "puppet:///modules/sites/htpasswd/tnthtpasswd" ], } if there is no {name} or {sname} files. Thanks for help in advance -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/vdLogDuxNT4J. 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.