Catalog compilation fails on Puppet 6 Master

Bug #1932041 reported by Manfred Pusch
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
puppet-pacemaker
New
Undecided
Unassigned

Bug Description

Hello,

when using my Puppet Master to compile the catalog for a cluster node, the compilation fails with the error:

Evaluation Error: Error while evaluating a Function Call, uninitialized constant Facter::Util (file: /etc/puppetlabs/code/environments/development/modules/pacemaker/manifests/corosync.pp, line: 290, column: 22)

The actual problem is not in the corosync.pp file, but in lib/puppet/parser/functions/pcmk_nodes_added.rb on line 21, where Facter::Util::Resolution.which() is used to find a binary. This does not work on the puppet master because Facter::Util is not available:

# puppetserver irb
irb(main):001:0> require 'facter'
=> true
irb(main):002:0> Facter::Util::Resolution.which('crm_node')
Traceback (most recent call last):
        9: from -e:1:in `<main>'
        8: from org/jruby/RubyKernel.java:1009:in `load'
        7: from /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/bin/irb:17:in `<main>'
        6: from org/jruby/RubyKernel.java:1189:in `catch'
        5: from org/jruby/RubyKernel.java:1189:in `catch'
        4: from org/jruby/RubyKernel.java:1442:in `loop'
        3: from org/jruby/RubyKernel.java:1048:in `eval'
        2: from (irb):2:in `evaluate'
        1: from org/jruby/RubyModule.java:3760:in `const_missing'
NameError (uninitialized constant Facter::Util)
irb(main):003:0>

Unfortunately I'm not quite sure how to fix this, because from my understanding functions should only use code and data from puppet and Hiera and should not query things themselves.

Regards,
Manfred

Revision history for this message
Manfred Pusch (manfred0p) wrote :

I fixed this by adding a pacemaker_node_list fact and make pcmk_nodes_added use it. Looks good so far, but I want to do some more testing, before filing a merge request.

Revision history for this message
Manfred Pusch (manfred0p) wrote :

If someone wants to do some tests or give me an opinion on my changes, here is the link to my fork:
https://github.com/ManfredP/puppet-pacemaker/tree/puppetmasterfix

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.