Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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


share|improve this question
You have preset instead of present, although that's probably not the source of your error. – larsks Aug 17 '12 at 15:28
nope, but thanks! ;) – enedebe Aug 17 '12 at 15:34
up vote 3 down vote accepted

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

share|improve this answer
Great but I haven't read that before :S thanks! Works great now. – enedebe Aug 17 '12 at 15:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.