simp / pupmod-simp-crypto_policy

A Puppet module for managing the system crypto policy settings
0 stars 7 forks source link

Compile fails if simplib__crypto_policy_state is not defined #28

Closed silug closed 1 year ago

silug commented 1 year ago

If the simplib__crypto_policy_state is not defined (for example, if update-crypto-policies is not available), the following line causes a compile failure: https://github.com/simp/pupmod-simp-crypto_policy/blob/9d9d7c923b2f9cddf8bd273b2efbb2b20df44eef/manifests/init.pp#L53

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /etc/puppetlabs/code/environments/production/modules/crypto_policy/manifests/init.pp, line: 53, column: 35) on node oel8.simp-ee.test
silug commented 1 year ago

FYI, I'm having a difficult time reproducing this problem. I'll keep digging.

silug commented 1 year ago

FYI, I'm having a difficult time reproducing this problem. I'll keep digging.

Steps to reproduce:

  1. dnf remove crypto-policies-scripts
  2. puppet apply -t -e 'class { "crypto_policy": ensure => "DEFAULT" }'
# puppet apply -t -e 'class { "crypto_policy": ensure => "DEFAULT" }' --noop
Info: Loading facts
Info: Loading facts
Error: Facter: Error while resolving custom fact fact='ipv6_enabled', resolution='<anonymous>': undefined method `chomp' for nil:NilClass
Error: Facter: Error while resolving custom fact fact='shmall', resolution='<anonymous>': No such file or directory - /sbin/sysctl
Warning: Scope(Class[Crypto_policy::Update]): crypto_policy: simplib__crypto_policy_state fact not found, updating not enabled
Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /etc/puppetlabs/code/environments/production/modules/crypto_policy/manifests/init.pp, line: 53, column: 35) on node 05ec45e96396