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

master compile errors on upper case class ref with unknown class where apply works

    XMLWordPrintable

Details

    • Bug
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • PUP 6.0.5
    • None
    • Compiler
    • None
    • PUP Bug Template
    • Froyo
    • Needs Assessment
    • Needs Assessment

    Description

      This was initially reported as related to hiera and lookup, but when problem was reproduced it was triggered without hiera/lookup being involved. In essence a Class[test] reference works when using apply, but not when compiling via the master - changing the test to Test makes it work on the master.

      ORIGINAL


      Puppet Version: 6.0.5-1stretch
      Puppet Server Version: 6.2.0-1stretch 
      OS Name/Version: Debian 9

      I'm using the lookup function to create a file resource from Hiera data:

      '/primary':
        ensure: 'directory'
        mode: '0755'
        owner: 'root'
        group: 'root'
        before: 'Class[nfs]'

      This results in the following error when the agent runs on the node:

      "Server Error: Invalid relationship:  File[/primary] { before => Class[nfs] }, because Class[nfs] doesn't seem to be in the catalog".

      But here's the thing: if the first letter of the class name is capitalized - to be clear, as in Class[Nfs] - the agent run proceeds smoothly.  

      This is at odds with what happens if I create the file resource explicitly in a manifest.  In that case, it is not necessary to capitalize the class name in the "before =>" attribute.

      So on the face of it, it seems something is amiss in the Hiera lookup, or parsing, or ... something ...

      (Incidentally, this happens no matter which class I'm referencing - it's not restricted to the "nfs" (derdanne-nfs module) class.)

      Stephen Kenny

       

      Attachments

        Activity

          People

            skenny Stephen Kenny
            skenny Stephen Kenny
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Zendesk Support