Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-2612

Puppet regsubst function does not match backslashes

    XMLWordPrintable

Details

    Description

      puppet apply --parser future --debug --verbose c:/site.pp
       
      $ports_regex = "80\\|443"
      $ports_string       = regsubst($ports_regex, '\\\|', ',', 'G')
       
      notify{"CP1 ${ports_string}":}
       
      $ports_array = split($ports_string, ',')
       
      notify{"CP2 ${ports_array}":}
       
      each($ports_array) |$port| {
        notify{"CP3 ${port}":}
       
        file {"${port}":
      	  path => "c:/temp/puppettest/${port}",
      	  ensure => present;
        }
      }
      

      results in:

      Error: Invalid tag cp2  at .../site.pp:8 on node ...
      Error: Invalid tag cp2  at .../site.pp:8 on node ...
      

      while this worked until 3.4.3.

      It seems that the split function does not work as expected since 3.5.1.

      http://serverfault.com/questions/592362/puppet-split-function-fails

      Attachments

        Activity

          People

            Unassigned Unassigned
            utrecht utrecht
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support