1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
node /^ws-([[:digit:]]+)/ { $structure = 'ca' $hostid = $2 notice("site.pp: Hostid: $hostid") # Same regex as above if $hostname =~ /^ws-([[:digit:]]+)/ { notice("\$2: $2") } class {'host_type::ws': structure => $structure, } } When run against a machine ws-01, I get out: puppet-master[29847]: (Scope(Node[ws-:digit:])) site.pp: Hostid: puppet-master[29847]: (Scope(Node[ws-:digit:])) $2: 01 |
