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

Virtual and Exported Resources Should Validate at Declaration

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:

      Description

      Virtual and exported resources aren't validated when they are declared, and so problems aren't visible until they're collected.

      E.g.:

      [root@mgtm6e8juxq8e3n ~]# cat foo.pp
      @sshkey { "${::fqdn}_dsa":
        host_aliases => [$::fqdn, $::hostname],
        type         => dsa,
        key          => $::fdslkfjsdlfkj,
      }
      [root@mgtm6e8juxq8e3n ~]# puppet apply foo.pp
      Notice: Compiled catalog for mgtm6e8juxq8e3n.delivery.puppetlabs.net in environment production in 0.08 seconds
      Notice: Finished catalog run in 0.03 seconds
      

      And now let's collect it:

      [root@mgtm6e8juxq8e3n ~]# cat foo.pp
      @sshkey { "${::fqdn}_dsa":
        host_aliases => [$::fqdn, $::hostname],
        type         => dsa,
        key          => $::fdslkfjsdlfkj,
      }
      Sshkey <| |>
      [root@mgtm6e8juxq8e3n ~]# puppet apply foo.pp
      Notice: Compiled catalog for mgtm6e8juxq8e3n.delivery.puppetlabs.net in environment production in 0.08 seconds
      Notice: /Stage[main]/Main/Sshkey[mgtm6e8juxq8e3n.delivery.puppetlabs.net_dsa]/ensure: created
      Error: /Stage[main]/Main/Sshkey[mgtm6e8juxq8e3n.delivery.puppetlabs.net_dsa]: Could not evaluate: Field 'key' is required
      Notice: Finished catalog run in 0.02 seconds
      

      The same is true for exported resources. Debugging these sorts of issues would be far easier if the resources were validated at declaration, instead of at realization, since you would actually be able to easily tell what host was generating the resource.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                zee Zee Alexander
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support