1

I'm trying to automate some tasks when receiving a new server. The first thing is adding some yum repos.

My /etc/puppet/modules/repo/manifests/init.pp:

     1  class repo {
     2      file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL": 
     3          owner   => root, 
     4          group   => root, 
     5          mode    => 0644, 
     6          source  => "puppet:///repo/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL" 
     7      }
     8  
     9      yumrepo { 
    10          "epel":
    11              descr       => 'the epel repo',
    12              mirrorlist  => 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch',
    13              enable      => 1,
    14              gpgcheck    => 1,
    15              gpgkey      => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL", 
    16              require     => File["/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL"]
    17      }
    18  }

Syntax OK when checking with puppet parser validate.

but I got the error below when connecting the puppet agent:

# puppet agent --no-daemonize --verbose
notice: Starting Puppet client version 2.7.1
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter enable at /etc/puppet/modules/repo/manifests/init.pp:17 on node svr051-4170
notice: Using cached catalog
err: Could not retrieve catalog; skipping run
notice: Caught INT; calling stop

As you can see, line 17 is the close curly bracket. I really don't understand what the problem is. Any help will be appreciated.

2 Answers 2

7

"Enable" is not actually a valid parameter for the yumrepo resource. It's called "enable_d_".

The reason it's choking on the curly brace is that it's the end of that section. I don't know the intimate details of how Puppet parses files, but my guess is that Puppet grabs all of the parameters during parsing and handles them together, so it doesn't know there's a problem until the parser leaves the section.

0

Quick guess is it is something to do with the $ or & in the mirrorlist line try to add \ in front of them and see what happens

1
  • I don't think $ must be escaped with backslash. Also tried but got the same error.
    – quanta
    Jul 22, 2011 at 5:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .