Puppet newbie: using defines

Nico De Ranter
Mon, 21 May 2007 14:27:20 -0000

Hi folks,

I''m trying to get my feet wet in puppet-land. I''ve
successfully
installed a puppetmaster and client and managed to get them to do
something (the sudo file-permission example as explained in the
tutorials).  Now I''m trying to do something a bit more complex using
defines but nothing seems to happen anymore.

Config files involved:
###### site.pp
filebucket {
    # use a filebucket on the puppet server
    main: server => puppet
}
import "definitions/*"
import "classes/*"
import "templates"
###### templates.pp
node basenode {
    include yumrepos
}
###### classes/yumrepos.pp
class yumrepos {
        yumrepo { dag: }
}
###### definitions/yumrepo.pp
define yumrepo () {
  file { "/etc/yum.repos.d/$name.repo":
    mode => 644,
    owner => root,
    group => root,
    backup => true,
    recurese => false,
    ensure => file,
    source =>
"puppet://puppet/files/os/$operatingsystem/yum/repos/$name.repo"
  }
}
############

When I replace ''yumrepo{ dag: } from classes/yumrepos.pp with the
''file
{...}'' section from definitions/yumrepo.pp everything works ok: the
client connects, downloads the dag.repo and puts it in the right place.
However when I use the yumrepo definition I don''t see anything
happening
at all (I made sure to remove the dag.repo on the client of course).

[root@mustang ~]# puppetd -d -v
notice: Starting Puppet client version 0.22.4
info: Facts have changed; recompiling
info: Caching configuration at /var/lib/puppet/localconfig.yaml
notice: Starting configuration run
info: Sent transaction report in 0.06 seconds
notice: Finished configuration run in 0.11 seconds
notice: Caught INT; shutting down
notice: Shutting down
[root@mustang ~]# ls -l /etc/yum.repos.d/dag*
ls: /etc/yum.repos.d/dag*: No such file or directory


What am I doing wrong?

Nico

--
Nico De Ranter
Senior System Administrator
Sony Service Center (NSCE)
The Corporate Village, Da Vincilaan 7-D1
B-1935 Zaventem, Belgium
Telephone: +32 (0)2 700 86 41 Fax: +32 (0)2 700 86 22