Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cs_rsc_defaults not committed from shadow cib to live cib #528

Open
kossekm opened this issue Oct 5, 2022 · 0 comments
Open

cs_rsc_defaults not committed from shadow cib to live cib #528

kossekm opened this issue Oct 5, 2022 · 0 comments

Comments

@kossekm
Copy link

kossekm commented Oct 5, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.27.0
  • Ruby: 2.0.0p648
  • Distribution: RHEL
  • Module version: latest

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

We have the following cs_rsc_defaults section in our Puppet hiera:

corosync_local::cs_rsc_defaults:
  record-pending: {name: 'record-pending', value: 'false'}
  failure-timeout: {name: 'failure-timeout', value: '2h'}
  timeout: {name: 'timeout', value: '120'}

What are you seeing

We added a cs_rsc_defaults section to our Pacemaker configuration. The section gets added to the shadow /var/cache/puppet/shadow.puppet file, but not to the live configuration.

What behaviour did you expect instead

We expect to see the following section in /var/lib/pacemaker/cib/cib.xml:

    <rsc_defaults>
      <meta_attributes id="rsc_defaults-meta_attributes">
        <nvpair id="rsc_defaults-meta_attributes-record-pending" name="record-pending" value="false"/>
        <nvpair id="rsc_defaults-meta_attributes-failure-timeout" name="failure-timeout" value="2h"/>
        <nvpair id="rsc_defaults-meta_attributes-timeout" name="timeout" value="120"/>
      </meta_attributes>
    </rsc_defaults>

Output log

Running the Puppet agent with debug mode enabled:

[root@host 08:08:04][host][~]# puppet agent -t --debug | grep cs_rsc_defaults -i
Debug: Puppet::Type::Cs_rsc_defaults::ProviderCrm: file crm does not exist
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[record-pending]: Adding autorequire relationship with Service[corosync]
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[record-pending]: Adding autorequire relationship with Service[pacemaker]
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[failure-timeout]: Adding autorequire relationship with Service[corosync]
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[failure-timeout]: Adding autorequire relationship with Service[pacemaker]
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[timeout]: Adding autorequire relationship with Service[corosync]
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[timeout]: Adding autorequire relationship with Service[pacemaker]
Debug: Prefetching pcs resources for cs_rsc_defaults
Debug: Puppet::Type::Cs_rsc_defaults::ProviderPcs: Executing ["/usr/sbin/pcs", "cluster", "cib"] in the CIB
Debug: Cs_rsc_defaults[record-pending](provider=pcs): {}
Notice: /Stage[main]/Corosync_local/Cs_rsc_defaults[record-pending]/ensure: created (corrective)
Debug: Puppet::Type::Cs_rsc_defaults::ProviderPcs: Executing ["/usr/sbin/pcs", "resource", "defaults", "record-pending=false", "-f", "/var/cache/puppet/shadow.puppet"] in the shadow CIB "puppet"
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[record-pending]: The container Class[Corosync_local] will propagate my refresh event
Debug: Cs_rsc_defaults[failure-timeout](provider=pcs): {}
Notice: /Stage[main]/Corosync_local/Cs_rsc_defaults[failure-timeout]/ensure: created (corrective)
Debug: Puppet::Type::Cs_rsc_defaults::ProviderPcs: Executing ["/usr/sbin/pcs", "resource", "defaults", "failure-timeout=2h", "-f", "/var/cache/puppet/shadow.puppet"] in the shadow CIB "puppet"
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[failure-timeout]: The container Class[Corosync_local] will propagate my refresh event
Debug: Cs_rsc_defaults[timeout](provider=pcs): {}
Notice: /Stage[main]/Corosync_local/Cs_rsc_defaults[timeout]/ensure: created (corrective)
Debug: Puppet::Type::Cs_rsc_defaults::ProviderPcs: Executing ["/usr/sbin/pcs", "resource", "defaults", "timeout=120", "-f", "/var/cache/puppet/shadow.puppet"] in the shadow CIB "puppet"
Debug: /Stage[main]/Corosync_local/Cs_rsc_defaults[timeout]: The container Class[Corosync_local] will propagate my refresh event

Any additional information you'd like to impart

I tested changing the upstream module in a branch to see if I could get the change applied to the live cib. The following change seemed to work.

In upstream/corosync/lib/puppet/type/cs_commit.rb add the following two blocks:

    autorequire(:cs_rsc_defaults) do
      resources_with_cib :cs_rsc_defaults
    end

and

    autosubscribe(:cs_rsc_defaults) do
      resources_with_cib :cs_rsc_defaults
    end

In upstream/corosync/lib/puppet/type/cs_rsc_defaults.rb add the following block:

  autorequire(:cs_shadow) do
    autos = []
    autos << @parameters[:cib].value if @parameters[:cib]
    autos
  end
@kossekm kossekm changed the title Cs_rsc_defaults not committed from shadow cib to live cib cs_rsc_defaults not committed from shadow cib to live cib Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant