engine should not be including keystone stuff

Bug #1393293 reported by Matt Fischer
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
puppet-heat
Fix Released
Medium
Matt Fischer

Bug Description

In the rest of the modules, all of the auth stuff is isolated into a module called keystone/auth.pp, however recent changes to the engine class have added the following:

  if $configure_delegated_roles {
    keystone_role { $trusts_delegated_roles:
      ensure => present,
    }
  }

The issue with this is that the nodes I run heat on are not the same as the nodes where I run keystone. This leads to the following error message on the node where I have heat (and not keystone):

Error: /Stage[main]/Heat::Engine/Keystone_role[heat_stack_owner]: Could not evaluate: File: /etc/keystone/keystone.conf does not contain a section DEFAULT with the admin_token specified. Keystone types will not work if keystone is not correctly configured

I cannot include the engine class in my keystone role either since that won't work.

As far as I can tell in our deployment, this is the only example of a keystone_role outside of an auth file.

Revision history for this message
Emilien Macchi (emilienm) wrote :

You can set configure_delegated_roles to false and declare the keystone_role provider in your own manifest where keystone is running.

Revision history for this message
Matt Fischer (mfisch) wrote :

That will work but I think that this design violates how the rest of the modules seem to work, with all the keystone stuff isolated. Can we move this block into keystone/auth or similar?

Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

I met the same problem while running keystone on separate host. I have moved relevant code sections around with the following patch and it worked well for me.

Revision history for this message
Matt Fischer (mfisch) wrote :

Thats what I was thinking of doing for a fix, can you propose that upstream Vladislav?

Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

Yes, I will do it

Revision history for this message
Matt Fischer (mfisch) wrote :

@Vlad, did you submit a review? I can't find one.

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

Fix proposed to branch: master
Review: https://review.openstack.org/140854

Changed in puppet-heat:
assignee: nobody → Matt Fischer (mfisch)
status: New → In Progress
Revision history for this message
Emilien Macchi (emilienm) wrote :

@matt, you're right. Your patch makes sense. Reviews inline.

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

Reviewed: https://review.openstack.org/140854
Committed: https://git.openstack.org/cgit/stackforge/puppet-heat/commit/?id=74e874365933b3d7a07d6413762597e78efaaaa8
Submitter: Jenkins
Branch: master

commit 74e874365933b3d7a07d6413762597e78efaaaa8
Author: Matt Fischer <email address hidden>
Date: Tue Dec 9 21:54:28 2014 -0700

    Move keystone role creation to keystone area

    When the engine code does things with Keystone roles/etc it breaks when
    run on nodes that are not running Keystone. Some environments have
    Keystone in a separate node thereby causing issues. This moves it into
    the Keystone auth class to match the functaionality of other puppet
    modules and avoid this issue. The older parameters are deprecated but
    will still work.

    Based on the original patch by Vladislav Belogrudov.

    Change-Id: I3d6545cf1e5338b1098ee52daedcc17dc9ad990b
    Closes-Bug: #1393293

Changed in puppet-heat:
status: In Progress → Fix Committed
Matt Fischer (mfisch)
Changed in puppet-heat:
milestone: none → 5.0.0
Revision history for this message
Arnoud de Jonge (arnoud-dejonge-4) wrote :

Now it breaks when both keystone and heat are run on the same host, as heat::engine and heat::keystone auth now set DEFAULT/trusts_delegated_roles resulting in Puppet run failing:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Heat_config[DEFAULT/trusts_delegated_roles] is already declared in file /etc/puppet/environments/production/modules/heat/manifests/engine.pp:117; cannot redeclare at /etc/puppet/environments/production/modules/heat/manifests/keystone/auth.pp:170 on node controller1

Revision history for this message
Matt Fischer (mfisch) wrote :

Do you have configure_delegated_roles on for both files?

Revision history for this message
Arnoud de Jonge (arnoud-dejonge-4) wrote :

Here is my manifest, tried settings trusts_delegated_roles in both heat::engine as heat::keystone::auth. But both options fail.

  class { '::heat::engine':
    auth_encryption_key => $heat_encryption_key,
    configure_delegated_roles => false,
  }

  class { '::heat::keystone::auth':
    password => $heat_keystone_pass,
    public_address => $heat_endpoint,
    admin_address => $heat_endpoint,
    internal_address => $heat_endpoint,
    region => $region,
    configure_delegated_roles => true,
    trusts_delegated_roles => ['_member_'],
    configure_endpoint => false,
  }

Revision history for this message
Matt Fischer (mfisch) wrote :

This is how I use it, with hiera:

heat::engine::trusts_delegated_roles: ~
heat::engine::configure_delegated_roles: false
heat::keystone::auth::configure_delegated_roles: true

That first line shouldn't be needed though since the role is only enabled when $trusts_delegated_roles is enabled

Revision history for this message
Arnoud de Jonge (arnoud-dejonge-4) wrote :

Okay, trusts_delegated_roles is not really the issue. It's that both classes set DEFAULT/trusts_delegated_roles in heat.conf, resulting in the before mentioned error. I assumed that that was toggled with the configure_delegated_roles parameter, but that only toggles the keystone_role.

Revision history for this message
Arnoud de Jonge (arnoud-dejonge-4) wrote :

Sorry, I meant configure_delegated_roles.

Revision history for this message
Matt Fischer (mfisch) wrote :

So that's why my hiera data works. I clear out the engine setting.

Mathieu Gagné (mgagne)
Changed in puppet-heat:
milestone: 5.0.0 → 6.0.0
Changed in puppet-heat:
importance: Undecided → Medium
Matt Fischer (mfisch)
Changed in puppet-heat:
status: Fix Committed → Fix Released
Mathieu Gagné (mgagne)
Changed in puppet-heat:
status: Fix Released → Fix Committed
Mathieu Gagné (mgagne)
Changed in puppet-heat:
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.