1

That's a simple question that is stolen my time, and getting me crazy. Very simple I can't understand why this regexp is not getting running when I define a new node in puppet:

Hostname: api01.eu-west-1.compute.internal

Node definition

3: node ^api\d+\.eu-west-1\.compute\.internal {
4:        include sudo
5:        package { 'vim': ensure => preset } 
6: }

My error:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not parse for environment production: Could not match 
^api\d+\.eu-west-1\.compute\.internal at /etc/puppet/manifests/nodes.pp:3 
on node api01.eu-west-1.compute.internal

Thanks

1
  • You have preset instead of present, although that's probably not the source of your error.
    – larsks
    Aug 17, 2012 at 15:28

1 Answer 1

3

If you're going to match nodes using regular expressions you need to put the pattern inside /.../, like this:

node /^api\d+\.eu-west-1\.compute\.internal/ {
       include sudo
       package { 'vim': ensure => present } 
}

You can read more here

1
  • Great but I haven't read that before :S thanks! Works great now.
    – enedebe
    Aug 17, 2012 at 15:47

You must log in to answer this question.

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