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?

  • Are you watching the master log for you info output? Have you tried a notify resource for more posterity? – Felix Frank Jul 27 '15 at 13:58
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+)/
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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