Tag all neutron packages

Some users wish to override the default package provider by their own.

Tag all packages with the 'openstack' to allow mass resource attributes
override using resource collectors.

Change-Id: I7ea5ae48f1bd2ab218b44cb68b20787b5d16e58d
Related-bug: #1391209
This commit is contained in:
Sergey Vasilenko 2014-11-11 12:37:20 +03:00 committed by Gael Chamoulaud
parent 5ee1d6aa3d
commit 2f71aa483e
41 changed files with 90 additions and 32 deletions

View File

@ -133,6 +133,7 @@ class neutron::agents::dhcp (
package { 'neutron-dhcp-agent':
ensure => $package_ensure,
name => $::neutron::params::dhcp_agent_package,
tag => 'openstack',
}
} else {
# Some platforms (RedHat) do not provide a neutron DHCP agent package.

View File

@ -180,6 +180,7 @@ class neutron::agents::l3 (
ensure => $package_ensure,
name => $::neutron::params::l3_agent_package,
require => Package['neutron'],
tag => 'openstack',
}
} else {
# Some platforms (RedHat) does not provide a neutron L3 agent package.

View File

@ -83,8 +83,8 @@ class neutron::agents::lbaas (
package { 'neutron-lbaas-agent':
ensure => $package_ensure,
name => $::neutron::params::lbaas_agent_package,
tag => 'openstack',
}
if $manage_service {
if $enabled {
$service_ensure = 'running'

View File

@ -43,6 +43,7 @@ class neutron::agents::linuxbridge (
package { 'neutron-plugin-linuxbridge-agent':
ensure => $package_ensure,
name => $::neutron::params::linuxbridge_agent_package,
tag => 'openstack',
}
} else {
# Some platforms (RedHat) do not provide a separate neutron plugin
@ -54,6 +55,7 @@ class neutron::agents::linuxbridge (
package { 'neutron-plugin-linuxbridge':
ensure => $package_ensure,
name => $::neutron::params::linuxbridge_server_package,
tag => 'openstack',
}
}
}

View File

@ -136,6 +136,7 @@ class neutron::agents::metadata (
ensure => $package_ensure,
name => $::neutron::params::metadata_agent_package,
require => Package['neutron'],
tag => 'openstack',
}
}

View File

@ -85,6 +85,7 @@ class neutron::agents::metering (
package { 'neutron-metering-agent':
ensure => $package_ensure,
name => $::neutron::params::metering_agent_package,
tag => 'openstack',
}
} else {
# Default dependency if the system does not provide a neutron metering agent package.

View File

@ -129,6 +129,7 @@ class neutron::agents::ml2::linuxbridge (
package { 'neutron-plugin-linuxbridge-agent':
ensure => $package_ensure,
name => $::neutron::params::linuxbridge_agent_package,
tag => 'openstack',
}
} else {
# Some platforms (RedHat) do not provide a separate
@ -137,6 +138,7 @@ class neutron::agents::ml2::linuxbridge (
package { 'neutron-plugin-linuxbridge-agent':
ensure => $package_ensure,
name => $::neutron::params::linuxbridge_server_package,
tag => 'openstack',
}
}
}

View File

@ -203,6 +203,7 @@ class neutron::agents::ml2::ovs (
package { 'neutron-ovs-agent':
ensure => $package_ensure,
name => $::neutron::params::ovs_agent_package,
tag => 'openstack',
}
} else {
# Some platforms (RedHat) do not provide a separate
@ -215,6 +216,7 @@ class neutron::agents::ml2::ovs (
package { 'neutron-ovs-agent':
ensure => $package_ensure,
name => $::neutron::params::ovs_server_package,
tag => 'openstack',
} ->
# https://bugzilla.redhat.com/show_bug.cgi?id=1087647
# Causes init script for agent to load the old ovs file

View File

@ -70,6 +70,7 @@ class neutron::agents::ml2::sriov (
package { 'neutron-sriov-nic-agent':
ensure => $package_ensure,
name => $::neutron::params::sriov_nic_agent_package,
tag => 'openstack',
}
if $enabled {

View File

@ -182,6 +182,7 @@ class neutron::agents::n1kv_vem (
ensure => $n1kv_version,
provider => $::neutron::params::package_provider,
source => $vemtgtimg,
tag => 'openstack',
require => File[$vemtgtimg]
}
} else {
@ -198,7 +199,8 @@ class neutron::agents::n1kv_vem (
}
}
package {'nexus1000v':
ensure => $package_ensure
ensure => $package_ensure,
tag => 'openstack',
}
}

View File

@ -117,6 +117,7 @@ class neutron::agents::ovs (
package { 'neutron-plugin-ovs-agent':
ensure => $package_ensure,
name => $::neutron::params::ovs_agent_package,
tag => 'openstack',
}
} else {
# Some platforms (RedHat) do not provide a separate
@ -128,6 +129,7 @@ class neutron::agents::ovs (
ensure_resource('package', 'neutron-plugin-ovs', {
ensure => $package_ensure,
name => $::neutron::params::ovs_server_package,
tag => 'openstack',
})
}

View File

@ -96,6 +96,7 @@ class neutron::agents::vpnaas (
package { 'neutron-vpnaas-agent':
ensure => $package_ensure,
name => $::neutron::params::vpnaas_agent_package,
tag => 'openstack',
}
} else {
Package['neutron'] -> Neutron_vpnaas_agent_config<||>

View File

@ -17,6 +17,7 @@ class neutron::client (
package { 'python-neutronclient':
ensure => $package_ensure,
name => $::neutron::params::client_package,
tag => 'openstack',
}
}

View File

@ -323,6 +323,7 @@ class neutron (
package { 'neutron':
ensure => $package_ensure,
name => $::neutron::params::package_name,
tag => 'openstack',
}
neutron_config {

View File

@ -122,6 +122,7 @@ class neutron::plugins::cisco(
package { 'neutron-plugin-cisco':
ensure => $package_ensure,
name => $::neutron::params::cisco_server_package,
tag => 'openstack',
}

View File

@ -51,6 +51,7 @@ class neutron::plugins::linuxbridge (
package { 'neutron-plugin-linuxbridge':
ensure => $package_ensure,
name => $::neutron::params::linuxbridge_server_package,
tag => 'openstack',
}
if $sql_connection {

View File

@ -148,6 +148,7 @@ class neutron::plugins::ml2 (
package { 'neutron-plugin-ml2':
ensure => $package_ensure,
name => $::neutron::params::ml2_server_package,
tag => 'openstack',
}
Package['neutron-plugin-ml2'] -> Neutron_plugin_ml2<||>
Package['neutron-plugin-ml2'] -> File['/etc/neutron/plugin.ini']

View File

@ -33,6 +33,7 @@ class neutron::plugins::ml2::cisco::nexus (
# and install it manually
package { 'python-ncclient':
ensure => installed,
tag => 'openstack',
} ~> Service['neutron-server']
Neutron_plugin_ml2<||> ->

View File

@ -39,7 +39,8 @@ class neutron::plugins::nvp (
package { 'neutron-plugin-nvp':
ensure => $package_ensure,
name => $::neutron::params::nvp_server_package
name => $::neutron::params::nvp_server_package,
tag => 'openstack',
}
validate_array($nvp_controllers)

View File

@ -30,6 +30,7 @@ class neutron::plugins::ovs (
package { 'neutron-plugin-ovs':
ensure => $package_ensure,
name => $::neutron::params::ovs_server_package,
tag => 'openstack',
}
}

View File

@ -344,6 +344,7 @@ class neutron::server (
package { 'neutron-server':
ensure => $package_ensure,
name => $::neutron::params::server_package,
tag => 'openstack',
}
} else {
# Some platforms (RedHat) does not provide a neutron-server package.

View File

@ -48,19 +48,25 @@ class neutron::services::fwaas (
if ($::osfamily == 'Debian') {
# Debian platforms
if $vpnaas_agent_package {
ensure_resource( 'package', $::neutron::params::vpnaas_agent_package,
{ 'ensure' => $neutron::package_ensure })
ensure_resource( 'package', $::neutron::params::vpnaas_agent_package, {
'ensure' => $neutron::package_ensure,
'tag' => 'openstack'
})
Package[$::neutron::params::vpnaas_agent_package] -> Neutron_fwaas_service_config<||>
}
else {
ensure_resource( 'package', $::neutron::params::l3_agent_package,
{ 'ensure' => $neutron::package_ensure })
ensure_resource( 'package', $::neutron::params::l3_agent_package, {
'ensure' => $neutron::package_ensure,
'tag' => 'openstack'
})
Package[$::neutron::params::l3_agent_package] -> Neutron_fwaas_service_config<||>
}
} elsif($::osfamily == 'Redhat') {
# RH platforms
ensure_resource( 'package', $::neutron::params::fwaas_package,
{ 'ensure' => $neutron::package_ensure })
ensure_resource( 'package', $::neutron::params::fwaas_package, {
'ensure' => $neutron::package_ensure,
'tag' => 'openstack'
})
Package[$::neutron::params::fwaas_package] -> Neutron_fwaas_service_config<||>
}

View File

@ -53,7 +53,8 @@ describe 'neutron::agents::dhcp' do
if platform_params.has_key?(:dhcp_agent_package)
is_expected.to contain_package('neutron-dhcp-agent').with(
:name => platform_params[:dhcp_agent_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron').with_before(/Package\[neutron-dhcp-agent\]/)
is_expected.to contain_package('neutron-dhcp-agent').with_before(/Neutron_dhcp_agent_config\[.+\]/)

View File

@ -63,7 +63,8 @@ describe 'neutron::agents::l3' do
is_expected.to contain_package('neutron-l3').with(
:name => platform_params[:l3_agent_package],
:ensure => p[:package_ensure],
:require => 'Package[neutron]'
:require => 'Package[neutron]',
:tag => 'openstack'
)
is_expected.to contain_package('neutron-l3').with_before(/Neutron_l3_agent_config\[.+\]/)
else

View File

@ -43,7 +43,8 @@ describe 'neutron::agents::lbaas' do
it 'installs neutron lbaas agent package' do
is_expected.to contain_package('neutron-lbaas-agent').with(
:name => platform_params[:lbaas_agent_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron').with_before(/Package\[neutron-lbaas-agent\]/)
is_expected.to contain_package('neutron-lbaas-agent').with_before(/Neutron_lbaas_agent_config\[.+\]/)

View File

@ -62,7 +62,8 @@ describe 'neutron::agents::linuxbridge' do
it 'installs neutron linuxbridge agent package' do
is_expected.to contain_package('neutron-plugin-linuxbridge-agent').with(
:ensure => params[:package_ensure],
:name => platform_params[:linuxbridge_agent_package]
:name => platform_params[:linuxbridge_agent_package],
:tag => 'openstack'
)
end
end
@ -82,7 +83,8 @@ describe 'neutron::agents::linuxbridge' do
it 'installs neutron linuxbridge package' do
is_expected.to contain_package('neutron-plugin-linuxbridge').with(
:ensure => params[:package_ensure],
:name => platform_params[:linuxbridge_server_package]
:name => platform_params[:linuxbridge_server_package],
:tag => 'openstack'
)
end
end

View File

@ -93,7 +93,8 @@ describe 'neutron::agents::metadata' do
it 'installs neutron metadata agent package' do
is_expected.to contain_package('neutron-metadata').with(
:ensure => params[:package_ensure],
:name => platform_params[:metadata_agent_package]
:name => platform_params[:metadata_agent_package],
:tag => 'openstack'
)
end

View File

@ -63,7 +63,8 @@ describe 'neutron::agents::metering' do
if platform_params.has_key?(:metering_agent_package)
is_expected.to contain_package('neutron-metering-agent').with(
:name => platform_params[:metering_agent_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron').with_before(/Package\[neutron-metering-agent\]/)
is_expected.to contain_package('neutron-metering-agent').with_before(/Neutron_metering_agent_config\[.+\]/)

View File

@ -44,7 +44,8 @@ describe 'neutron::agents::ml2::linuxbridge' do
is_expected.to contain_package('neutron-plugin-linuxbridge-agent').with(
:name => linuxbridge_agent_package,
:ensure => default_params[:package_ensure]
:ensure => default_params[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron-plugin-linuxbridge-agent').with_before(/Neutron_plugin_linuxbridge\[.+\]/)

View File

@ -57,7 +57,8 @@ describe 'neutron::agents::ml2::ovs' do
if platform_params.has_key?(:ovs_agent_package)
is_expected.to contain_package('neutron-ovs-agent').with(
:name => platform_params[:ovs_agent_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron-ovs-agent').with_before(/Neutron_plugin_ml2\[.+\]/)
else

View File

@ -35,7 +35,8 @@ describe 'neutron::agents::ml2::sriov' do
it 'installs neutron sriov-nic agent package' do
is_expected.to contain_package('neutron-sriov-nic-agent').with(
:name => platform_params[:sriov_nic_agent_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron-sriov-nic-agent').with_before(/Neutron_plugin_ml2\[.+\]/)
end

View File

@ -53,7 +53,8 @@ describe 'neutron::agents::ovs' do
if platform_params.has_key?(:ovs_agent_package)
is_expected.to contain_package('neutron-plugin-ovs-agent').with(
:name => platform_params[:ovs_agent_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron-plugin-ovs-agent').with_before(/Neutron_plugin_ovs\[.+\]/)
else
@ -88,7 +89,8 @@ describe 'neutron::agents::ovs' do
if platform_params.has_key?(:ovs_agent_package)
is_expected.to contain_package('neutron-plugin-ovs-agent').with(
:name => platform_params[:ovs_agent_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
end
end

View File

@ -72,7 +72,8 @@ describe 'neutron::agents::vpnaas' do
if platform_params.has_key?(:vpnaas_agent_package)
is_expected.to contain_package('neutron-vpnaas-agent').with(
:name => platform_params[:vpnaas_agent_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron').with_before(/Package\[neutron-vpnaas-agent\]/)
is_expected.to contain_package('neutron-vpnaas-agent').with_before(/Neutron_vpnaas_agent_config\[.+\]/)

View File

@ -95,7 +95,8 @@ describe 'neutron' do
it 'installs neutron package' do
is_expected.to contain_package('neutron').with(
:ensure => 'present',
:name => platform_params[:common_package_name]
:name => platform_params[:common_package_name],
:tag => 'openstack'
)
end

View File

@ -51,7 +51,8 @@ describe 'neutron::plugins::ml2::cisco::nexus' do
it 'installs ncclient package' do
is_expected.to contain_package('python-ncclient').with(
:ensure => 'installed'
:ensure => 'installed',
:tag => 'openstack'
)
end

View File

@ -21,7 +21,8 @@ describe 'neutron::plugins::linuxbridge' do
it 'installs neutron linuxbridge plugin package' do
is_expected.to contain_package('neutron-plugin-linuxbridge').with(
:ensure => params[:package_ensure],
:name => platform_params[:linuxbridge_plugin_package]
:name => platform_params[:linuxbridge_plugin_package],
:tag => 'openstack'
)
end

View File

@ -72,7 +72,8 @@ describe 'neutron::plugins::ml2' do
if platform_params.has_key?(:ml2_server_package)
is_expected.to contain_package('neutron-plugin-ml2').with(
:name => platform_params[:ml2_server_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron-plugin-ml2').with_before(/Neutron_plugin_ml2\[.+\]/)
end
@ -171,7 +172,8 @@ describe 'neutron::plugins::ml2' do
if platform_params.has_key?(:ml2_server_package)
is_expected.to contain_package('neutron-plugin-ml2').with(
:name => platform_params[:ml2_server_package],
:ensure => params[:package_ensure]
:ensure => params[:package_ensure],
:tag => 'openstack'
)
end
end

View File

@ -36,7 +36,8 @@ describe 'neutron::plugins::nvp' do
it 'should have' do
is_expected.to contain_package('neutron-plugin-nvp').with(
:name => platform_params[:nvp_server_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
end

View File

@ -39,7 +39,8 @@ describe 'neutron::plugins::ovs' do
is_expected.to contain_neutron_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
is_expected.to contain_package('neutron-plugin-ovs').with(
:name => platform_params[:ovs_server_package],
:ensure => params[:package_ensure]
:ensure => params[:package_ensure],
:tag => 'openstack'
)
is_expected.not_to contain_class('vswitch::ovs')
end

View File

@ -72,7 +72,8 @@ describe 'neutron::server' do
if platform_params.has_key?(:server_package)
is_expected.to contain_package('neutron-server').with(
:name => platform_params[:server_package],
:ensure => p[:package_ensure]
:ensure => p[:package_ensure],
:tag => 'openstack'
)
is_expected.to contain_package('neutron-server').with_before(/Neutron_api_config\[.+\]/)
is_expected.to contain_package('neutron-server').with_before(/Neutron_config\[.+\]/)

View File

@ -59,7 +59,10 @@ describe 'neutron::services::fwaas' do
it_configures 'neutron fwaas service plugin'
it 'installs neutron l3 agent package' do
is_expected.to contain_package('neutron-l3-agent').with_ensure('present')
is_expected.to contain_package('neutron-l3-agent').with(
:ensure => 'present',
:tag => 'openstack'
)
end
end
@ -80,7 +83,10 @@ describe 'neutron::services::fwaas' do
it_configures 'neutron fwaas service plugin'
it 'installs neutron vpnaas agent package' do
is_expected.to contain_package('neutron-vpn-agent').with_ensure('present')
is_expected.to contain_package('neutron-vpn-agent').with(
:ensure => 'present',
:tag => 'openstack'
)
end
end