Make email parameter optional in roles::admin

The email parameter was mandatory even if it is not used when setting
configure_user to false.
This commit make the email parameter optional and set a default value to
admin@localhost.

Change-Id: I2cb092b27b8b3ea2fa082d7bd1b5a20e712c54e4
Signed-off-by: Arnaud Morin <arnaud.morin@gmail.com>
This commit is contained in:
Arnaud Morin
2017-01-19 09:53:26 +01:00
committed by daniel.pawlik
parent 797921d8f8
commit 9b5e8e2bc2
3 changed files with 11 additions and 8 deletions

View File

@@ -11,13 +11,14 @@
# #
# === Parameters: # === Parameters:
# #
# [*email*]
# The email address for the admin. Required.
#
# [*password*] # [*password*]
# The admin password. Required. In a later release # The admin password. Required. In a later release
# this will default to $keystone::admin_password. # this will default to $keystone::admin_password.
# #
# [*email*]
# The email address for the admin. Optional.
# Defaults to 'admin@localhost'.
#
# [*admin_roles*] # [*admin_roles*]
# The list of the roles with admin privileges. Optional. # The list of the roles with admin privileges. Optional.
# Defaults to ['admin']. # Defaults to ['admin'].
@@ -78,8 +79,8 @@
# Copyright 2012 Puppetlabs Inc, unless otherwise noted. # Copyright 2012 Puppetlabs Inc, unless otherwise noted.
# #
class keystone::roles::admin( class keystone::roles::admin(
$email,
$password, $password,
$email = 'admin@localhost',
$admin = 'admin', $admin = 'admin',
$admin_tenant = 'openstack', $admin_tenant = 'openstack',
$admin_roles = ['admin'], $admin_roles = ['admin'],

View File

@@ -0,0 +1,4 @@
---
features:
- Email parameter is now optional for roles::admin and
the default value will be admin@localhost.

View File

@@ -18,9 +18,7 @@ describe 'keystone::roles::admin' do
describe 'with only the required params set' do describe 'with only the required params set' do
let :params do let :params do
{ {
:email => 'foo@bar', :password => 'ChangeMe'
:password => 'ChangeMe',
:service_tenant => 'services'
} }
end end
@@ -37,7 +35,7 @@ describe 'keystone::roles::admin' do
it { is_expected.to contain_keystone_user('admin').with( it { is_expected.to contain_keystone_user('admin').with(
:ensure => 'present', :ensure => 'present',
:enabled => true, :enabled => true,
:email => 'foo@bar', :email => 'admin@localhost',
:password => 'ChangeMe', :password => 'ChangeMe',
)} )}
it { is_expected.to contain_keystone_role('admin').with_ensure('present') } it { is_expected.to contain_keystone_role('admin').with_ensure('present') }