diff --git a/manifests/init.pp b/manifests/init.pp index c747e6e2..07bef2db 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -359,15 +359,6 @@ class heat( password => $amqp_password, } - if !defined(Class[heat::trustee]) { - warning('The heat:trustee class will be required to set trustee option in a future release') - include heat::trustee - } - # TODO(tkajinam): Remove this when we remove the above logic - heat_config { - 'trustee/project_domain_name': ensure => absent; - } - if $heat_clients_url != undef { warning('The heat_clients_url parameter is deprecated. Use the heat::clients::heat class.') } diff --git a/manifests/trustee.pp b/manifests/trustee.pp index 40d29ccd..fd82175d 100644 --- a/manifests/trustee.pp +++ b/manifests/trustee.pp @@ -30,37 +30,20 @@ # Defaults to 'Default' # class heat::trustee ( - $password = undef, - $auth_type = undef, - $auth_url = undef, - $username = undef, - $user_domain_name = undef, + $password = $facts['os_service_default'], + $auth_type = 'password', + $auth_url = 'http://127.0.0.1:5000/', + $username = 'heat', + $user_domain_name = 'Default', ) { include heat::deps - if defined(Class[heat::keystone::authtoken]) { - # TODO(tkajinam): The following logic was added to keep compatibility with - # the old version which determines the trustee parameters based on - # authtoken parameters. This should be removed after Y release. - $password_real = pick($password, $::heat::keystone::authtoken::password) - $auth_type_real = pick($auth_type, $::heat::keystone::authtoken::auth_type) - $auth_url_real = pick($auth_url, $::heat::keystone::authtoken::auth_url) - $username_real = pick($username, $::heat::keystone::authtoken::username) - $user_domain_name_real = pick($user_domain_name, $::heat::keystone::authtoken::user_domain_name) - } else { - $password_real = pick($password, $facts['os_service_default']) - $auth_type_real = pick($auth_type, 'password') - $auth_url_real = pick($auth_url, 'http://127.0.0.1:5000/') - $username_real = pick($username, 'heat') - $user_domain_name_real = pick($user_domain_name, 'Default') - } - heat_config { - 'trustee/password': value => $password_real, secret => true; - 'trustee/auth_type': value => $auth_type_real; - 'trustee/auth_url': value => $auth_url_real; - 'trustee/username': value => $username_real; - 'trustee/user_domain_name': value => $user_domain_name_real; + 'trustee/password': value => $password, secret => true; + 'trustee/auth_type': value => $auth_type; + 'trustee/auth_url': value => $auth_url; + 'trustee/username': value => $username; + 'trustee/user_domain_name': value => $user_domain_name; } } diff --git a/releasenotes/notes/trustee-cleanup-3c8704e9a67ed03b.yaml b/releasenotes/notes/trustee-cleanup-3c8704e9a67ed03b.yaml new file mode 100644 index 00000000..34b324e1 --- /dev/null +++ b/releasenotes/notes/trustee-cleanup-3c8704e9a67ed03b.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The ``heat`` class no longer includes the ``heat:trustee`` class + automatically. Add the ``heat::trustee`` class to your manifests to + configure the ``[trustee]`` options. diff --git a/spec/classes/heat_init_spec.rb b/spec/classes/heat_init_spec.rb index 05da1d1c..1e5257e7 100644 --- a/spec/classes/heat_init_spec.rb +++ b/spec/classes/heat_init_spec.rb @@ -92,26 +92,6 @@ describe 'heat' do is_expected.to contain_heat_config('DEFAULT/max_json_body_size').with_value('') end - it 'configures user_domain_*' do - is_expected.to contain_heat_config('trustee/user_domain_name').with_value( 'Default' ) - end - - it 'configures auth_type' do - is_expected.to contain_heat_config('trustee/auth_type').with_value( 'password' ) - end - - it 'configures auth_url' do - is_expected.to contain_heat_config('trustee/auth_url').with_value( 'http://127.0.0.1:5000/' ) - end - - it 'configures username' do - is_expected.to contain_heat_config('trustee/username').with_value( 'heat' ) - end - - it 'configures ' do - is_expected.to contain_heat_config('trustee/password').with_secret( true ) - end - it 'configures endpoint_type for clients' do is_expected.to contain_heat_config('clients/endpoint_type').with_value( '' ) end @@ -302,17 +282,6 @@ describe 'heat' do end end - shared_examples_for "with custom keystone project_domain_* and user_domain_*" do - before do - params.merge!({ - :keystone_user_domain_name => 'domain1', - }) - end - it 'configures project_domain_* and user_domain_*' do - is_expected.to contain_heat_config('trustee/user_domain_name').with_value("domain1"); - end - end - shared_examples_for "with enable_stack_adopt and enable_stack_abandon set" do before do params.merge!({ diff --git a/spec/classes/heat_trustree_spec.rb b/spec/classes/heat_trustree_spec.rb index 81e5a4cb..a76b2d3c 100644 --- a/spec/classes/heat_trustree_spec.rb +++ b/spec/classes/heat_trustree_spec.rb @@ -35,50 +35,6 @@ describe 'heat::trustee' do is_expected.to contain_heat_config('trustee/user_domain_name').with_value('MyDomain') end end - - context 'with authtoken defaults' do - let :pre_condition do - "class { 'heat::keystone::authtoken': - password => 'heat_password', - }" - end - - let :params do - {} - end - - it 'configures trustee options' do - is_expected.to contain_heat_config('trustee/password').with_value('heat_password').with_secret(true) - is_expected.to contain_heat_config('trustee/auth_url').with_value('http://127.0.0.1:5000/') - is_expected.to contain_heat_config('trustee/auth_type').with_value('password') - is_expected.to contain_heat_config('trustee/username').with_value('heat') - is_expected.to contain_heat_config('trustee/user_domain_name').with_value('Default') - end - end - - context 'with authtoken parameters' do - let :pre_condition do - "class { 'heat::keystone::authtoken': - password => 'heat_password', - auth_type => 'v3password', - auth_url => 'https://localhost:13000/', - username => 'alt_heat', - user_domain_name => 'MyDomain', - }" - end - - let :params do - {} - end - - it 'configures trustee options' do - is_expected.to contain_heat_config('trustee/password').with_value('heat_password').with_secret(true) - is_expected.to contain_heat_config('trustee/auth_url').with_value('https://localhost:13000/') - is_expected.to contain_heat_config('trustee/auth_type').with_value('v3password') - is_expected.to contain_heat_config('trustee/username').with_value('alt_heat') - is_expected.to contain_heat_config('trustee/user_domain_name').with_value('MyDomain') - end - end end on_supported_os({