diff --git a/manifests/init.pp b/manifests/init.pp index a30795cc..7878d35f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -231,7 +231,7 @@ # (optional) Service endpoint type to use when searching catalog. # Defaults to $::os_service_default # -# [*default_neutron_networks*] +# [*management_networks*] # (optional) The network that trove will attach by default. # Defaults to $::os_service_default. # @@ -239,6 +239,12 @@ # (optional) The state of the package. # Defaults to 'present' # +# DEPRECATED PARAMETERS +# +# [*default_neutron_networks*] +# (optional) The network that trove will attach by default. +# Defaults to undef +# class trove( $default_transport_url = $::os_service_default, $notification_transport_url = $::os_service_default, @@ -288,14 +294,21 @@ class trove( $glance_endpoint_type = $::os_service_default, $trove_endpoint_type = $::os_service_default, $neutron_endpoint_type = $::os_service_default, - $default_neutron_networks = $::os_service_default, + $management_networks = $::os_service_default, $package_ensure = 'present', + # DEPRECATED PARAMETERS + $default_neutron_networks = undef, ) { include trove::deps include trove::policy include trove::params + if $default_neutron_networks != undef { + warning('The default_neutron_networks parameter is deprecated. \ +Use the management_networks parameter.') + } + if $nova_compute_url { trove_config { 'DEFAULT/nova_compute_url': value => $nova_compute_url } } @@ -364,10 +377,15 @@ class trove( } } + $management_networks_real = pick($default_neutron_networks, $management_networks) trove_config { - 'DEFAULT/network_label_regex': value => '.*'; - 'DEFAULT/network_driver': value => 'trove.network.neutron.NeutronDriver'; - 'DEFAULT/default_neutron_networks': value => $default_neutron_networks; + 'DEFAULT/default_neutron_networks': ensure => absent; + } + + trove_config { + 'DEFAULT/network_label_regex': value => '.*'; + 'DEFAULT/network_driver': value => 'trove.network.neutron.NeutronDriver'; + 'DEFAULT/management_networks': value => join(any2array($management_networks_real), ','); } oslo::messaging::default { 'trove_config': diff --git a/releasenotes/notes/management-networks-cff664649b786960.yaml b/releasenotes/notes/management-networks-cff664649b786960.yaml new file mode 100644 index 00000000..b40c7c1f --- /dev/null +++ b/releasenotes/notes/management-networks-cff664649b786960.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The ``trove::default_neutron_networks`` parameter has been deprecated. Use + the new ``trove::management_networks`` parameter instead. diff --git a/spec/classes/trove_init_spec.rb b/spec/classes/trove_init_spec.rb index d33b46a8..8edeb9d5 100644 --- a/spec/classes/trove_init_spec.rb +++ b/spec/classes/trove_init_spec.rb @@ -51,7 +51,7 @@ describe 'trove' do is_expected.to contain_trove_config('DEFAULT/trove_endpoint_type').with_value('') is_expected.to contain_trove_config('DEFAULT/neutron_endpoint_type').with_value('') is_expected.to contain_trove_config('DEFAULT/glance_endpoint_type').with_value('') - is_expected.to contain_trove_config('DEFAULT/default_neutron_networks').with_value('') + is_expected.to contain_trove_config('DEFAULT/management_networks').with_value('') is_expected.to contain_trove_config('DEFAULT/remote_nova_client').with_ensure('absent') is_expected.to contain_trove_config('DEFAULT/remote_cinder_client').with_ensure('absent') is_expected.to contain_trove_config('DEFAULT/remote_neutron_client').with_ensure('absent') @@ -120,13 +120,13 @@ describe 'trove' do end end - context 'with default networks' do + context 'with management networks' do let :params do - { :default_neutron_networks => 'trove_service' } + { :management_networks => 'trove_service' } end - it 'configures default networks' do - is_expected.to contain_trove_config('DEFAULT/default_neutron_networks').with_value('trove_service') + it 'configures management networks' do + is_expected.to contain_trove_config('DEFAULT/management_networks').with_value('trove_service') end end end