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!
I 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
On 29/11/11 14:06, jasper.h...@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
rh...@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-----
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
Even I faced the issue some time ago and the error is gone after quoting each and every variable with curly braces. Please check if something like below works for you.
file { ${name}:
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f39c2e0c-a7e4-44ae-9454-4f492640cb8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.