From aa493b34c8d74470e604e8eb1bdfd1a2c508b4ea Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Tue, 10 Jan 2017 23:55:53 -0500 Subject: [PATCH] Enable IPA client install The puppet-ipaclient package is available in delorean. Therefore, we can enable the requires directive that will perform the ipa-client-install. Depends-On: I8e9bd4ed859cc438a309d9a00dd278c65dbb822d Change-Id: I6732af38d0f815d29cf4fa65149a54c8fb2c6527 --- manifests/metadata/novajoin/api.pp | 9 ++---- metadata.json | 4 +++ .../nova_metadata_novajoin_api_spec.rb | 32 ++++++++++++++++--- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/manifests/metadata/novajoin/api.pp b/manifests/metadata/novajoin/api.pp index 55bf84bac..9bf84c948 100644 --- a/manifests/metadata/novajoin/api.pp +++ b/manifests/metadata/novajoin/api.pp @@ -123,12 +123,9 @@ class nova::metadata::novajoin::api ( } } # Case $::osfamily - # Keep this commented out until puppet-ipaclient is available - # This will invoke ipa-client-install - # - # if $enable_ipa_client_install { - # require ::ipaclient - # } + if $enable_ipa_client_install { + require ::ipaclient + } package { 'python-novajoin': ensure => $ensure_package, diff --git a/metadata.json b/metadata.json index 490200c76..387b0c841 100644 --- a/metadata.json +++ b/metadata.json @@ -55,6 +55,10 @@ "name": "duritong/sysctl", "version_requirement": ">=0.0.1 <1.0.0" }, + { + "name": "joshuabaird/puppet-ipaclient", + "version_requirement": ">=2.5.1" + }, { "name": "openstack/cinder", "version_requirement": ">=10.1.0 <11.0.0" diff --git a/spec/classes/nova_metadata_novajoin_api_spec.rb b/spec/classes/nova_metadata_novajoin_api_spec.rb index cd0d661fd..5f30393df 100644 --- a/spec/classes/nova_metadata_novajoin_api_spec.rb +++ b/spec/classes/nova_metadata_novajoin_api_spec.rb @@ -5,9 +5,10 @@ describe 'nova::metadata::novajoin::api' do let :facts do @default_facts.merge( { - :osfamily => 'RedHat', - :processorcount => '7', - :fqdn => "undercloud.example.com", + :osfamily => 'RedHat', + :processorcount => '7', + :fqdn => "undercloud.example.com", + :operatingsystemrelease => '7.0', } ) end @@ -74,6 +75,10 @@ describe 'nova::metadata::novajoin::api' do param_hash end + let :pre_condition do + 'class { "::ipaclient": password => "join_otp", }' + end + it { is_expected.to contain_service('novajoin-server').with( 'ensure' => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running': 'stopped', 'enable' => param_hash[:enabled], @@ -123,6 +128,14 @@ describe 'nova::metadata::novajoin::api' do end describe 'with disabled service managing' do + let :facts do + OSDefaults.get_facts({ + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + :operatingsystemrelease => '7.0', + }) + end + let :params do { :manage_service => false, @@ -133,6 +146,10 @@ describe 'nova::metadata::novajoin::api' do } end + let :pre_condition do + 'class { "::ipaclient": password => "join_otp", }' + end + it { is_expected.to contain_service('novajoin-server').with( 'ensure' => nil, 'enable' => false, @@ -153,12 +170,17 @@ describe 'nova::metadata::novajoin::api' do describe 'on RedHat platforms' do let :facts do OSDefaults.get_facts({ - :osfamily => 'RedHat', - :operatingsystem => 'RedHat', + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + :operatingsystemrelease => '7.0', }) end let(:params) { default_params } + let :pre_condition do + 'class { "::ipaclient": password => "join_otp", }' + end + it { is_expected.to contain_package('python-novajoin').with( :tag => ['openstack', 'novajoin-package'], )}