0

I am running puppet 3.7.3 on a windows 8.1 client and it is pulling in my default node definition.

I am trying to create a more generalized definition by using regex on a group of nodes. Our naming scheme is similar to: bldg-50zx022-1.domain.tld. For my node definition, I am using the below, but I never see the info when I run puppet agent -td

node /^(bldg|BLDG)-\w{0,7}-\d+/ { info("inside node definition") } 

I have verified that my regex is correct using rubular.com. When I run facter, I get these values:

fqdn => BLDG-50ZX022-2.domain.tld hostname => BLDG-50ZX022-2 

Is there anything I can do to get this to work?

1
  • Are you watching the master log for you info output? Have you tried a notify resource for more posterity? Commented Jul 27, 2015 at 13:58

1 Answer 1

1

So I'm not sure how the puppet engine handles the grouping, but (bldg|BLDG) is technically a capture group, so some regex engines will return only that capture group.

When running it through regex101.com, I figured this would do your bldg/BLDG OR while capturing the whole hostname as the only capture group, give it a shot:

/^((?:bldg|BLDG)-\w{0,7}-\d+)/ 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.