Merge "Don't use Pacemaker for Neutron agents on compute nodes"

This commit is contained in:
Jenkins 2015-11-26 10:56:36 +00:00 committed by Gerrit Code Review
commit c8957483a6
5 changed files with 144 additions and 79 deletions

View File

@ -19,7 +19,7 @@ if $use_neutron and ($controller or ($dvr and $compute)) {
if $controller {
if $dvr {
$agent_mode = 'dvr-snat'
$agent_mode = 'dvr_snat'
} else {
$agent_mode = 'legacy'
}
@ -42,7 +42,7 @@ if $use_neutron and ($controller or ($dvr and $compute)) {
agent_mode => $agent_mode,
}
if $ha_agent {
if ($ha_agent) and !($compute) {
$primary_controller = hiera('primary_controller')
cluster::neutron::l3 { 'default-l3' :
primary => $primary_controller,

View File

@ -1,13 +1,19 @@
notice('MODULAR: openstack-network/agents/metadata.pp')
$use_neutron = hiera('use_neutron', false)
$use_neutron = hiera('use_neutron', false)
$role = hiera('role')
$neutron_controller_roles = hiera('neutron_controller_roles', ['controller', 'primary-controller'])
$neutron_compute_roles = hiera('neutron_compute_nodes', ['compute'])
$controller = $role in $neutron_controller_roles
$compute = $role in $neutron_compute_roles
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
$dvr = pick($neutron_advanced_config['neutron_dvr'], false)
class neutron {}
class { 'neutron' :}
if $use_neutron {
if $use_neutron and ($controller or ($dvr and $compute)) {
$debug = hiera('debug', true)
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
$ha_agent = try_get_value($neutron_advanced_config, 'metadata_agent_ha', true)
$auth_region = hiera('region', 'RegionOne')
@ -40,7 +46,7 @@ if $use_neutron {
enabled => true,
}
if $ha_agent {
if ($ha_agent) and !($compute) {
$primary_controller = hiera('primary_controller')
class { 'cluster::neutron::metadata' :
primary => $primary_controller,

View File

@ -107,9 +107,9 @@
- id: openstack-network-agents-metadata
type: puppet
groups: [primary-controller,controller]
groups: [primary-controller,controller,compute]
required_for: [openstack-network-end]
requires: [openstack-network-common-config,openstack-network-server-nova,openstack-network-agents-l3,openstack-network-agents-dhcp]
requires: [openstack-network-common-config,openstack-network-server-nova,openstack-network-agents-l3]
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/openstack-network/agents/metadata.pp
puppet_modules: /etc/puppet/modules
@ -119,7 +119,7 @@
type: puppet
groups: [compute]
required_for: [openstack-network-end]
requires: [openstack-network-common-config,openstack-network-agents-l3]
requires: [openstack-network-common-config,openstack-network-agents-l3,openstack-network-agents-metadata]
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/openstack-network/compute-nova.pp
puppet_modules: /etc/puppet/modules

View File

@ -70,6 +70,7 @@ describe manifest do
it { should contain_class('neutron::agents::l3').with(
'router_delete_namespaces' => true
)}
it { should_not contain_cluster__neutron__l3('default-l3') }
else
it { should_not contain_class('neutron::agents::l3') }
end
@ -79,7 +80,7 @@ describe manifest do
context 'with Neutron-l3-agent on controller' do
na_config = Noop.hiera_hash('neutron_advanced_configuration')
dvr = na_config.fetch('neutron_dvr', false)
agent_mode = (dvr ? 'dvr-snat' : 'legacy')
agent_mode = (dvr ? 'dvr_snat' : 'legacy')
ha_agent = na_config.fetch('l3_agent_ha', true)
l2pop = na_config.fetch('neutron_l2_pop', false)

View File

@ -4,7 +4,7 @@ manifest = 'openstack-network/agents/metadata.pp'
describe manifest do
shared_examples 'catalog' do
if (Noop.hiera('use_neutron') and Noop.hiera('role') =~ /controller/)
if Noop.hiera('use_neutron')
let(:node_role) do
Noop.hiera('role')
@ -14,81 +14,139 @@ describe manifest do
Noop.hiera_structure 'configuration'
end
let(:neutron_metadata_agent_config_override_resources) do
configuration_override.fetch('neutron_metadata_agent_config', {})
end
na_config = Noop.hiera_hash('neutron_advanced_configuration')
neutron_config = Noop.hiera_hash('neutron_config')
neutron_controller_roles = Noop.hiera('neutron_controller_nodes', ['controller', 'primary-controller'])
neutron_compute_roles = Noop.hiera('neutron_compute_nodes', ['compute'])
isolated_metadata = neutron_config.fetch('metadata',{}).fetch('isolated_metadata', true)
ha_agent = na_config.fetch('dhcp_agent_ha', true)
it 'neutron metadata agent config should be modified by override_resources' do
is_expected.to contain_override_resources('neutron_metadata_agent_config').with(:data => neutron_metadata_agent_config_override_resources)
end
ks = neutron_config.fetch('keystone',{})
ks_user = ks.fetch('admin_user', 'neutron')
ks_tenant = ks.fetch('admin_tenant', 'services')
ks_password = ks.fetch('admin_password')
it 'should use "override_resources" to update the catalog' do
ral_catalog = Noop.create_ral_catalog self
neutron_metadata_agent_config_override_resources.each do |title, params|
params['value'] = 'True' if params['value'].is_a? TrueClass
expect(ral_catalog).to contain_neutron_metadata_agent_config(title).with(params)
end
end
secret = neutron_config.fetch('metadata',{}).fetch('metadata_proxy_shared_secret')
context 'with Neutron-l3-agent on controller' do
na_config = Noop.hiera_hash('neutron_advanced_configuration')
neutron_config = Noop.hiera_hash('neutron_config')
isolated_metadata = neutron_config.fetch('metadata',{}).fetch('isolated_metadata', true)
ha_agent = na_config.fetch('dhcp_agent_ha', true)
management_vip = Noop.hiera('management_vip')
nova_endpoint = Noop.hiera('nova_endpoint', management_vip)
auth_region = Noop.hiera('region', 'RegionOne')
service_endpoint = Noop.hiera('service_endpoint')
auth_api_version = 'v2.0'
admin_identity_uri = "http://#{service_endpoint}:35357"
admin_auth_url = "#{admin_identity_uri}/#{auth_api_version}"
ks = neutron_config.fetch('keystone',{})
ks_user = ks.fetch('admin_user', 'neutron')
ks_tenant = ks.fetch('admin_tenant', 'services')
ks_password = ks.fetch('admin_password')
if neutron_compute_roles.include?(Noop.hiera('role'))
context 'neutron-metadata-agent on compute' do
na_config = Noop.hiera_hash('neutron_advanced_configuration')
dvr = na_config.fetch('neutron_dvr', false)
if dvr
let(:neutron_metadata_agent_config_override_resources) do
configuration_override.fetch('neutron_metadata_agent_config', {})
end
secret = neutron_config.fetch('metadata',{}).fetch('metadata_proxy_shared_secret')
management_vip = Noop.hiera('management_vip')
nova_endpoint = Noop.hiera('nova_endpoint', management_vip)
auth_region = Noop.hiera('region', 'RegionOne')
service_endpoint = Noop.hiera('service_endpoint')
auth_api_version = 'v2.0'
admin_identity_uri = "http://#{service_endpoint}:35357"
admin_auth_url = "#{admin_identity_uri}/#{auth_api_version}"
it { should contain_class('neutron::agents::metadata').with(
'debug' => Noop.hiera('debug', true)
)}
it { should contain_class('neutron::agents::metadata').with(
'enabled' => true
)}
it { should contain_class('neutron::agents::metadata').with(
'manage_service' => true
)}
it { should contain_class('neutron::agents::metadata').with(
'metadata_ip' => nova_endpoint
)}
it { should contain_class('neutron::agents::metadata').with(
'shared_secret' => secret
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_region' => auth_region
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_url' => admin_auth_url
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_user' => ks_user
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_tenant' => ks_tenant
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_password' => ks_password
)}
if ha_agent
it { should contain_class('cluster::neutron::metadata').with(
'primary' => (node_role == 'primary-controller')
)}
else
it { should contain_class('neutron::agents::metadata').with(
'debug' => Noop.hiera('debug', true)
)}
it { should contain_class('neutron::agents::metadata').with(
'enabled' => true
)}
it { should contain_class('neutron::agents::metadata').with(
'manage_service' => true
)}
it { should contain_class('neutron::agents::metadata').with(
'metadata_ip' => nova_endpoint
)}
it { should contain_class('neutron::agents::metadata').with(
'shared_secret' => secret
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_region' => auth_region
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_url' => admin_auth_url
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_user' => ks_user
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_tenant' => ks_tenant
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_password' => ks_password
)}
it 'neutron metadata agent config should be modified by override_resources' do
is_expected.to contain_override_resources('neutron_metadata_agent_config').with(:data => neutron_metadata_agent_config_override_resources)
end
it 'should use "override_resources" to update the catalog' do
ral_catalog = Noop.create_ral_catalog self
neutron_metadata_agent_config_override_resources.each do |title, params|
params['value'] = 'True' if params['value'].is_a? TrueClass
expect(ral_catalog).to contain_neutron_metadata_agent_config(title).with(params)
end
end
else
it { should_not contain_class('neutron::agents::metadata') }
end
it { should_not contain_class('cluster::neutron::metadata') }
end
elsif neutron_controller_roles.include?(Noop.hiera('role'))
context 'with neutron-metadata-agent on controller' do
let(:neutron_metadata_agent_config_override_resources) do
configuration_override.fetch('neutron_metadata_agent_config', {})
end
it 'neutron metadata agent config should be modified by override_resources' do
is_expected.to contain_override_resources('neutron_metadata_agent_config').with(:data => neutron_metadata_agent_config_override_resources)
end
it 'should use "override_resources" to update the catalog' do
ral_catalog = Noop.create_ral_catalog self
neutron_metadata_agent_config_override_resources.each do |title, params|
params['value'] = 'True' if params['value'].is_a? TrueClass
expect(ral_catalog).to contain_neutron_metadata_agent_config(title).with(params)
end
end
it { should contain_class('neutron::agents::metadata').with(
'debug' => Noop.hiera('debug', true)
)}
it { should contain_class('neutron::agents::metadata').with(
'enabled' => true
)}
it { should contain_class('neutron::agents::metadata').with(
'manage_service' => true
)}
it { should contain_class('neutron::agents::metadata').with(
'metadata_ip' => nova_endpoint
)}
it { should contain_class('neutron::agents::metadata').with(
'shared_secret' => secret
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_region' => auth_region
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_url' => admin_auth_url
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_user' => ks_user
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_tenant' => ks_tenant
)}
it { should contain_class('neutron::agents::metadata').with(
'auth_password' => ks_password
)}
if ha_agent
it { should contain_class('cluster::neutron::metadata').with(
'primary' => (node_role == 'primary-controller')
)}
else
it { should_not contain_class('cluster::neutron::metadata') }
end
end
end
end
end