network/providers: create public network only from neutron-server

The puppet provider which creates the networks should be declared from
the neutron-server node.

The catalog would fail on other nodes, that's why it's better to ensure
that the catalog contains neutron::server class if we want to manage the
external public network.

Closes-bug #564
This commit is contained in:
Emilien Macchi 2014-08-06 22:00:56 +02:00
parent ea76dbef74
commit d7110a979c
7 changed files with 20 additions and 48 deletions

View File

@ -196,12 +196,14 @@ class cloud::network(
vs_port {$external_int:
ensure => present,
bridge => $external_bridge
} ->
neutron_network {'public':
provider_network_type => 'flat',
provider_physical_network => 'public',
shared => true,
router_external => true
}
if defined('neutron::server') {
neutron_network {'public':
provider_network_type => 'flat',
provider_physical_network => 'public',
shared => true,
router_external => true
}
}
}

View File

@ -438,13 +438,8 @@ describe 'cloud::compute::hypervisor' do
:bridge => 'br-pub'
)
end
it 'configure provider external network' do
should contain_neutron_network('public').with(
:provider_network_type => 'flat',
:provider_physical_network => 'public',
:shared => true,
:router_external => true
)
it 'should not configure provider external network' do
should_not contain__neutron_network('public')
end
end
end

View File

@ -131,13 +131,8 @@ describe 'cloud::network::dhcp' do
:bridge => 'br-pub'
)
end
it 'configure provider external network' do
should contain_neutron_network('public').with(
:provider_network_type => 'flat',
:provider_physical_network => 'public',
:shared => true,
:router_external => true
)
it 'should not configure provider external network' do
should_not contain__neutron_network('public')
end
end
end

View File

@ -147,13 +147,8 @@ describe 'cloud::network::l3' do
:bridge => 'br-pub'
)
end
it 'configure provider external network' do
should contain_neutron_network('public').with(
:provider_network_type => 'flat',
:provider_physical_network => 'public',
:shared => true,
:router_external => true
)
it 'should not configure provider external network' do
should_not contain__neutron_network('public')
end
end
end

View File

@ -146,13 +146,8 @@ describe 'cloud::network::lbaas' do
:bridge => 'br-pub'
)
end
it 'configure provider external network' do
should contain_neutron_network('public').with(
:provider_network_type => 'flat',
:provider_physical_network => 'public',
:shared => true,
:router_external => true
)
it 'should not configure provider external network' do
should_not contain__neutron_network('public')
end
end
end

View File

@ -136,13 +136,8 @@ describe 'cloud::network::metadata' do
:bridge => 'br-pub'
)
end
it 'configure provider external network' do
should contain_neutron_network('public').with(
:provider_network_type => 'flat',
:provider_physical_network => 'public',
:shared => true,
:router_external => true
)
it 'should not configure provider external network' do
should_not contain__neutron_network('public')
end
end
end

View File

@ -113,13 +113,8 @@ describe 'cloud::network::vpn' do
:bridge => 'br-pub'
)
end
it 'configure provider external network' do
should contain_neutron_network('public').with(
:provider_network_type => 'flat',
:provider_physical_network => 'public',
:shared => true,
:router_external => true
)
it 'should not configure provider external network' do
should_not contain__neutron_network('public')
end
end
end