Re: [Puppet Users] Check package version in order to proceed with installation (err: Could not update: package is already installed)

2011-02-14 Thread Jan
Hi *,

no more ideas? :)

Jan

On 02/11/2011 10:24 PM, Jan wrote:
 Hi Patrick,
 
 On 02/11/2011 07:40 PM, Patrick wrote:
 
 [...]
 
 1) So, just some random advice.  If you're using the same server to
 serve files and catalogs, you can skip listing the server and just
 use 3 slashes like this: 
 puppet:///files/rpm-sles11sp1/ruby-shadow-$myrshadowversion.x86_64.rpm
 
 I see but I've just added this during the debugging procedure of our
 nameservers, anyhow your advice is welcome :)
 
  2) You sure it's not easier to just create a repository right now
 instead?
 
 Of course and I would really like to but for the moment we're facing
 some serious issues which won't fix in time. Thats the major reason for
 me searching a temporary solution.
 
 3) What if you try using ensure = installed in the package?  Does
 that work?
 
 This won't work because puppet (as of version 0.24.x) is already
 installed on all nodes. That's the reason why I want puppet to upgrade
 the package _only_ if a newer version is available. When using ensure
 = installed the package won't be upgraded because some version is
 already installed.
 
 However, I haven't checked it by myself but I think that the same error
 message will be thrown if using ensure = latest on other packages,
 right? If yes, would you say that its a bug or a feature? ;)
 
 I want to get rid of that error message to keep the log files clean
 maybe to let them be checked on errors by our monitoring agent at a
 later time. The rest of the manifest seems to work just fine also with
 this error message coming up.
 
 4) I assume you're getting one of those errors for every package.  Is
 that true?
 
 Yes, that's correct.
 
 Jan
 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Check package version in order to proceed with installation (err: Could not update: package is already installed)

2011-02-11 Thread Jan
Hi *,

we have plans to handle the update process of puppet related packages by
our local update server. However, for now we need do deal with the
situation by fetching the respective rpms to the client and install them
by using the rpm provider.

So in order to proceed with the installation I would like to check if
the latest version is already installed before puppet tries to
install/update it, to get rid of the following error log message:


node # puppetd -o --server puppet.domain.tld --waitforcert 60 --test
[...]
err: /Stage[main]/Puppet::Client::Rollout/Package[puppet]/ensure: change
from 2.6.4-27.1 to Header-V3 failed: Could not update: Execution of
'/bin/rpm -U --oldpackage /tmp/puppet-2.6.4-27.1.x86_64.rpm' returned 1:
warning: /tmp/puppet-2.6.4-27.1.x86_64.rpm: Header V3 DSA signature:
NOKEY, key ID 5c43a8d9
package puppet-2.6.4-27.1.x86_64 is already installed
 at /etc/puppet/manifests/classes/puppet.pp:42
[...]


This error occurs anytime if the latest version of the package is
already installed. I tried to use the onlyif and unless parameters
but according to the latest type reference under
http://docs.puppetlabs.com/references/latest/type.html; these seem to
be not supported, neither by the resource type file nor by resource
type package.

/etc/puppet/manifests/classes/puppet.pp

class puppet {

  class client {

class rollout {

  $mypuppetversion = 2.6.4-27.1
  $myfacterversion = 1.5.8-6.1
  $myrshadowversion = 1.4.1-4.1

  file {
  /tmp/facter-$myfacterversion.x86_64.rpm:
source =
puppet://puppet.domain.tld/files/rpm-sles11sp1/facter-$myfacterversion.x86_64.rpm;
  /tmp/puppet-$mypuppetversion.x86_64.rpm:
source =
puppet://puppet.domain.tld/files/rpm-sles11sp1/puppet-$mypuppetversion.x86_64.rpm;
  /tmp/ruby-shadow-$myrshadowversion.x86_64.rpm:
source =
puppet://puppet.domain.tld/files/rpm-sles11sp1/ruby-shadow-$myrshadowversion.x86_64.rpm;
  }

  package {
 facter:
ensure   = latest,
name = facter,
provider = rpm,
source   = /tmp/facter-$myfacterversion.x86_64.rpm,
require  = file[/tmp/facter-$myfacterversion.x86_64.rpm];
 puppet:
ensure   = latest,
name = puppet,
provider = rpm,
source   = /tmp/puppet-$mypuppetversion.x86_64.rpm,
require  = file[/tmp/puppet-$mypuppetversion.x86_64.rpm];
 ruby-shadow:
ensure   = latest,
name = ruby-shadow,
provider = rpm,
source   = /tmp/ruby-shadow-$myrshadowversion.x86_64.rpm,
require  =
file[/tmp/ruby-shadow-$myrshadowversion.x86_64.rpm];
  }

  service {
 puppet:
enable   = true,
ensure   = running,
restart  = true,
name = puppet;
  }

}

  }

}


I hope that somebody got the point because as every time I'm totally
sure that I missed some peace of documentation and of course there is
always a better way to handle such situations? :)

Thanks in advance
Jan

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Check package version in order to proceed with installation (err: Could not update: package is already installed)

2011-02-11 Thread Patrick

