Various Puppet Errors

Error: Could not request certificate: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA generated on pemaster at 2015-03-17 12:14:32 -0500]

The time between the puppet agent node and the puppet master is out of sync. Sync the time, and regenerate the cert.

Reference


Evaluation Error: Operator ‘[]’ is not applicable to an Undef Value

If using facts to evaluate inside of a condition, you won’t be able to access secondary elements if one isn’t returned to the first element.

# If false, include rhel::resolv  
  unless $::facts['dhcp_servers']['system'] {
    include rhel::resolv
  }

If this systems interface was not configured via DHCP, a puppet run would result in:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '[]' is not applicable to an Undef Value. at /etc/puppetlabs/code/environments/snd/modules/rhel/manifests/init.pp:25:10 on node mongodb

This means that the facts['dhcp_servers'] is empty, which results in an undef value, as documented by Puppet: “whenever no other value is applicable, the value is undef”

Thus, we cannot access the [‘system’] element, just as the error suggests: Operator '[]' is not applicable to an Undef Value.

Since the dhcp_server fact will result in an undef value provided the servers interface was not setup via DHCP, we can simply rely on it to satisfy our conditional which aims whether or not to include rhel::resolv.

Share