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

Add functions to iterate over files/templates in the current module

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Functions, Language
    • Labels:
      None
    • Template:
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 6.x, 7.x
      Puppet Server Version: 6.x, 7.x
      OS Name/Version: all

      Sometimes, one needs to put several files in place on an agent node that come from the same module. As it is now, one needs to explicitly name each file in an array to iterate over. This has the drawback that one needs to adapt the code whenever a new file is added to <module>/files (or <module>/templates)

      Desired Behavior:

      Be able to write something like that:

      files('puppet:///modules/foo/subdir').each |$file| {
        file {
          ...
        }
       }

      and similar for templates (you get the idea).

      Actual Behavior:

      This is currently not possible (at least to my knowledge).

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              henrik.lindberg Henrik Lindberg
              Reporter:
              dhs@recommind.com Dirk Heinrichs
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support