overcloud deployment fails with "Duplicate declaration: Package[fence-agents-ipmilan]" when fencing is enabled

Bug #1958653 reported by Luca Miccini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-pacemaker
Fix Released
Undecided
Unassigned
tripleo
New
Undecided
Unassigned

Bug Description

After fixing #1955559 (commit 9f2e6f10a4883041cc3a086ee85be807af6bd4a0) we get:

FATAL | Run init bundle puppet on the host for oslo_messaging_rpc | messaging-0

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Duplicate declaration: Package[fence-agents-ipmilan] is already declared at (file: /etc/puppet/modules/pacemaker/manifests/install.pp, line: 40); cannot redeclare (file: /etc/puppet/modules/pacemaker/manifests/stonith/fence_ipmilan.pp, line: 216) (file: /etc/puppet/modules/pacemaker/manifests/stonith/fence_ipmilan.pp, line: 216, column: 5) (file: /etc/puppet/modules/tripleo/manifests/fencing.pp, line: 130) on node messaging-0.redhat.local",

Revision history for this message
Takashi Kajinami (kajinamit) wrote :

It seems the problem is that we use ensure_resource to manage packages but there are a slight different between

pacemaker::stonith::fence_ipmilan
~~~
216 ensure_resource('package', 'fence-agents-ipmilan', { ensure => 'installed' })
~~~

pacemaker::install
~~~
  ensure_resource('package', $::pacemaker::params::package_list, {
    ensure => present
  })
~~~

We should use one of installed/present. Or an alternative option is to use ensure_packages which deal with values(installed vs present) different but effectively same.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-pacemaker (master)
Changed in puppet-pacemaker:
status: New → In Progress
Revision history for this message
Takashi Kajinami (kajinamit) wrote (last edit ):

By the way I'm wondering what would be the benefit of installing these fence agent packages in core manifests like pacemaker::install.
The fence agent packages are installed by resource types to set up stonith resources, and there is not reason we always install the packages in base manifests

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-pacemaker (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/puppet-pacemaker/+/825927

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-pacemaker (master)

Reviewed: https://review.opendev.org/c/openstack/puppet-pacemaker/+/825926
Committed: https://opendev.org/openstack/puppet-pacemaker/commit/34bf907131041d3f11c6d1ace407651b550afbd1
Submitter: "Zuul (22348)"
Branch: master

commit 34bf907131041d3f11c6d1ace407651b550afbd1
Author: Takashi Kajinami <email address hidden>
Date: Sat Jan 22 22:45:19 2022 +0900

    Fix duplicate declaration of package resource

    This change replaces ensure_resource('package', ... ) by
    ensure_packages, which automatically converts ensure value to avoid
    conflict caused by present vs installed.

    Also, the ignored pacemaker::install::ensure is fixed by this change.

    Closes-Bug: #1958653
    Change-Id: I0cb2e32bbfcd056f4429b03d7ba67aaff8a5a760

Changed in puppet-pacemaker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-pacemaker (master)

Reviewed: https://review.opendev.org/c/openstack/puppet-pacemaker/+/825927
Committed: https://opendev.org/openstack/puppet-pacemaker/commit/e0fa810d23a564cfb3a840268693d63e6ee7994a
Submitter: "Zuul (22348)"
Branch: master

commit e0fa810d23a564cfb3a840268693d63e6ee7994a
Author: Takashi Kajinami <email address hidden>
Date: Sat Jan 22 22:54:03 2022 +0900

    Do not install fence-agent packages in base manifests

    ... because the required package is pulled by individual resource
    types to manage stonith resources.

    Related-Bug: #1958653
    Change-Id: I5183c6977002a7be0d6f3c03670205bc11334658

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-pacemaker 1.4.0

This issue was fixed in the openstack/puppet-pacemaker 1.4.0 release.

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.