On Feb 11, 2011, at 3:31 AM, Jan wrote:

 Hi *,
 
 we have plans to handle the update process of puppet related packages by
 our local update server. However, for now we need do deal with the
 situation by fetching the respective rpms to the client and install them
 by using the rpm provider.
 
 So in order to proceed with the installation I would like to check if
 the latest version is already installed before puppet tries to
 install/update it, to get rid of the following error log message:
 
 
 node # puppetd -o --server puppet.domain.tld --waitforcert 60 --test
 [...]
 err: /Stage[main]/Puppet::Client::Rollout/Package[puppet]/ensure: change
 from 2.6.4-27.1 to Header-V3 failed: Could not update: Execution of
 '/bin/rpm -U --oldpackage /tmp/puppet-2.6.4-27.1.x86_64.rpm' returned 1:
 warning: /tmp/puppet-2.6.4-27.1.x86_64.rpm: Header V3 DSA signature:
 NOKEY, key ID 5c43a8d9
   package puppet-2.6.4-27.1.x86_64 is already installed
 at /etc/puppet/manifests/classes/puppet.pp:42
 [...]
 
 
 This error occurs anytime if the latest version of the package is
 already installed. I tried to use the onlyif and unless parameters
 but according to the latest type reference under
 http://docs.puppetlabs.com/references/latest/type.html; these seem to
 be not supported, neither by the resource type file nor by resource
 type package.

Well, it wouldn't help you with the file since the problem is in the Package.

1) So, just some random advice.  If you're using the same server to serve files 
and catalogs, you can skip listing the server and just use 3 slashes like this:
puppet:///files/rpm-sles11sp1/ruby-shadow-$myrshadowversion.x86_64.rpm

2) You sure it's not easier to just create a repository right now instead?

3) What if you try using ensure = installed in the package?  Does that work?

4) I assume you're getting one of those errors for every package.  Is that true?


 
 /etc/puppet/manifests/classes/puppet.pp
 
 class puppet {
 
  class client {
 
class rollout {
 
  $mypuppetversion = 2.6.4-27.1
  $myfacterversion = 1.5.8-6.1
  $myrshadowversion = 1.4.1-4.1
 
  file {
  /tmp/facter-$myfacterversion.x86_64.rpm:
source =
 puppet://puppet.domain.tld/files/rpm-sles11sp1/facter-$myfacterversion.x86_64.rpm;
  /tmp/puppet-$mypuppetversion.x86_64.rpm:
source =
 puppet://puppet.domain.tld/files/rpm-sles11sp1/puppet-$mypuppetversion.x86_64.rpm;
  /tmp/ruby-shadow-$myrshadowversion.x86_64.rpm:
source =
 puppet://puppet.domain.tld/files/rpm-sles11sp1/ruby-shadow-$myrshadowversion.x86_64.rpm;
  }
 
  package {
 facter:
ensure   = latest,
name = facter,
provider = rpm,
source   = /tmp/facter-$myfacterversion.x86_64.rpm,
require  = file[/tmp/facter-$myfacterversion.x86_64.rpm];
 puppet:
ensure   = latest,
name = puppet,
provider = rpm,
source   = /tmp/puppet-$mypuppetversion.x86_64.rpm,
require  = file[/tmp/puppet-$mypuppetversion.x86_64.rpm];
 ruby-shadow:
ensure   = latest,
name = ruby-shadow,
provider = rpm,
source   = /tmp/ruby-shadow-$myrshadowversion.x86_64.rpm,
require  =
 file[/tmp/ruby-shadow-$myrshadowversion.x86_64.rpm];
  }
 
  service {
 puppet:
enable   = true,
ensure   = running,
restart  = true,
name = puppet;
  }
 
}
 
  }
 
 }
 
 
 I hope that somebody got the point because as every time I'm totally
 sure that I missed some peace of documentation and of course there is
 always a better way to handle such situations? :)
 
 Thanks in advance
 Jan
 
 -- 
 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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Check package version in order to proceed with installation (err: Could not update: package is already installed)

2011-02-11 Thread Jan
Hi Patrick,

On 02/11/2011 07:40 PM, Patrick wrote:

[...]

 1) So, just some random advice.  If you're using the same server to
 serve files and catalogs, you can skip listing the server and just
 use 3 slashes like this: 
 puppet:///files/rpm-sles11sp1/ruby-shadow-$myrshadowversion.x86_64.rpm

I see but I've just added this during the debugging procedure of our
nameservers, anyhow your advice is welcome :)

  2) You sure it's not easier to just create a repository right now
 instead?

Of course and I would really like to but for the moment we're facing
some serious issues which won't fix in time. Thats the major reason for
me searching a temporary solution.

 3) What if you try using ensure = installed in the package?  Does
 that work?

This won't work because puppet (as of version 0.24.x) is already
installed on all nodes. That's the reason why I want puppet to upgrade
the package _only_ if a newer version is available. When using ensure
= installed the package won't be upgraded because some version is
already installed.

However, I haven't checked it by myself but I think that the same error
message will be thrown if using ensure = latest on other packages,
right? If yes, would you say that its a bug or a feature? ;)

I want to get rid of that error message to keep the log files clean
maybe to let them be checked on errors by our monitoring agent at a
later time. The rest of the manifest seems to work just fine also with
this error message coming up.

 4) I assume you're getting one of those errors for every package.  Is
 that true?

Yes, that's correct.

Jan

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.