Puppet keeps trying to install packages

34 views
Skip to first unread message

Jacob Atzen

unread,
Dec 12, 2008, 7:47:08 AM12/12/08
to Puppet Users
Hi all,

I'm trying to setup a puppet installation on FreeBSD. So far I have
only one puppetmaster and one puppetclient, both with 0.24.4 from
FreeBSD ports. On the master I've defined a couple of classes
including this:

class apache22 {
package { apache22:
ensure => installed,
source => "http://x.x.x.x/packages/apache-2.2.9_5.tbz",
provider => freebsd
}

service { "apache22":
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true
}
}

And my site.pp is:

import "classes/*"

node default {
include test
include ruby186
include sudo
include apache22
}

Now when I run puppetd --test the first time it installs and starts
apache. But on all following runs I get:

err: //Node[default]/apache22/Package[apache22]/ensure: change from
absent to present failed: Execution of '/usr/sbin/pkg_add
http://x.x.x.x/packages/apache-2.2.9_5.tbz' returned 256: pkg_add:
package 'apache-2.2.9_5' or its older version already installed

It seems to me that puppet is not registering the installation of the
package the first time around. What am I doing wrong here?

Peter Meier

unread,
Dec 12, 2008, 9:14:19 AM12/12/08
to puppet...@googlegroups.com
Hi

[...]

> class apache22 {
> package { apache22:
> ensure => installed,
> source => "http://x.x.x.x/packages/apache-2.2.9_5.tbz",
> provider => freebsd
> }

[...]

> It seems to me that puppet is not registering the installation of the
> package the first time around. What am I doing wrong here?

exactly.

the namevar of the package (in your case apache22) is used to query
the package manager of the system, if the package is already
installed. However the name of the package is not apache22 it is
apache, therefore it fails. Or how else could puppet know about the
actual package name?
so change package { apache22 to package { apache and it will work.

At least I hope it does.

cheers pete

Jacob Atzen

unread,
Dec 12, 2008, 10:00:56 AM12/12/08
to puppet...@googlegroups.com
Hi Peter,

It worked, thanks!

--
Med venlig hilsen
- Jacob Atzen
Reply all
Reply to author
Forward
0 new messages