Fix ldap_backend and puppet 4.6

On xenial after update from puppet-agent 1.5 to 1.6, which include an
upgrade from 4.5 to 4.6 of puppet this code stopped working.

The ensure_resource in the keystone/init.pp manifest was not evaluated.
Adding this include seems to make it work again and we see that is the
log:

```
     Debug: Resource keystone_config[identity/domain_specific_drivers_enabled] was not determined to be defined
     Debug: Create new resource keystone_config[identity/domain_specific_drivers_enabled] with params {"value"=>true}
```

while without the include ::keystone, it's not there.

Puppet guru needed as to the why.

Change-Id: Ief78d70b8fe114ddf40d98fab93374862d3c23cb
This commit is contained in:
Sofer Athlan-Guyot 2016-08-12 19:52:48 +02:00
parent cab4e005ae
commit 2f76f68fad
2 changed files with 9 additions and 0 deletions

View File

@ -459,6 +459,7 @@ define keystone::ldap_backend(
) {
include ::keystone::deps
include ::keystone
$domain_enabled = getparam(Keystone_config['identity/domain_specific_drivers_enabled'], 'value')
$domain_dir_enabled = getparam(Keystone_config['identity/domain_config_dir'], 'value')

View File

@ -1,10 +1,15 @@
require 'spec_helper'
describe 'keystone::ldap_backend' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
describe 'Using Default domain' do
let(:title) { 'Default' }
let(:pre_condition) do
<<-EOM
class { '::keystone': admin_token => 'token'}
keystone_config {'identity/domain_specific_drivers_enabled': value => true}
keystone_config {'identity/domain_config_dir': value => '/etc/keystone/domains'}
file {'/etc/keystone/keystone.conf': ensure => present }
@ -204,6 +209,7 @@ describe 'keystone::ldap_backend' do
end
let(:pre_condition) do
<<-EOM
class { '::keystone': admin_token => 'token'}
keystone_config {'identity/domain_specific_drivers_enabled': value => true}
keystone_config {'identity/domain_config_dir': value => '/etc/keystone/domains'}
file {'/etc/keystone/keystone.conf': ensure => present }
@ -220,6 +226,7 @@ describe 'keystone::ldap_backend' do
context 'Missing identity/domain_specific_drivers_enabled' do
let(:pre_condition) do
<<-EOM
class { '::keystone': admin_token => 'token'}
keystone_config {'identity/domain_config_dir': value => '/etc/keystone/domains'}
file {'/etc/keystone/keystone.conf': ensure => present }
EOM
@ -230,6 +237,7 @@ describe 'keystone::ldap_backend' do
context 'Missing identity/domain_config_dir' do
let(:pre_condition) do
<<-EOM
class { '::keystone': admin_token => 'token'}
keystone_config {'identity/domain_specific_drivers_enabled': value => true}
file {'/etc/keystone/keystone.conf': ensure => present }
EOM