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

Class containment tagging depends on evaluation order

    Details

    • Type: Improvement
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 2.7.25, PUP 3.6.1, PUP 3.6.2, PUP 3.7.3
    • Fix Version/s: None
    • Component/s: Language
    • Labels:
      None
    • Environment:

      RHEL6, 7 MacOs X

      Description

      Hello,

      We are massively using tags to provision servers (production and development) to restrict catalog to a sub-part.

      We found a strange behaviour when mixing the use of tags, include directive and definitions:

        class do_not_ignore_me {
          notify { 'This message should always be displayed' :}
        }
       
        define foobar($message = '') {
          notify { $message :}
          include do_not_ignore_me
        }
       
        class foo {
          foobar { 'from_foo' : message => $name}
        }
       
        class bar {
          foobar { 'from_bar' : message => $name}
        }
       
        include foo
        include bar
      

      When we try to apply this catalog, using the following command:

      puppet apply  foobar.pp --tags foo
      

      we get this output:

      Notice: Compiled catalog for my-wks in environment production in 0.03 seconds
      Notice: foo
      Notice: /Stage[main]/Foo/Foobar[from_foo]/Notify[foo]/message: defined 'message' as 'foo'
      Notice: This message should always be displayed
      Notice: /Stage[main]/Do_not_ignore_me/Notify[This message should always be displayed]/message: defined 'message' as 'This message should always be displayed'
      Notice: Finished catalog run in 0.05 seconds
      

      And when we switch the last 2 lines, we get a different result, still with the same command:

      Notice: Compiled catalog for my-wks in environment production in 0.03 seconds
      Notice: foo
      Notice: /Stage[main]/Foo/Foobar[from_foo]/Notify[foo]/message: defined 'message' as 'foo'
      Notice: Finished catalog run in 0.05 seconds
      

      This bug is embarassing as only a little part of the large catalog is applied.

      Regards.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              davidb2111 David Barbion
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Zendesk Support