Problem
Puppet split function fails since Puppet has been upgraded puppet to version 3.5.1, while this worked until 3.4.3
Code
1 $ports_regex = "80\\|443" 2 3 $ports_string = regsubst($ports_regex, '\\\|', ',', 'G') 4 5 notify{"CP1 ${ports_string}":} 6 7 $ports_array = split($ports_string, ',') 8 9 notify{"CP2 ${ports_array}":} 10 11 each($ports_array) |$port| { 12 notify{"CP3 ${port}":} 13 14 file {"${port}": 15 path => "c:/temp/puppettest/${port}", 16 ensure => present; 17 } 18 } Outcome
3.4.3
Notice: /Stage[main]/Main/File[443]/ensure: created Notice: CP2 80443 Notice: /Stage[main]/Main/Notify[CP2 80443]/message: defined 'message' as 'CP2 80443' Notice: CP1 80,443 Notice: /Stage[main]/Main/Notify[CP1 80,443]/message: defined 'message' as 'CP1 80,443' Notice: CP3 80 Notice: /Stage[main]/Main/Notify[CP3 80]/message: defined 'message' as 'CP3 80' Notice: /Stage[main]/Main/File[80]/ensure: created Notice: CP3 443 Notice: /Stage[main]/Main/Notify[CP3 443]/message: defined 'message' as 'CP3 443' 3.5.1
C:\Windows\system32>puppet apply --parser future --debug --verbose "C:\temp\puppettest\site.pp" Error: Invalid tag cp2 at C:/temp/puppettest/site.pp:9 on node ... Error: Invalid tag cp2 at C:/temp/puppettest/site.pp:9 on node ... Question
How to solve this issue?