Puppet Duplicate declaration error when role is composed with both Ceph OSDs and Mons

Bug #1722633 reported by John Fulton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Low
Lucas hua

Bug Description

If THT's roles_data.yaml is modified to add OS::TripleO::Services::CephOSD to the Controller role, the deployment fails with:

Error: Duplicate declaration: Class[Ceph::Keys] is already declared in file
/etc/puppet/modules/ceph/manifests/profile/client.pp:32; cannot redeclare at
/etc/puppet/modules/ceph/manifests/profile/mon.pp:43 on node
overcloud-controller-0.localdomain

Tags: puppet
Changed in tripleo:
importance: Undecided → Low
Revision history for this message
Alex Schultz (alex-schultz) wrote :

There's an ordering issue, if you the catalog gets ceph::profile::osd before ceph::profile::mon you get the failure.

Probably need to wrap the client::keys call in ceph::profile::mon https://github.com/openstack/puppet-ceph/blob/master/manifests/profile/mon.pp#L39 similar to the way we do it for the client https://github.com/openstack/puppet-ceph/blob/master/manifests/profile/client.pp#L28

Revision history for this message
John Fulton (jfulton-org) wrote :

Yep, I had created this only to track the fix: https://review.openstack.org/#/c/511001

Revision history for this message
Giulio Fidente (gfidente) wrote :

Not sure how to triage the bug which affects only puppet-ceph so < pike

Though from the conversation we're having in the submission, there is indeed an ordering problem if ::osd imports ::client before ::mon but I am not sure we can use the if condition because ::mon is calling ceph::keys with different defaults [1] so that the keys are injected into the cluster where ::client would not. This is because ::mon has credentials to do the injection.

Seems a pretty complicated issue to solve to me :D

1. https://github.com/openstack/puppet-ceph/blob/master/manifests/profile/mon.pp#L42

Changed in tripleo:
milestone: queens-2 → queens-3
Changed in tripleo:
milestone: queens-3 → queens-rc1
Changed in tripleo:
milestone: queens-rc1 → rocky-1
Lucas hua (lucas.hua)
Changed in tripleo:
assignee: John Fulton (jfulton-org) → binhong.hua (binhong.hua)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/553416
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=58d1e814c658bb41c16023b95044b5bff3dd57af
Submitter: Zuul
Branch: master

commit 58d1e814c658bb41c16023b95044b5bff3dd57af
Author: binhong.hua <email address hidden>
Date: Thu Mar 15 22:34:17 2018 +0800

    remove OS::TripleO::Services::CephClient from CephAll

    CephClient should be removed from the CephAll role.
    The only thing it does is the key set which is already
    handled by the ceph mon profile.
    if not will cause Duplicate declaration: Class[Ceph::Keys]

    Change-Id: I77bbec1edd21cd6a4212a381a1a7712adc4b604f
    Related-Bug: 1722633

Lucas hua (lucas.hua)
Changed in tripleo:
status: Triaged → Fix Committed
Revision history for this message
John Fulton (jfulton-org) wrote :

In summary, if THT's roles_data.yaml is modified to add OS::TripleO::Services::CephOSD to the Controller role, the deployment fails ONLY if you include the CephClient service though this shouldn't be necessary as the other roles will do what the CephClient services does an example of how to resolve this by composing a working role is done in https://review.openstack.org/553416. Also, this issue only happens if you are using puppet-ceph (this doesn't happen with Pike and newer which uses ceph-ansible by default).

Changed in tripleo:
status: Fix Committed → Fix Released
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.