Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

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

1 Answer 1

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

 
discard

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.