In my puppet code I use regex inside case statement to identify the nodes I need to apply a certain code
Below is a sample code in my Puppet class
case $os_family {
'RedHat': {
case $node_certname {
/(xyz|pqr\d+)\.(com|au)?/: {
Since the above regex is repeated in may of my classes, I wish to declare it centrally so that I do not have to change all classes and can just change at a central place
I tried to pass variable but it did not work. Can someone please help if this is possible
I should be able to pass parameter or replace by some variable for the regex
/(xyz|pqr\d+)\.(com|au)?/