voxpupuli/puppet-corosync

cs_order fails with pcs provider because of score parameter

efoft opened this issue · 2 comments

efoft commented

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: puppet-agent-6.15.0-1.el7.x86_64
  • Ruby: ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
  • Distribution: CentOS 7.7, 7.8
  • Module version: master

How to reproduce (e.g Puppet code you use)

cs_order { 'drbd_before_fs':
    first  => 'ms_drbd:promote',
    second => 'drbd_mount:start',
    cib => 'puppet'
}

What are you seeing

Error: /Stage[main]/Profile::Ha::Nfs/Cs_order[drbd_before_fs]: Could not evaluate: Execution of '/usr/sbin/pcs constraint order promote ms_drbd then start drbd_mount INFINITY kind=Mandatory id=drbd_before_fs symmetrical=true -f /opt/puppetlabs/puppet/cache/shadow.puppet' returned 1: Error: missing value of 'INFINITY' option

What behaviour did you expect instead

Proper creation of cluster resources order without error.

Output log

Any additional information you'd like to impart

This errorneous INFINITY word in produced pcs command comes from the score parameter:

lib/puppet/type/cs_order.rb:

newproperty(:score) do
    desc "The priority of the this ordered grouping.  Primitives can be a part
      of multiple order groups and so there is a way to control which
      primitives get priority when forcing the order of state changes on
      other primitives.  This value can be an integer but is often defined
      as the string INFINITY."

    defaultto 'INFINITY'
  end

lib/puppet/provider/cs_order/pcs.rb:

score = if items['score']
                  items['score']
                else
                  'INFINITY'
                end

Actually neither pacemaker 1.1 nor 2.0 currently have score parameter for order constraints.
https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/1.1/html-single/Pacemaker_Explained/#idm140583457263504
https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_Explained/#idm47160732931568

Seems that score was completely replaced with kind feature some time ago.

Need to update the type and provider code to reflect current pcs syntax.

The schema for an order constraint indicates that either score or kind parameter can be passed in, but not both. https://github.com/ClusterLabs/pacemaker/blob/master/xml/constraints-3.5.rng#L155-L160

The problem is that this resource sets a default to both values.

Looks like this was fixed here: #450