Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Exported Resource - Could not evaluate: Field 'key' is required

Hello beginner here. I'm trying to do the classic distribute ssh keys to every server in the puppet environment, but I seem to be running into a issue as I'm receiving the error: Error: /Stage[main]/Ssh/Sshkey[puppet-dev]: Could not evaluate: Field 'key' is required

Puppet code that I borrowed from the puppet documentation:

class ssh { #Declare @@sshkey { $::hostname: type => dsa, key => $::sshdsakey, } # Collect: Sshkey <<| |>> }

Running puppet agent:

[root@puppet-dev modules]# puppet agent -t Info: Using configured environment 'production' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Info: Caching catalog for puppet-dev.esxi.com Info: Applying configuration version '1497521436' Notice: /Stage[main]/Ssh/Sshkey[puppet-dev]/ensure: created Error: /Stage[main]/Ssh/Sshkey[puppet-dev]: Could not evaluate: Field 'key' is required Notice: Applied catalog in 0.23 seconds

Exported Resource - Could not evaluate: Field 'key' is required

Hello beginner here. I'm trying to do the classic distribute ssh keys to every server in the puppet environment, but I seem to be running into a issue as I'm receiving the error: Error: /Stage[main]/Ssh/Sshkey[puppet-dev]: Could not evaluate: Field 'key' is required

Puppet code that I borrowed from the puppet documentation:

class ssh {
    #Declare
    @@sshkey {  #Declare    @@sshkey {
  $::hostname: $::hostname:
        type => dsa, dsa,
        key  =>
  => $::sshdsakey,         } 
        }
    # Collect:  Sshkey
  Collect:

    Sshkey <<| |>> }

|>> }

Running puppet agent:

 [root@puppet-dev modules]# puppet agent -t
  Info: Using configured environment 'production'
  Info: Retrieving pluginfacts
  Info: Retrieving plugin
  Info: Loading facts
  Info: Caching catalog for puppet-dev.esxi.com
  Info: Applying configuration version '1497521436'
  Notice: /Stage[main]/Ssh/Sshkey[puppet-dev]/ensure: created
  Error: /Stage[main]/Ssh/Sshkey[puppet-dev]: Could not evaluate: Field 'key' is required required
Notice: Applied catalog in 0.23 seconds

seconds

Update 1:

I've commented out the "key" and added a notice resource, but I am still receiving the same error.

class ssh {
    #Declare
    @@sshkey { $::hostname:
        type => dsa,
        #key  => $::sshdsakey, 
        }
    # Collect:

    notice($::sshdsakey)

    Sshkey <<| |>>
}

Running puppet agent:

[root@puppet-dev ~]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for puppet-dev.esxi.com
Info: Applying configuration version '1497578863'
Notice: /Stage[main]/Ssh/Sshkey[puppet-dev]/ensure: created
Error: /Stage[main]/Ssh/Sshkey[puppet-dev]: Could not evaluate: Field 'key' is required
Notice: /Stage[main]/Ssh/Sshkey[puppetdb]/ensure: created
Error: /Stage[main]/Ssh/Sshkey[puppetdb]: Could not evaluate: Field 'key' is required
Notice: /Stage[main]/Ssh/Sshkey[canary]/ensure: created
Error: /Stage[main]/Ssh/Sshkey[canary]: Could not evaluate: Field 'key' is required
Notice: Applied catalog in 0.33 seconds