Rename quantum to neutron.

Global replacement of all Quantum references with Neutron.

Change-Id: I74ad15e382589ced6f47d0783e3e952627fcd0f7
This commit is contained in:
Dan Prince 2013-08-05 13:20:54 -04:00
parent a8fd302d6f
commit c5005c221f
93 changed files with 1442 additions and 1441 deletions

View File

@ -9,4 +9,4 @@ fixtures:
"nova": "git://github.com/stackforge/puppet-nova.git"
"vswitch": "git://github.com/bodepd/puppet-vswitch"
symlinks:
"quantum": "#{source_dir}"
"neutron": "#{source_dir}"

View File

@ -1,11 +1,11 @@
name 'puppet-quantum'
name 'puppet-neutron'
version '2.1.1'
source 'https://github.com/CiscoSystems/puppet-quantum'
source 'https://github.com/CiscoSystems/puppet-neutron'
author 'Joe Topjian,Endre Karlson,Emilien Macchi,Dan Bode,Dmitry Ukov,Edgar Mangana,Robert Starmer,Ian Wells,Daneyon Hansen'
license 'Apache License 2.0'
summary 'Puppet module for OpenStack Quantum'
description 'Puppet module to install and configure the OpenStack network service, Quantum'
project_page 'https://github.com/CiscoSystems/puppet-quantum'
summary 'Puppet module for OpenStack Neutron'
description 'Puppet module to install and configure the OpenStack network service, Neutron'
project_page 'https://github.com/stackforge/puppet-neutron'
# Dependencies
dependency 'puppetlabs/vswitch', '>=0.0.1 <1.0.0'

View File

@ -1,11 +1,11 @@
quantum
neutron
===================================
#### Table of Contents
1. [Overview - What is the quantum module?](#overview)
1. [Overview - What is the neutron module?](#overview)
2. [Module Description - What does the module do?](#module-description)
3. [Setup - Tha basics of getting started with quantum.](#setup)
3. [Setup - Tha basics of getting started with neutron.](#setup)
4. [Implementation - An under-the-hood peek at what the module is doing.](#implementation)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)
@ -15,68 +15,68 @@ quantum
Overview
--------
The quantum module is a part of [Stackforge](https://github.com/stackforge), an effort by the Openstack infrastructure team to provide continuous integration testing and code review for Openstack and Openstack community projects not part of the core software. The module itself is used to flexibly configure and manage the newtork service for Openstack.
The neutron module is a part of [Stackforge](https://github.com/stackforge), an effort by the Openstack infrastructure team to provide continuous integration testing and code review for Openstack and Openstack community projects not part of the core software. The module itself is used to flexibly configure and manage the newtork service for Openstack.
Module Description
------------------
The quantum module is an attempt to make Puppet capable of managing the entirety of quantum. This includes manifests to provision such things as keystone endpoints, RPC configurations specific to quantum, database connections, and network driver plugins. Types are shipped as part of the quantum module to assist in manipulation of the Openstack configuration files.
The neutron module is an attempt to make Puppet capable of managing the entirety of neutron. This includes manifests to provision such things as keystone endpoints, RPC configurations specific to neutron, database connections, and network driver plugins. Types are shipped as part of the neutron module to assist in manipulation of the Openstack configuration files.
This module is tested in combination with other modules needed to build and leverage an entire Openstack installation. These modules can be found, all pulled together in the [openstack module](https://github.com/stackforge/puppet-openstack).
Setup
-----
**What the quantum module affects:**
**What the neutron module affects:**
* [Quantum](https://wiki.openstack.org/wiki/Quantum), the network service for Openstack.
* [Neutron](https://wiki.openstack.org/wiki/Neutron), the network service for Openstack.
### Installing quantum
### Installing neutron
puppet module install puppetlabs/quantum
puppet module install puppetlabs/neutron
### Beginning with quantum
### Beginning with neutron
To utilize the quantum module's functionality you will need to declare multiple resources. The following is a modified excerpt from the [openstack module](httpd://github.com/stackforge/puppet-openstack). It provides an example of setting up an Open vSwitch quantum installation. This is not an exhaustive list of all the components needed. We recommend that you consult and understand the [openstack module](https://github.com/stackforge/puppet-openstack) and the [core openstack](http://docs.openstack.org) documentation to assist you in understanding the available deployment options.
To utilize the neutron module's functionality you will need to declare multiple resources. The following is a modified excerpt from the [openstack module](httpd://github.com/stackforge/puppet-openstack). It provides an example of setting up an Open vSwitch neutron installation. This is not an exhaustive list of all the components needed. We recommend that you consult and understand the [openstack module](https://github.com/stackforge/puppet-openstack) and the [core openstack](http://docs.openstack.org) documentation to assist you in understanding the available deployment options.
```puppet
# enable the quantum service
class { '::quantum':
# enable the neutron service
class { '::neutron':
enabled => true,
bind_host => '127.0.0.1',
rabbit_host => '127.0.0.1',
rabbit_user => 'quantum',
rabbit_user => 'neutron',
rabbit_password => 'rabbit_secret',
verbose => false,
debug => false,
}
# configure authentication
class { 'quantum::server':
class { 'neutron::server':
auth_host => '127.0.0.1', # the keystone host address
auth_password => 'keystone_quantum_secret',
auth_password => 'keystone_neutron_secret',
}
# enable the Open VSwitch plugin server
class { 'quantum::plugins::ovs':
sql_connection => 'mysql://quantum:quantum_sql_secret@127.0.0.1/quantum?charset=utf8',
class { 'neutron::plugins::ovs':
sql_connection => 'mysql://neutron:neutron_sql_secret@127.0.0.1/neutron?charset=utf8',
tenant_network_type => 'gre',
network_vlan_ranges => 'physnet:1000:2000',
}
```
Other quantum network drivers include:
Other neutron network drivers include:
* dhcp,
* metadata,
* and l3.
Nova will also need to be configured to connect to the quantum service. Setting up the `nova::network::quantum` class sets
the `network_api_class` parameter in nova to use quantum instead of nova-network.
Nova will also need to be configured to connect to the neutron service. Setting up the `nova::network::neutron` class sets
the `network_api_class` parameter in nova to use neutron instead of nova-network.
```puppet
class { 'nova::network::quantum':
quantum_admin_password => 'quantum_admin_secret',
class { 'nova::network::neutron':
neutron_admin_password => 'neutron_admin_secret',
}
```
@ -86,25 +86,26 @@ The `examples` directory also provides a quick tutorial on how to use this modul
Implementation
--------------
### quantum
### neutron
quantum is a combination of Puppet manifest and ruby code to deliver configuration and extra functionality through *types* and *providers*.
neutron is a combination of Puppet manifest and ruby code to deliver configuration and extra functionality through *types* and *providers*.
Limitations
-----------
This module supports the following quantum plugins:
This module supports the following neutron plugins:
* Open vSwitch
* linuxbridge
* cisco-quantum
* cisco-neutron
The following platforms are supported:
* Ubuntu 12.04 (Precise)
* Debian (Wheezy)
* RHEL 6
* Fedora 18
Development
-----------
@ -115,4 +116,4 @@ The puppet-openstack modules follow the Openstack development model. Developer d
Contributors
------------
The github [contributor graph](https://github.com/stackforge/puppet-quantum/graphs/contributors).
The github [contributor graph](https://github.com/stackforge/puppet-neutron/graphs/contributors).

View File

@ -1,9 +1,9 @@
#
# This manifest is intended to demonstrate how to provision the
# resources necessary to boot a vm with network connectivity provided
# by quantum.
# by neutron.
#
# Note that a quantum_router resouce must declare a dependency on the
# Note that a neutron_router resource must declare a dependency on the
# first subnet of the gateway network. Other dependencies for the
# resources used in this example can be automatically determined.
#
@ -12,13 +12,13 @@ keystone_tenant { 'admin':
ensure => present,
}
quantum_network { 'public':
neutron_network { 'public':
ensure => present,
router_external => 'True',
tenant_name => 'admin',
}
quantum_subnet { 'public_subnet':
neutron_subnet { 'public_subnet':
ensure => 'present',
cidr => '172.24.4.224/28',
network_name => 'public',
@ -29,12 +29,12 @@ keystone_tenant { 'demo':
ensure => present,
}
quantum_network { 'private':
neutron_network { 'private':
ensure => present,
tenant_name => 'demo',
}
quantum_subnet { 'private_subnet':
neutron_subnet { 'private_subnet':
ensure => present,
cidr => '10.0.0.0/24',
network_name => 'private',
@ -42,13 +42,13 @@ quantum_subnet { 'private_subnet':
}
# Tenant-private router - assumes network namespace isolation
quantum_router { 'demo_router':
neutron_router { 'demo_router':
ensure => present,
tenant_name => 'demo',
gateway_network_name => 'public',
require => Quantum_subnet['public_subnet'],
require => Neutron_subnet['public_subnet'],
}
quantum_router_interface { 'demo_router:private_subnet':
neutron_router_interface { 'demo_router:private_subnet':
ensure => present,
}

View File

@ -1,8 +1,8 @@
#!/bin/bash
# This example script shows how to create a simple subnet for Quantum.
# This example script shows how to create a simple subnet for Neutron.
source /root/openrc
quantum net-create mynet
quantum subnet-create --name mynet-subnet mynet 10.0.0.0/24
quantum router-create myrouter
quantum router-interface-add myrouter mynet-subnet
neutron net-create mynet
neutron subnet-create --name mynet-subnet mynet 10.0.0.0/24
neutron router-create myrouter
neutron router-interface-add myrouter mynet-subnet

View File

@ -1,8 +1,8 @@
### Cloud Controller:
# General Quantum stuff
# Configures everything in quantum.conf
class { 'quantum':
# General Neutron stuff
# Configures everything in neutron.conf
class { 'neutron':
verbose => true,
allow_overlapping_ips => true,
rabbit_password => 'password',
@ -11,33 +11,33 @@ class { 'quantum':
}
# The API server talks to keystone for authorisation
class { 'quantum::server':
class { 'neutron::server':
keystone_password => 'password',
}
# Various agents
class { 'quantum::agents::dhcp': }
class { 'quantum::agents::l3': }
class { 'quantum::agents::lbaas': }
class { 'neutron::agents::dhcp': }
class { 'neutron::agents::l3': }
class { 'neutron::agents::lbaas': }
# This plugin configures Quantum for OVS on the server
# This plugin configures Neutron for OVS on the server
# Agent
class { 'quantum::agents::ovs':
class { 'neutron::agents::ovs':
local_ip => '192.168.1.1',
enable_tunneling => true,
}
# Plugin
class { 'quantum::plugins::ovs':
sql_connection => 'mysql://quantum:password@localhost/quantum',
class { 'neutron::plugins::ovs':
sql_connection => 'mysql://neutron:password@localhost/neutron',
tenant_network_type => 'gre',
}
### Compute Nodes:
# Generally, any machine with a quantum element running on it talks
# Generally, any machine with a neutron element running on it talks
# over Rabbit and needs to know if overlapping IPs (namespaces) are in use
class { 'quantum':
class { 'neutron':
allow_overlapping_ips => true,
rabbit_password => 'password',
rabbit_user => 'guest',
@ -46,13 +46,13 @@ class { 'quantum':
# The agent/plugin combo also needs installed on clients
# Agent
class { 'quantum::agents::ovs':
class { 'neutron::agents::ovs':
local_ip => '192.168.1.11',
enable_tunneling => true,
}
# Plugin
class { 'quantum::plugins::ovs':
sql_connection => 'mysql://quantum:password@192.168.1.1/quantum',
class { 'neutron::plugins::ovs':
sql_connection => 'mysql://neutron:password@192.168.1.1/neutron',
tenant_network_type => 'gre',
}

View File

@ -1,10 +1,10 @@
require 'csv'
require 'puppet/util/inifile'
class Puppet::Provider::Quantum < Puppet::Provider
class Puppet::Provider::Neutron < Puppet::Provider
def self.conf_filename
'/etc/quantum/quantum.conf'
'/etc/neutron/neutron.conf'
end
def self.withenv(hash, &block)
@ -21,27 +21,27 @@ class Puppet::Provider::Quantum < Puppet::Provider
end
end
def self.quantum_credentials
@quantum_credentials ||= get_quantum_credentials
def self.neutron_credentials
@neutron_credentials ||= get_neutron_credentials
end
def self.get_quantum_credentials
def self.get_neutron_credentials
auth_keys = ['auth_host', 'auth_port', 'auth_protocol',
'admin_tenant_name', 'admin_user', 'admin_password']
conf = quantum_conf
conf = neutron_conf
if conf and conf['keystone_authtoken'] and
auth_keys.all?{|k| !conf['keystone_authtoken'][k].nil?}
return Hash[ auth_keys.map \
{ |k| [k, conf['keystone_authtoken'][k].strip] } ]
else
raise(Puppet::Error, "File: #{conf_filename} does not contain all \
required sections. Quantum types will not work if quantum is not \
required sections. Neutron types will not work if neutron is not \
correctly configured.")
end
end
def quantum_credentials
self.class.quantum_credentials
def neutron_credentials
self.class.neutron_credentials
end
def self.auth_endpoint
@ -49,19 +49,19 @@ correctly configured.")
end
def self.get_auth_endpoint
q = quantum_credentials
q = neutron_credentials
"#{q['auth_protocol']}://#{q['auth_host']}:#{q['auth_port']}/v2.0/"
end
def self.quantum_conf
return @quantum_conf if @quantum_conf
@quantum_conf = Puppet::Util::IniConfig::File.new
@quantum_conf.read(conf_filename)
@quantum_conf
def self.neutron_conf
return @neutron_conf if @neutron_conf
@neutron_conf = Puppet::Util::IniConfig::File.new
@neutron_conf.read(conf_filename)
@neutron_conf
end
def self.auth_quantum(*args)
q = quantum_credentials
def self.auth_neutron(*args)
q = neutron_credentials
authenv = {
:OS_AUTH_URL => self.auth_endpoint,
:OS_USERNAME => q['admin_user'],
@ -70,14 +70,14 @@ correctly configured.")
}
begin
withenv authenv do
quantum(args)
neutron(args)
end
rescue Exception => e
if (e.message =~ /\[Errno 111\] Connection refused/) or
(e.message =~ /\(HTTP 400\)/)
sleep 10
withenv authenv do
quantum(args)
neutron(args)
end
else
raise(e)
@ -85,18 +85,18 @@ correctly configured.")
end
end
def auth_quantum(*args)
self.class.auth_quantum(args)
def auth_neutron(*args)
self.class.auth_neutron(args)
end
def self.reset
@quantum_conf = nil
@quantum_credentials = nil
@neutron_conf = nil
@neutron_credentials = nil
end
def self.list_quantum_resources(type)
def self.list_neutron_resources(type)
ids = []
list = auth_quantum("#{type}-list", '--format=csv',
list = auth_neutron("#{type}-list", '--format=csv',
'--column=id', '--quote=none')
(list.split("\n")[1..-1] || []).compact.collect do |line|
ids << line.strip
@ -104,9 +104,9 @@ correctly configured.")
return ids
end
def self.get_quantum_resource_attrs(type, id)
def self.get_neutron_resource_attrs(type, id)
attrs = {}
net = auth_quantum("#{type}-show", '--format=shell', id)
net = auth_neutron("#{type}-show", '--format=shell', id)
last_key = nil
(net.split("\n") || []).compact.collect do |line|
if line.include? '='
@ -124,7 +124,7 @@ correctly configured.")
def self.list_router_ports(router_name_or_id)
results = []
cmd_output = auth_quantum("router-port-list",
cmd_output = auth_neutron("router-port-list",
'--format=csv',
router_name_or_id)
if ! cmd_output

View File

@ -1,4 +1,4 @@
Puppet::Type.type(:quantum_api_config).provide(
Puppet::Type.type(:neutron_api_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
@ -16,7 +16,7 @@ Puppet::Type.type(:quantum_api_config).provide(
end
def file_path
'/etc/quantum/api-paste.ini'
'/etc/neutron/api-paste.ini'
end
end

View File

@ -1,4 +1,4 @@
Puppet::Type.type(:quantum_config).provide(
Puppet::Type.type(:neutron_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
@ -16,7 +16,7 @@ Puppet::Type.type(:quantum_config).provide(
end
def file_path
'/etc/quantum/quantum.conf'
'/etc/neutron/neutron.conf'
end
end

View File

@ -1,4 +1,4 @@
Puppet::Type.type(:quantum_dhcp_agent_config).provide(
Puppet::Type.type(:neutron_dhcp_agent_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
@ -16,7 +16,7 @@ Puppet::Type.type(:quantum_dhcp_agent_config).provide(
end
def file_path
'/etc/quantum/dhcp_agent.ini'
'/etc/neutron/dhcp_agent.ini'
end
end

View File

@ -1,4 +1,4 @@
Puppet::Type.type(:quantum_l3_agent_config).provide(
Puppet::Type.type(:neutron_l3_agent_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
@ -16,7 +16,7 @@ Puppet::Type.type(:quantum_l3_agent_config).provide(
end
def file_path
'/etc/quantum/l3_agent.ini'
'/etc/neutron/l3_agent.ini'
end
end

View File

@ -1,6 +1,6 @@
Puppet::Type.type(:quantum_l3_ovs_bridge).provide(:quantum) do
Puppet::Type.type(:neutron_l3_ovs_bridge).provide(:neutron) do
desc <<-EOT
Quantum provider to manage quantum_l3_ovs_bridge type.
Neutron provider to manage neutron_l3_ovs_bridge type.
The provider ensures that the gateway ip of the subnet is
configured on the ovs bridge.
@ -12,7 +12,7 @@ Puppet::Type.type(:quantum_l3_ovs_bridge).provide(:quantum) do
def gateway_ip
if @gateway_ip == nil
subnet = Puppet::Type.type('quantum_subnet').instances.find do |instance|
subnet = Puppet::Type.type('neutron_subnet').instances.find do |instance|
instance.provider.name == @resource[:subnet_name]
end
if subnet

View File

@ -0,0 +1,22 @@
Puppet::Type.type(:neutron_lbaas_agent_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/lbaas_agent.ini'
end
end

View File

@ -0,0 +1,22 @@
Puppet::Type.type(:neutron_metadata_agent_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/metadata_agent.ini'
end
end

View File

@ -1,27 +1,27 @@
require File.join(File.dirname(__FILE__), '..','..','..',
'puppet/provider/quantum')
'puppet/provider/neutron')
Puppet::Type.type(:quantum_network).provide(
:quantum,
:parent => Puppet::Provider::Quantum
Puppet::Type.type(:neutron_network).provide(
:neutron,
:parent => Puppet::Provider::Neutron
) do
desc <<-EOT
Quantum provider to manage quantum_network type.
Neutron provider to manage neutron_network type.
Assumes that the quantum service is configured on the same host.
Assumes that the neutron service is configured on the same host.
EOT
commands :quantum => 'quantum'
commands :neutron => 'neutron'
mk_resource_methods
def self.quantum_type
def self.neutron_type
'net'
end
def self.instances
list_quantum_resources(quantum_type).collect do |id|
attrs = get_quantum_resource_attrs(quantum_type, id)
list_neutron_resources(neutron_type).collect do |id|
attrs = get_neutron_resource_attrs(neutron_type, id)
new(
:ensure => :present,
:name => attrs['name'],
@ -84,7 +84,7 @@ Puppet::Type.type(:quantum_network).provide(
network_opts << "--router:external=#{@resource[:router_external]}"
end
results = auth_quantum('net-create', '--format=shell',
results = auth_neutron('net-create', '--format=shell',
network_opts, resource[:name])
if results =~ /Created a new network:/
@ -107,20 +107,20 @@ Puppet::Type.type(:quantum_network).provide(
end
def destroy
auth_quantum('net-delete', name)
auth_neutron('net-delete', name)
@property_hash[:ensure] = :absent
end
def admin_state_up=(value)
auth_quantum('net-update', "--admin_state_up=#{value}", name)
auth_neutron('net-update', "--admin_state_up=#{value}", name)
end
def shared=(value)
auth_quantum('net-update', "--shared=#{value}", name)
auth_neutron('net-update', "--shared=#{value}", name)
end
def router_external=(value)
auth_quantum('net-update', "--router:external=#{value}", name)
auth_neutron('net-update', "--router:external=#{value}", name)
end
[

View File

@ -0,0 +1,22 @@
Puppet::Type.type(:neutron_plugin_cisco).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/plugins/cisco/cisco_plugins.ini'
end
end

View File

@ -0,0 +1,22 @@
Puppet::Type.type(:neutron_plugin_cisco_credentials).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/plugins/cisco/credentials.ini'
end
end

View File

@ -0,0 +1,22 @@
Puppet::Type.type(:neutron_plugin_cisco_db_conn).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/plugins/cisco/db_conn.ini'
end
end

View File

@ -0,0 +1,22 @@
Puppet::Type.type(:neutron_plugin_cisco_l2network).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/plugins/cisco/l2network_plugin.ini'
end
end

View File

@ -0,0 +1,22 @@
Puppet::Type.type(:neutron_plugin_linuxbridge).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini'
end
end

View File

@ -0,0 +1,22 @@
Puppet::Type.type(:neutron_plugin_ovs).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini'
end
end

View File

@ -1,23 +1,23 @@
require File.join(File.dirname(__FILE__), '..','..','..',
'puppet/provider/quantum')
'puppet/provider/neutron')
Puppet::Type.type(:quantum_router).provide(
:quantum,
:parent => Puppet::Provider::Quantum
Puppet::Type.type(:neutron_router).provide(
:neutron,
:parent => Puppet::Provider::Neutron
) do
desc <<-EOT
Quantum provider to manage quantum_router type.
Neutron provider to manage neutron_router type.
Assumes that the quantum service is configured on the same host.
Assumes that the neutron service is configured on the same host.
EOT
commands :quantum => 'quantum'
commands :neutron => 'neutron'
mk_resource_methods
def self.instances
list_quantum_resources('router').collect do |id|
attrs = get_quantum_resource_attrs('router', id)
list_neutron_resources('router').collect do |id|
attrs = get_neutron_resource_attrs('router', id)
new(
:ensure => :present,
:name => attrs['name'],
@ -58,7 +58,7 @@ Puppet::Type.type(:quantum_router).provide(
opts << "--tenant_id=#{@resource[:tenant_id]}"
end
results = auth_quantum("router-create", '--format=shell',
results = auth_neutron("router-create", '--format=shell',
opts, resource[:name])
if results =~ /Created a new router:/
@ -74,11 +74,11 @@ Puppet::Type.type(:quantum_router).provide(
}
if @resource[:gateway_network_name]
results = auth_quantum('router-gateway-set',
results = auth_neutron('router-gateway-set',
@resource[:name],
@resource[:gateway_network_name])
if results =~ /Set gateway for router/
attrs = self.class.get_quantum_resource_attrs('router',
attrs = self.class.get_neutron_resource_attrs('router',
@resource[:name])
@property_hash[:external_gateway_info] = \
attrs['external_gateway_info']
@ -95,13 +95,13 @@ EOT
end
def destroy
auth_quantum('router-delete', name)
auth_neutron('router-delete', name)
@property_hash[:ensure] = :absent
end
def gateway_network_name
if @gateway_network_name == nil and gateway_network_id
Puppet::Type.type('quantum_network').instances.each do |instance|
Puppet::Type.type('neutron_network').instances.each do |instance|
if instance.provider.id == gateway_network_id
@gateway_network_name = instance.provider.name
end
@ -112,9 +112,9 @@ EOT
def gateway_network_name=(value)
if value == ''
auth_quantum('router-gateway-clear', name)
auth_neutron('router-gateway-clear', name)
else
auth_quantum('router-gateway-set', name, value)
auth_neutron('router-gateway-set', name, value)
end
end
@ -132,7 +132,7 @@ EOT
end
def admin_state_up=(value)
auth_quantum('router-update', "--admin-state-up=#{value}", name)
auth_neutron('router-update', "--admin-state-up=#{value}", name)
end
end

View File

@ -1,14 +1,14 @@
require File.join(File.dirname(__FILE__), '..','..','..',
'puppet/provider/quantum')
'puppet/provider/neutron')
Puppet::Type.type(:quantum_router_interface).provide(
:quantum,
:parent => Puppet::Provider::Quantum
Puppet::Type.type(:neutron_router_interface).provide(
:neutron,
:parent => Puppet::Provider::Neutron
) do
desc <<-EOT
Quantum provider to manage quantum_router_interface type.
Neutron provider to manage neutron_router_interface type.
Assumes that the quantum service is configured on the same host.
Assumes that the neutron service is configured on the same host.
It is not possible to manage an interface for the subnet used by
the gateway network, and such an interface will appear in the list
@ -17,17 +17,17 @@ Puppet::Type.type(:quantum_router_interface).provide(
EOT
commands :quantum => 'quantum'
commands :neutron => 'neutron'
mk_resource_methods
def self.instances
subnet_name_hash = {}
Puppet::Type.type('quantum_subnet').instances.each do |instance|
Puppet::Type.type('neutron_subnet').instances.each do |instance|
subnet_name_hash[instance.provider.id] = instance.provider.name
end
instances_ = []
Puppet::Type.type('quantum_router').instances.each do |instance|
Puppet::Type.type('neutron_router').instances.each do |instance|
list_router_ports(instance.provider.id).each do |port_hash|
router_name = instance.provider.name
subnet_name = subnet_name_hash[port_hash['subnet_id']]
@ -56,7 +56,7 @@ Puppet::Type.type(:quantum_router_interface).provide(
end
def create
results = auth_quantum("router-interface-add", '--format=shell',
results = auth_neutron("router-interface-add", '--format=shell',
resource[:name].split(':', 2))
if results =~ /Added interface to router/
@ -83,7 +83,7 @@ Puppet::Type.type(:quantum_router_interface).provide(
end
def destroy
auth_quantum('router-interface-delete', router_name, subnet_name)
auth_neutron('router-interface-delete', router_name, subnet_name)
@property_hash[:ensure] = :absent
end

View File

@ -1,27 +1,27 @@
require File.join(File.dirname(__FILE__), '..','..','..',
'puppet/provider/quantum')
'puppet/provider/neutron')
Puppet::Type.type(:quantum_subnet).provide(
:quantum,
:parent => Puppet::Provider::Quantum
Puppet::Type.type(:neutron_subnet).provide(
:neutron,
:parent => Puppet::Provider::Neutron
) do
desc <<-EOT
Quantum provider to manage quantum_subnet type.
Neutron provider to manage neutron_subnet type.
Assumes that the quantum service is configured on the same host.
Assumes that the neutron service is configured on the same host.
EOT
commands :quantum => 'quantum'
commands :neutron => 'neutron'
mk_resource_methods
def self.quantum_type
def self.neutron_type
'subnet'
end
def self.instances
list_quantum_resources(quantum_type).collect do |id|
attrs = get_quantum_resource_attrs(quantum_type, id)
list_neutron_resources(neutron_type).collect do |id|
attrs = get_neutron_resource_attrs(neutron_type, id)
new(
:ensure => :present,
:name => attrs['name'],
@ -81,7 +81,7 @@ Puppet::Type.type(:quantum_subnet).provide(
opts << resource[:network_id]
end
results = auth_quantum('subnet-create', '--format=shell',
results = auth_neutron('subnet-create', '--format=shell',
opts, resource[:cidr])
if results =~ /Created a new subnet:/
@ -106,16 +106,16 @@ Puppet::Type.type(:quantum_subnet).provide(
end
def destroy
auth_quantum('subnet-delete', name)
auth_neutron('subnet-delete', name)
@property_hash[:ensure] = :absent
end
def gateway_ip=(value)
auth_quantum('subnet-update', "--gateway-ip=#{value}", name)
auth_neutron('subnet-update', "--gateway-ip=#{value}", name)
end
def enable_dhcp=(value)
auth_quantum('subnet-update', "--enable-dhcp=#{value}", name)
auth_neutron('subnet-update', "--enable-dhcp=#{value}", name)
end
[

View File

@ -1,22 +0,0 @@
Puppet::Type.type(:quantum_lbaas_agent_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/quantum/lbaas_agent.ini'
end
end

View File

@ -1,22 +0,0 @@
Puppet::Type.type(:quantum_metadata_agent_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/quantum/metadata_agent.ini'
end
end

View File

@ -1,22 +0,0 @@
Puppet::Type.type(:quantum_plugin_cisco).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/quantum/plugins/cisco/cisco_plugins.ini'
end
end

View File

@ -1,22 +0,0 @@
Puppet::Type.type(:quantum_plugin_cisco_credentials).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/quantum/plugins/cisco/credentials.ini'
end
end

View File

@ -1,22 +0,0 @@
Puppet::Type.type(:quantum_plugin_cisco_db_conn).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/quantum/plugins/cisco/db_conn.ini'
end
end

View File

@ -1,22 +0,0 @@
Puppet::Type.type(:quantum_plugin_cisco_l2network).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/quantum/plugins/cisco/l2network_plugin.ini'
end
end

View File

@ -1,22 +0,0 @@
Puppet::Type.type(:quantum_plugin_linuxbridge).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini'
end
end

View File

@ -1,22 +0,0 @@
Puppet::Type.type(:quantum_plugin_ovs).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini'
end
end

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_api_config) do
Puppet::Type.newtype(:neutron_api_config) do
ensurable

View File

@ -1,9 +1,9 @@
Puppet::Type.newtype(:quantum_config) do
Puppet::Type.newtype(:neutron_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from quantum.conf'
desc 'Section/setting name to manage from neutron.conf'
newvalues(/\S+\/\S+/)
end

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_dhcp_agent_config) do
Puppet::Type.newtype(:neutron_dhcp_agent_config) do
ensurable

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_l3_agent_config) do
Puppet::Type.newtype(:neutron_l3_agent_config) do
ensurable

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_l3_ovs_bridge) do
Puppet::Type.newtype(:neutron_l3_ovs_bridge) do
ensurable
@ -12,14 +12,14 @@ Puppet::Type.newtype(:quantum_l3_ovs_bridge) do
end
autorequire(:service) do
['quantum-server']
['neutron-server']
end
autorequire(:vs_bridge) do
[self[:name]]
end
autorequire(:quantum_subnet) do
autorequire(:neutron_subnet) do
[self[:subnet_name]] if self[:subnet_name]
end

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_lbaas_agent_config) do
Puppet::Type.newtype(:neutron_lbaas_agent_config) do
ensurable

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_metadata_agent_config) do
Puppet::Type.newtype(:neutron_metadata_agent_config) do
ensurable

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_network) do
Puppet::Type.newtype(:neutron_network) do
ensurable
@ -66,9 +66,9 @@ Puppet::Type.newtype(:quantum_network) do
end
end
# Require the quantum-server service to be running
# Require the neutron-server service to be running
autorequire(:service) do
['quantum-server']
['neutron-server']
end
autorequire(:keystone_tenant) do

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_plugin_cisco) do
Puppet::Type.newtype(:neutron_plugin_cisco) do
ensurable
@ -8,7 +8,7 @@ Puppet::Type.newtype(:quantum_plugin_cisco) do
end
autorequire(:file) do
['/etc/quantum/plugins/cisco']
['/etc/neutron/plugins/cisco']
end
newproperty(:value) do

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_plugin_cisco_credentials) do
Puppet::Type.newtype(:neutron_plugin_cisco_credentials) do
ensurable
@ -8,7 +8,7 @@ Puppet::Type.newtype(:quantum_plugin_cisco_credentials) do
end
autorequire(:file) do
['/etc/quantum/plugins/cisco']
['/etc/neutron/plugins/cisco']
end
newproperty(:value) do

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_plugin_cisco_db_conn) do
Puppet::Type.newtype(:neutron_plugin_cisco_db_conn) do
ensurable
@ -8,7 +8,7 @@ Puppet::Type.newtype(:quantum_plugin_cisco_db_conn) do
end
autorequire(:file) do
['/etc/quantum/plugins/cisco']
['/etc/neutron/plugins/cisco']
end
newproperty(:value) do

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_plugin_cisco_l2network) do
Puppet::Type.newtype(:neutron_plugin_cisco_l2network) do
ensurable
@ -8,7 +8,7 @@ Puppet::Type.newtype(:quantum_plugin_cisco_l2network) do
end
autorequire(:file) do
['/etc/quantum/plugins/cisco']
['/etc/neutron/plugins/cisco']
end
newproperty(:value) do

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_plugin_linuxbridge) do
Puppet::Type.newtype(:neutron_plugin_linuxbridge) do
ensurable

View File

@ -1,9 +1,9 @@
Puppet::Type.newtype(:quantum_plugin_ovs) do
Puppet::Type.newtype(:neutron_plugin_ovs) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from ovs_quantum_plugin.ini'
desc 'Section/setting name to manage from ovs_neutron_plugin.ini'
newvalues(/\S+\/\S+/)
end

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_router) do
Puppet::Type.newtype(:neutron_router) do
ensurable
@ -65,14 +65,14 @@ Puppet::Type.newtype(:quantum_router) do
end
autorequire(:service) do
['quantum-server']
['neutron-server']
end
autorequire(:keystone_tenant) do
[self[:tenant_name]] if self[:tenant_name]
end
autorequire(:quantum_network) do
autorequire(:neutron_network) do
[self[:gateway_network_name]] if self[:gateway_network_name]
end

View File

@ -1,8 +1,8 @@
Puppet::Type.newtype(:quantum_router_interface) do
Puppet::Type.newtype(:neutron_router_interface) do
desc <<-EOT
This is currently used to model the creation of
quantum router interfaces.
neutron router interfaces.
Router interfaces are an association between a router and a
subnet.
@ -33,14 +33,14 @@ Puppet::Type.newtype(:quantum_router_interface) do
end
autorequire(:service) do
['quantum-server']
['neutron-server']
end
autorequire(:quantum_router) do
autorequire(:neutron_router) do
self[:name].split(':', 2).first
end
autorequire(:quantum_subnet) do
autorequire(:neutron_subnet) do
self[:name].split(':', 2).last
end

View File

@ -1,4 +1,4 @@
Puppet::Type.newtype(:quantum_subnet) do
Puppet::Type.newtype(:neutron_subnet) do
ensurable
@ -76,14 +76,14 @@ Puppet::Type.newtype(:quantum_subnet) do
end
autorequire(:service) do
['quantum-server']
['neutron-server']
end
autorequire(:keystone_tenant) do
[self[:tenant_name]] if self[:tenant_name]
end
autorequire(:quantum_network) do
autorequire(:neutron_network) do
[self[:network_name]] if self[:network_name]
end

View File

@ -1,6 +1,6 @@
# == Class: quantum::agents::dhcp
# == Class: neutron::agents::dhcp
#
# Setups Quantum DHCP agent.
# Setups Neutron DHCP agent.
#
# === Parameters
#
@ -15,21 +15,21 @@
#
# [*state_path*]
# (optional) Where to store dnsmasq state files. This directory must be
# writable by the user executing the agent. Defaults to '/var/lib/quantum'.
# writable by the user executing the agent. Defaults to '/var/lib/neutron'.
#
# [*resync_interval*]
# (optional) The DHCP agent will resync its state with Quantum to recover
# (optional) The DHCP agent will resync its state with Neutron to recover
# from any transient notification or rpc errors. The interval is number of
# seconds between attempts. Defaults to 30.
#
# [*interface_driver*]
# (optional) Defaults to 'quantum.agent.linux.interface.OVSInterfaceDriver'.
# (optional) Defaults to 'neutron.agent.linux.interface.OVSInterfaceDriver'.
#
# [*dhcp_driver*]
# (optional) Defaults to 'quantum.agent.linux.dhcp.Dnsmasq'.
# (optional) Defaults to 'neutron.agent.linux.dhcp.Dnsmasq'.
#
# [*root_helper*]
# (optional) Defaults to 'sudo quantum-rootwrap /etc/quantum/rootwrap.conf'.
# (optional) Defaults to 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf'.
# Addresses bug: https://bugs.launchpad.net/neutron/+bug/1182616
# Note: This can safely be removed once the module only targets the Havana release.
#
@ -38,28 +38,28 @@
# CONFIG_NET_NS=y and iproute2 package that supports namespaces).
# Defaults to true.
#
class quantum::agents::dhcp (
class neutron::agents::dhcp (
$package_ensure = present,
$enabled = true,
$debug = false,
$state_path = '/var/lib/quantum',
$state_path = '/var/lib/neutron',
$resync_interval = 30,
$interface_driver = 'quantum.agent.linux.interface.OVSInterfaceDriver',
$dhcp_driver = 'quantum.agent.linux.dhcp.Dnsmasq',
$root_helper = 'sudo quantum-rootwrap /etc/quantum/rootwrap.conf',
$interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
$dhcp_driver = 'neutron.agent.linux.dhcp.Dnsmasq',
$root_helper = 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf',
$use_namespaces = true
) {
include quantum::params
include neutron::params
Quantum_config<||> ~> Service['quantum-dhcp-service']
Quantum_dhcp_agent_config<||> ~> Service['quantum-dhcp-service']
Neutron_config<||> ~> Service['neutron-dhcp-service']
Neutron_dhcp_agent_config<||> ~> Service['neutron-dhcp-service']
case $dhcp_driver {
/\.Dnsmasq/: {
Package['dnsmasq'] -> Package<| title == 'quantum-dhcp-agent' |>
Package['dnsmasq'] -> Package<| title == 'neutron-dhcp-agent' |>
package { 'dnsmasq':
name => $::quantum::params::dnsmasq_packages,
name => $::neutron::params::dnsmasq_packages,
ensure => present,
}
}
@ -68,10 +68,10 @@ class quantum::agents::dhcp (
}
}
# The DHCP agent loads both quantum.ini and its own file.
# This only lists config specific to the agent. quantum.ini supplies
# The DHCP agent loads both neutron.ini and its own file.
# This only lists config specific to the agent. neutron.ini supplies
# the rest.
quantum_dhcp_agent_config {
neutron_dhcp_agent_config {
'DEFAULT/debug': value => $debug;
'DEFAULT/state_path': value => $state_path;
'DEFAULT/resync_interval': value => $resync_interval;
@ -81,18 +81,18 @@ class quantum::agents::dhcp (
'DEFAULT/root_helper': value => $root_helper;
}
if $::quantum::params::dhcp_agent_package {
Package['quantum'] -> Package['quantum-dhcp-agent']
Package['quantum-dhcp-agent'] -> Quantum_config<||>
Package['quantum-dhcp-agent'] -> Quantum_dhcp_agent_config<||>
package { 'quantum-dhcp-agent':
name => $::quantum::params::dhcp_agent_package,
if $::neutron::params::dhcp_agent_package {
Package['neutron'] -> Package['neutron-dhcp-agent']
Package['neutron-dhcp-agent'] -> Neutron_config<||>
Package['neutron-dhcp-agent'] -> Neutron_dhcp_agent_config<||>
package { 'neutron-dhcp-agent':
name => $::neutron::params::dhcp_agent_package,
ensure => $package_ensure,
}
} else {
# Some platforms (RedHat) do not provide a quantum DHCP agent package.
# The quantum DHCP agent config file is provided by the quantum package.
Package['quantum'] -> Quantum_dhcp_agent_config<||>
# Some platforms (RedHat) do not provide a neutron DHCP agent package.
# The neutron DHCP agent config file is provided by the neutron package.
Package['neutron'] -> Neutron_dhcp_agent_config<||>
}
if $enabled {
@ -101,10 +101,10 @@ class quantum::agents::dhcp (
$ensure = 'stopped'
}
service { 'quantum-dhcp-service':
name => $::quantum::params::dhcp_agent_service,
service { 'neutron-dhcp-service':
name => $::neutron::params::dhcp_agent_service,
enable => $enabled,
ensure => $ensure,
require => Class['quantum'],
require => Class['neutron'],
}
}

View File

@ -1,6 +1,6 @@
# == Class: quantum::agents::l3
# == Class: neutron::agents::l3
#
# Installs and configures the Quantum L3 service
# Installs and configures the Neutron L3 service
#
# TODO: create ability to have multiple L3 services
#
@ -27,15 +27,15 @@
# Defaults to false
#
# [*interface_driver*]
# (optional) Driver to interface with quantum
# (optional) Driver to interface with neutron
# Defaults to OVSInterfaceDriver
#
# [*router_id*]
# (optional) The ID of the external router in quantum
# (optional) The ID of the external router in neutron
# Defaults to blank
#
# [*gateway_external_network_id*]
# (optional) The ID of the external network in quantum
# (optional) The ID of the external network in neutron
# Defaults to blank
#
# [*handle_internal_only_routers*]
@ -63,13 +63,13 @@
# (optional) can be set to False if the Nova metadata server is not available
# Defaults to True
#
class quantum::agents::l3 (
class neutron::agents::l3 (
$package_ensure = 'present',
$enabled = true,
$debug = false,
$external_network_bridge = 'br-ex',
$use_namespaces = true,
$interface_driver = 'quantum.agent.linux.interface.OVSInterfaceDriver',
$interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
$router_id = undef,
$gateway_external_network_id = undef,
$handle_internal_only_routers = true,
@ -80,12 +80,12 @@ class quantum::agents::l3 (
$enable_metadata_proxy = true
) {
include quantum::params
include neutron::params
Quantum_config<||> ~> Service['quantum-l3']
Quantum_l3_agent_config<||> ~> Service['quantum-l3']
Neutron_config<||> ~> Service['neutron-l3']
Neutron_l3_agent_config<||> ~> Service['neutron-l3']
quantum_l3_agent_config {
neutron_l3_agent_config {
'DEFAULT/debug': value => $debug;
'DEFAULT/external_network_bridge': value => $external_network_bridge;
'DEFAULT/use_namespaces': value => $use_namespaces;
@ -100,17 +100,17 @@ class quantum::agents::l3 (
'DEFAULT/enable_metadata_proxy': value => $enable_metadata_proxy;
}
if $::quantum::params::l3_agent_package {
Package['quantum-l3'] -> Quantum_l3_agent_config<||>
package { 'quantum-l3':
name => $::quantum::params::l3_agent_package,
if $::neutron::params::l3_agent_package {
Package['neutron-l3'] -> Neutron_l3_agent_config<||>
package { 'neutron-l3':
name => $::neutron::params::l3_agent_package,
ensure => $package_ensure,
require => Package['quantum'],
require => Package['neutron'],
}
} else {
# Some platforms (RedHat) does not provide a quantum L3 agent package.
# The quantum L3 agent config file is provided by the quantum package.
Package['quantum'] -> Quantum_l3_agent_config<||>
# Some platforms (RedHat) does not provide a neutron L3 agent package.
# The neutron L3 agent config file is provided by the neutron package.
Package['neutron'] -> Neutron_l3_agent_config<||>
}
if $enabled {
@ -119,10 +119,10 @@ class quantum::agents::l3 (
$ensure = 'stopped'
}
service { 'quantum-l3':
name => $::quantum::params::l3_agent_service,
service { 'neutron-l3':
name => $::neutron::params::l3_agent_service,
enable => $enabled,
ensure => $ensure,
require => Class['quantum'],
require => Class['neutron'],
}
}

View File

@ -1,6 +1,6 @@
# == Class: quantum::agents:lbaas:
# == Class: neutron::agents:lbaas:
#
# Setups Quantum Load Balancing agent.
# Setups Neutron Load Balancing agent.
#
# === Parameters
#
@ -14,10 +14,10 @@
# (optional) Show debugging output in log. Defaults to false.
#
# [*interface_driver*]
# (optional) Defaults to 'quantum.agent.linux.interface.OVSInterfaceDriver'.
# (optional) Defaults to 'neutron.agent.linux.interface.OVSInterfaceDriver'.
#
# [*device_driver*]
# (optional) Defaults to 'quantum.plugins.services.agent_loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver'.
# (optional) Defaults to 'neutron.plugins.services.agent_loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver'.
#
# [*use_namespaces*]
# (optional) Allow overlapping IP (Must have kernel build with
@ -27,26 +27,26 @@
# [*user_group*]
# (optional) The user group. Defaults to nogroup.
#
class quantum::agents::lbaas (
class neutron::agents::lbaas (
$package_ensure = present,
$enabled = true,
$debug = false,
$interface_driver = 'quantum.agent.linux.interface.OVSInterfaceDriver',
$device_driver = 'quantum.plugins.services.agent_loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver',
$interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
$device_driver = 'neutron.plugins.services.agent_loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver',
$use_namespaces = true,
$user_group = 'nogroup',
) {
include quantum::params
include neutron::params
Quantum_config<||> ~> Service['quantum-lbaas-service']
Quantum_lbaas_agent_config<||> ~> Service['quantum-lbaas-service']
Neutron_config<||> ~> Service['neutron-lbaas-service']
Neutron_lbaas_agent_config<||> ~> Service['neutron-lbaas-service']
case $device_driver {
/\.haproxy/: {
Package['haproxy'] -> Package<| title == 'quantum-lbaas-agent' |>
Package['haproxy'] -> Package<| title == 'neutron-lbaas-agent' |>
package { 'haproxy':
name => $::quantum::params::haproxy_package,
name => $::neutron::params::haproxy_package,
ensure => present,
}
}
@ -55,10 +55,10 @@ class quantum::agents::lbaas (
}
}
# The LBaaS agent loads both quantum.ini and its own file.
# This only lists config specific to the agent. quantum.ini supplies
# The LBaaS agent loads both neutron.ini and its own file.
# This only lists config specific to the agent. neutron.ini supplies
# the rest.
quantum_lbaas_agent_config {
neutron_lbaas_agent_config {
'DEFAULT/debug': value => $debug;
'DEFAULT/interface_driver': value => $interface_driver;
'DEFAULT/device_driver': value => $device_driver;
@ -66,18 +66,18 @@ class quantum::agents::lbaas (
'DEFAULT/user_group': value => $user_group;
}
if $::quantum::params::lbaas_agent_package {
Package['quantum'] -> Package['quantum-lbaas-agent']
Package['quantum-lbaas-agent'] -> Quantum_config<||>
Package['quantum-lbaas-agent'] -> Quantum_lbaas_agent_config<||>
package { 'quantum-lbaas-agent':
name => $::quantum::params::lbaas_agent_package,
if $::neutron::params::lbaas_agent_package {
Package['neutron'] -> Package['neutron-lbaas-agent']
Package['neutron-lbaas-agent'] -> Neutron_config<||>
Package['neutron-lbaas-agent'] -> Neutron_lbaas_agent_config<||>
package { 'neutron-lbaas-agent':
name => $::neutron::params::lbaas_agent_package,
ensure => $package_ensure,
}
} else {
# Some platforms (RedHat) do not provide a quantum LBaaS agent package.
# The quantum LBaaS agent config file is provided by the quantum package.
Package['quantum'] -> Quantum_lbaas_agent_config<||>
# Some platforms (RedHat) do not provide a neutron LBaaS agent package.
# The neutron LBaaS agent config file is provided by the neutron package.
Package['neutron'] -> Neutron_lbaas_agent_config<||>
}
if $enabled {
@ -86,10 +86,10 @@ class quantum::agents::lbaas (
$ensure = 'stopped'
}
service { 'quantum-lbaas-service':
name => $::quantum::params::lbaas_agent_service,
service { 'neutron-lbaas-service':
name => $::neutron::params::lbaas_agent_service,
enable => $enabled,
ensure => $ensure,
require => Class['quantum'],
require => Class['neutron'],
}
}

View File

@ -1,6 +1,6 @@
# == Class: quantum::agents::linuxbridge
# == Class: neutron::agents::linuxbridge
#
# Setups linuxbridge quantum agent.
# Setups linuxbridge neutron agent.
#
# === Parameters
#
@ -10,8 +10,8 @@
# network interfaces.
#
# [*firewall_driver*]
# (optional) Firewall driver for realizing quantum security group function.
# Defaults to 'quantum.agent.linux.iptables_firewall.IptablesFirewallDriver'.
# (optional) Firewall driver for realizing neutron security group function.
# Defaults to 'neutron.agent.linux.iptables_firewall.IptablesFirewallDriver'.
#
# [*package_ensure*]
# (optional) Ensure state for package. Defaults to 'present'.
@ -19,31 +19,31 @@
# [*enable*]
# (optional) Enable state for service. Defaults to 'true'.
#
class quantum::agents::linuxbridge (
class neutron::agents::linuxbridge (
$physical_interface_mappings,
$firewall_driver = 'quantum.agent.linux.iptables_firewall.IptablesFirewallDriver',
$firewall_driver = 'neutron.agent.linux.iptables_firewall.IptablesFirewallDriver',
$package_ensure = 'present',
$enable = true
) {
include quantum::params
include neutron::params
Quantum_config<||> ~> Service['quantum-plugin-linuxbridge-service']
Quantum_plugin_linuxbridge<||> ~> Service<| title == 'quantum-plugin-linuxbridge-service' |>
Neutron_config<||> ~> Service['neutron-plugin-linuxbridge-service']
Neutron_plugin_linuxbridge<||> ~> Service<| title == 'neutron-plugin-linuxbridge-service' |>
if $::quantum::params::linuxbridge_agent_package {
Package['quantum'] -> Package['quantum-plugin-linuxbridge-agent']
Package['quantum-plugin-linuxbridge-agent'] -> Quantum_plugin_linuxbridge<||>
Package['quantum-plugin-linuxbridge-agent'] -> Service['quantum-plugin-linuxbridge-service']
package { 'quantum-plugin-linuxbridge-agent':
if $::neutron::params::linuxbridge_agent_package {
Package['neutron'] -> Package['neutron-plugin-linuxbridge-agent']
Package['neutron-plugin-linuxbridge-agent'] -> Neutron_plugin_linuxbridge<||>
Package['neutron-plugin-linuxbridge-agent'] -> Service['neutron-plugin-linuxbridge-service']
package { 'neutron-plugin-linuxbridge-agent':
ensure => $package_ensure,
name => $::quantum::params::linuxbridge_agent_package,
name => $::neutron::params::linuxbridge_agent_package,
}
} else {
# Some platforms (RedHat) do not provide a separate quantum plugin
# Some platforms (RedHat) do not provide a separate neutron plugin
# linuxbridge agent package. The configuration file for the linuxbridge
# agent is provided by the quantum linuxbridge plugin package.
Package['quantum-plugin-linuxbridge'] -> Quantum_plugin_linuxbridge<||>
# agent is provided by the neutron linuxbridge plugin package.
Package['neutron-plugin-linuxbridge'] -> Neutron_plugin_linuxbridge<||>
}
if $enable {
@ -52,14 +52,14 @@ class quantum::agents::linuxbridge (
$service_ensure = 'stopped'
}
quantum_plugin_linuxbridge {
neutron_plugin_linuxbridge {
'LINUX_BRIDGE/physical_interface_mappings': value => $physical_interface_mappings;
'SECURITYGROUP/firewall_driver': value => $firewall_driver;
}
service { 'quantum-plugin-linuxbridge-service':
service { 'neutron-plugin-linuxbridge-service':
ensure => $service_ensure,
name => $::quantum::params::linuxbridge_agent_service,
name => $::neutron::params::linuxbridge_agent_service,
enable => $enable,
}
}

View File

@ -1,24 +1,24 @@
class quantum::agents::metadata (
class neutron::agents::metadata (
$auth_password,
$shared_secret,
$package_ensure = 'present',
$enabled = true,
$debug = false,
$auth_tenant = 'services',
$auth_user = 'quantum',
$auth_user = 'neutron',
$auth_url = 'http://localhost:35357/v2.0',
$auth_region = 'RegionOne',
$metadata_ip = '127.0.0.1',
$metadata_port = '8775'
) {
include quantum::params
include neutron::params
Package['quantum'] -> Quantum_metadata_agent_config<||>
Quantum_config<||> ~> Service['quantum-metadata']
Quantum_metadata_agent_config<||> ~> Service['quantum-metadata']
Package['neutron'] -> Neutron_metadata_agent_config<||>
Neutron_config<||> ~> Service['neutron-metadata']
Neutron_metadata_agent_config<||> ~> Service['neutron-metadata']
quantum_metadata_agent_config {
neutron_metadata_agent_config {
'DEFAULT/debug': value => $debug;
'DEFAULT/auth_url': value => $auth_url;
'DEFAULT/auth_region': value => $auth_region;
@ -30,13 +30,13 @@ class quantum::agents::metadata (
'DEFAULT/metadata_proxy_shared_secret': value => $shared_secret;
}
if $::quantum::params::metadata_agent_package {
Package['quantum-metadata'] -> Quantum_metadata_agent_config<||>
Package['quantum-metadata'] -> Service['quantum-metadata']
package { 'quantum-metadata':
name => $::quantum::params::metadata_agent_package,
if $::neutron::params::metadata_agent_package {
Package['neutron-metadata'] -> Neutron_metadata_agent_config<||>
Package['neutron-metadata'] -> Service['neutron-metadata']
package { 'neutron-metadata':
name => $::neutron::params::metadata_agent_package,
ensure => $package_ensure,
require => Package['quantum'],
require => Package['neutron'],
}
}
@ -46,10 +46,10 @@ class quantum::agents::metadata (
$ensure = 'stopped'
}
service { 'quantum-metadata':
name => $::quantum::params::metadata_agent_service,
service { 'neutron-metadata':
name => $::neutron::params::metadata_agent_service,
enable => $enabled,
ensure => $ensure,
require => Class['quantum'],
require => Class['neutron'],
}
}

View File

@ -1,14 +1,14 @@
# == Class: quantum::agents::ovs
# == Class: neutron::agents::ovs
#
# Setups OVS quantum agent.
# Setups OVS neutron agent.
#
# === Parameters
#
# [*firewall_driver*]
# (optional) Firewall driver for realizing quantum security group function.
# Defaults to 'quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'.
# (optional) Firewall driver for realizing neutron security group function.
# Defaults to 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'.
#
class quantum::agents::ovs (
class neutron::agents::ovs (
$package_ensure = 'present',
$enabled = true,
$bridge_uplinks = [],
@ -18,23 +18,23 @@ class quantum::agents::ovs (
$local_ip = false,
$tunnel_bridge = 'br-tun',
$polling_interval = 2,
$firewall_driver = 'quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
$firewall_driver = 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver'
) {
include quantum::params
include neutron::params
require vswitch::ovs
if $enable_tunneling and ! $local_ip {
fail('Local ip for ovs agent must be set when tunneling is enabled')
}
Quantum_config<||> ~> Service['quantum-plugin-ovs-service']
Quantum_plugin_ovs<||> ~> Service['quantum-plugin-ovs-service']
Neutron_config<||> ~> Service['neutron-plugin-ovs-service']
Neutron_plugin_ovs<||> ~> Service['neutron-plugin-ovs-service']
if ($bridge_mappings != []) {
# bridge_mappings are used to describe external networks that are
# *directly* attached to this machine.
# (This has nothing to do with VM-VM comms over quantum virtual networks.)
# (This has nothing to do with VM-VM comms over neutron virtual networks.)
# Typically, the network node - running L3 agent - will want one external
# network (often this is on the control node) and the other nodes (all the
# compute nodes) will want none at all. The only other reason you will
@ -45,49 +45,49 @@ class quantum::agents::ovs (
# mappings and uplinks; they're what the OVS switches will get named.)
# Set config for bridges that we're going to create
# The OVS quantum plugin will talk in terms of the networks in the bridge_mappings
# The OVS neutron plugin will talk in terms of the networks in the bridge_mappings
$br_map_str = join($bridge_mappings, ',')
quantum_plugin_ovs {
neutron_plugin_ovs {
'OVS/bridge_mappings': value => $br_map_str;
}
quantum::plugins::ovs::bridge{ $bridge_mappings:
before => Service['quantum-plugin-ovs-service'],
neutron::plugins::ovs::bridge{ $bridge_mappings:
before => Service['neutron-plugin-ovs-service'],
}
quantum::plugins::ovs::port{ $bridge_uplinks:
before => Service['quantum-plugin-ovs-service'],
neutron::plugins::ovs::port{ $bridge_uplinks:
before => Service['neutron-plugin-ovs-service'],
}
}
quantum_plugin_ovs {
neutron_plugin_ovs {
'AGENT/polling_interval': value => $polling_interval;
'OVS/integration_bridge': value => $integration_bridge;
}
if ($firewall_driver) {
quantum_plugin_ovs { 'SECURITYGROUP/firewall_driver':
neutron_plugin_ovs { 'SECURITYGROUP/firewall_driver':
value => $firewall_driver
}
} else {
quantum_plugin_ovs { 'SECURITYGROUP/firewall_driver': ensure => absent }
neutron_plugin_ovs { 'SECURITYGROUP/firewall_driver': ensure => absent }
}
vs_bridge { $integration_bridge:
ensure => present,
before => Service['quantum-plugin-ovs-service'],
before => Service['neutron-plugin-ovs-service'],
}
if $enable_tunneling {
vs_bridge { $tunnel_bridge:
ensure => present,
before => Service['quantum-plugin-ovs-service'],
before => Service['neutron-plugin-ovs-service'],
}
quantum_plugin_ovs {
neutron_plugin_ovs {
'OVS/enable_tunneling': value => true;
'OVS/tunnel_bridge': value => $tunnel_bridge;
'OVS/local_ip': value => $local_ip;
}
} else {
quantum_plugin_ovs {
neutron_plugin_ovs {
'OVS/enable_tunneling': value => false;
'OVS/tunnel_bridge': ensure => absent;
'OVS/local_ip': ensure => absent;
@ -95,23 +95,23 @@ class quantum::agents::ovs (
}
if $::quantum::params::ovs_agent_package {
Package['quantum-plugin-ovs-agent'] -> Quantum_plugin_ovs<||>
package { 'quantum-plugin-ovs-agent':
if $::neutron::params::ovs_agent_package {
Package['neutron-plugin-ovs-agent'] -> Neutron_plugin_ovs<||>
package { 'neutron-plugin-ovs-agent':
ensure => $package_ensure,
name => $::quantum::params::ovs_agent_package,
name => $::neutron::params::ovs_agent_package,
}
} else {
# Some platforms (RedHat) do not provide a separate
# quantum plugin ovs agent package. The configuration file for
# the ovs agent is provided by the quantum ovs plugin package.
Package['quantum-plugin-ovs'] -> Quantum_plugin_ovs<||>
Package['quantum-plugin-ovs'] -> Service['ovs-cleanup-service']
# neutron plugin ovs agent package. The configuration file for
# the ovs agent is provided by the neutron ovs plugin package.
Package['neutron-plugin-ovs'] -> Neutron_plugin_ovs<||>
Package['neutron-plugin-ovs'] -> Service['ovs-cleanup-service']
if ! defined(Package['quantum-plugin-ovs']) {
package { 'quantum-plugin-ovs':
if ! defined(Package['neutron-plugin-ovs']) {
package { 'neutron-plugin-ovs':
ensure => $package_ensure,
name => $::quantum::params::ovs_server_package,
name => $::neutron::params::ovs_server_package,
}
}
}
@ -122,17 +122,17 @@ class quantum::agents::ovs (
$service_ensure = 'stopped'
}
service { 'quantum-plugin-ovs-service':
service { 'neutron-plugin-ovs-service':
ensure => $service_ensure,
name => $::quantum::params::ovs_agent_service,
name => $::neutron::params::ovs_agent_service,
enable => $enabled,
require => Class['quantum'],
require => Class['neutron'],
}
if $::quantum::params::ovs_cleanup_service {
if $::neutron::params::ovs_cleanup_service {
service {'ovs-cleanup-service':
ensure => $service_ensure,
name => $::quantum::params::ovs_cleanup_service,
name => $::neutron::params::ovs_cleanup_service,
enable => $enabled,
}
}

View File

@ -1,6 +1,6 @@
# == Class: quantum::client
# == Class: neutron::client
#
# Manages the quantum client package on systems
# Manages the neutron client package on systems
#
# === Parameters:
#
@ -8,14 +8,14 @@
# (optional) The state of the package
# Defaults to present
#
class quantum::client (
class neutron::client (
$package_ensure = present
) {
include quantum::params
include neutron::params
package { 'python-quantumclient':
name => $::quantum::params::client_package_name,
package { 'python-neutronclient':
name => $::neutron::params::client_package_name,
ensure => $package_ensure
}

View File

@ -1,8 +1,8 @@
#
class quantum::db::mysql (
class neutron::db::mysql (
$password,
$dbname = 'quantum',
$user = 'quantum',
$dbname = 'neutron',
$user = 'neutron',
$host = '127.0.0.1',
$allowed_hosts = undef,
$charset = 'latin1',
@ -27,7 +27,7 @@ class quantum::db::mysql (
}
if $real_allowed_hosts {
quantum::db::mysql::host_access { $real_allowed_hosts:
neutron::db::mysql::host_access { $real_allowed_hosts:
user => $user,
password => $password,
database => $dbname,

View File

@ -1,7 +1,7 @@
#
# Used to grant access to the quantum mysql DB
# Used to grant access to the neutron mysql DB
#
define quantum::db::mysql::host_access ($user, $password, $database) {
define neutron::db::mysql::host_access ($user, $password, $database) {
database_user { "${user}@${name}":
password_hash => mysql_password($password),
provider => 'mysql',

View File

@ -1,12 +1,12 @@
# == Class: quantum
# == Class: neutron
#
# Installs the quantum package and configures
# /etc/quantum/quantum.conf
# Installs the neutron package and configures
# /etc/neutron/neutron.conf
#
# === Parameters:
#
# [*enabled*]
# (required) Whether or not to enable the quantum service
# (required) Whether or not to enable the neutron service
# true/false
#
# [*package_ensure*]
@ -30,8 +30,8 @@
# Defaults to 9696
#
# [*core_plugin*]
# (optional) Quantum plugin provider
# Defaults to OVSQquantumPluginV2 (openvswitch)
# (optional) Neutron plugin provider
# Defaults to OVSQneutronPluginV2 (openvswitch)
#
# [*auth_strategy*]
# (optional) How to authenticate
@ -59,7 +59,7 @@
#
# [*control_exchange*]
# (optional) What RPC queue/exchange to use
# Defaults to quantum
# Defaults to neutron
# [*rpc_backend*]
# (optional) what rpc/queuing service to use
@ -92,23 +92,23 @@
# [*qpid_reconnect_interval_max*]
# (optional) various QPID options
#
class quantum (
class neutron (
$enabled = true,
$package_ensure = 'present',
$verbose = false,
$debug = false,
$bind_host = '0.0.0.0',
$bind_port = '9696',
$core_plugin = 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2',
$core_plugin = 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
$auth_strategy = 'keystone',
$base_mac = 'fa:16:3e:00:00:00',
$mac_generation_retries = 16,
$dhcp_lease_duration = 120,
$allow_bulk = true,
$allow_overlapping_ips = false,
$root_helper = 'sudo quantum-rootwrap /etc/quantum/rootwrap.conf',
$control_exchange = 'quantum',
$rpc_backend = 'quantum.openstack.common.rpc.impl_kombu',
$root_helper = 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf',
$control_exchange = 'neutron',
$rpc_backend = 'neutron.openstack.common.rpc.impl_kombu',
$rabbit_password = false,
$rabbit_host = 'localhost',
$rabbit_hosts = false,
@ -130,30 +130,30 @@ class quantum (
$qpid_reconnect_interval = 0
) {
include quantum::params
include neutron::params
Package['quantum'] -> Quantum_config<||>
Package['neutron'] -> Neutron_config<||>
File {
require => Package['quantum'],
require => Package['neutron'],
owner => 'root',
group => 'quantum',
group => 'neutron',
mode => '0640',
}
file { '/etc/quantum':
file { '/etc/neutron':
ensure => directory,
mode => '0750',
}
file { '/etc/quantum/quantum.conf': }
file { '/etc/neutron/neutron.conf': }
package { 'quantum':
name => $::quantum::params::package_name,
package { 'neutron':
name => $::neutron::params::package_name,
ensure => $package_ensure
}
quantum_config {
neutron_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/bind_host': value => $bind_host;
@ -170,29 +170,29 @@ class quantum (
'AGENT/root_helper': value => $root_helper;
}
if $rpc_backend == 'quantum.openstack.common.rpc.impl_kombu' {
if $rpc_backend == 'neutron.openstack.common.rpc.impl_kombu' {
if ! $rabbit_password {
fail('When rpc_backend is rabbitmq, you must set rabbit password')
}
if $rabbit_hosts {
quantum_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
quantum_config { 'DEFAULT/rabbit_ha_queues': value => true }
neutron_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
neutron_config { 'DEFAULT/rabbit_ha_queues': value => true }
} else {
quantum_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
quantum_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
quantum_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
quantum_config { 'DEFAULT/rabbit_ha_queues': value => false }
neutron_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
neutron_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
neutron_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
neutron_config { 'DEFAULT/rabbit_ha_queues': value => false }
}
quantum_config {
neutron_config {
'DEFAULT/rabbit_userid': value => $rabbit_user;
'DEFAULT/rabbit_password': value => $rabbit_password;
'DEFAULT/rabbit_virtual_host': value => $rabbit_virtual_host;
}
}
if $rpc_backend == 'quantum.openstack.common.rpc.impl_qpid' {
quantum_config {
if $rpc_backend == 'neutron.openstack.common.rpc.impl_qpid' {
neutron_config {
'DEFAULT/qpid_hostname': value => $qpid_hostname;
'DEFAULT/qpid_port': value => $qpid_port;
'DEFAULT/qpid_username': value => $qpid_username;

View File

@ -1,7 +1,7 @@
class quantum::keystone::auth (
class neutron::keystone::auth (
$password,
$auth_name = 'quantum',
$email = 'quantum@localhost',
$auth_name = 'neutron',
$email = 'neutron@localhost',
$tenant = 'services',
$configure_endpoint = true,
$service_type = 'network',
@ -14,7 +14,7 @@ class quantum::keystone::auth (
$region = 'RegionOne'
) {
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'quantum-server' |>
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'neutron-server' |>
if ! $public_port {
$real_public_port = $port
@ -35,7 +35,7 @@ class quantum::keystone::auth (
keystone_service { $auth_name:
ensure => present,
type => $service_type,
description => 'Quantum Networking Service',
description => 'Neutron Networking Service',
}
if $configure_endpoint {

View File

@ -1,34 +1,34 @@
class quantum::params {
class neutron::params {
if($::osfamily == 'Redhat') {
$package_name = 'openstack-quantum'
$package_name = 'openstack-neutron'
$server_package = false
$server_service = 'quantum-server'
$server_service = 'neutron-server'
$ovs_agent_package = false
$ovs_agent_service = 'quantum-openvswitch-agent'
$ovs_server_package = 'openstack-quantum-openvswitch'
$ovs_cleanup_service = 'quantum-ovs-cleanup'
$ovs_agent_service = 'neutron-openvswitch-agent'
$ovs_server_package = 'openstack-neutron-openvswitch'
$ovs_cleanup_service = 'neutron-ovs-cleanup'
$linuxbridge_agent_package = false
$linuxbridge_agent_service = 'quantum-linuxbridge-agent'
$linuxbridge_server_package = 'openstack-quantum-linuxbridge'
$linuxbridge_config_file = '/etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini'
$linuxbridge_agent_service = 'neutron-linuxbridge-agent'
$linuxbridge_server_package = 'openstack-neutron-linuxbridge'
$linuxbridge_config_file = '/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini'
$dhcp_agent_package = false
$dhcp_agent_service = 'quantum-dhcp-agent'
$dhcp_agent_service = 'neutron-dhcp-agent'
$dnsmasq_packages = ['dnsmasq', 'dnsmasq-utils']
$lbaas_agent_package = false
$lbaas_agent_service = 'quantum-lbaas-agent'
$lbaas_agent_service = 'neutron-lbaas-agent'
$haproxy_package = 'haproxy'
$l3_agent_package = false
$l3_agent_service = 'quantum-l3-agent'
$l3_agent_service = 'neutron-l3-agent'
$metadata_agent_service = 'quantum-metadata-agent'
$metadata_agent_service = 'neutron-metadata-agent'
$cliff_package = 'python-cliff'
@ -36,37 +36,37 @@ class quantum::params {
} elsif($::osfamily == 'Debian') {
$package_name = 'quantum-common'
$server_package = 'quantum-server'
$server_service = 'quantum-server'
$package_name = 'neutron-common'
$server_package = 'neutron-server'
$server_service = 'neutron-server'
$ovs_agent_package = 'quantum-plugin-openvswitch-agent'
$ovs_agent_service = 'quantum-plugin-openvswitch-agent'
$ovs_server_package = 'quantum-plugin-openvswitch'
$ovs_agent_package = 'neutron-plugin-openvswitch-agent'
$ovs_agent_service = 'neutron-plugin-openvswitch-agent'
$ovs_server_package = 'neutron-plugin-openvswitch'
$ovs_cleanup_service = false
$linuxbridge_agent_package = 'quantum-plugin-linuxbridge-agent'
$linuxbridge_agent_service = 'quantum-plugin-linuxbridge-agent'
$linuxbridge_server_package = 'quantum-plugin-linuxbridge'
$linuxbridge_config_file = '/etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini'
$linuxbridge_agent_package = 'neutron-plugin-linuxbridge-agent'
$linuxbridge_agent_service = 'neutron-plugin-linuxbridge-agent'
$linuxbridge_server_package = 'neutron-plugin-linuxbridge'
$linuxbridge_config_file = '/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini'
$dhcp_agent_package = 'quantum-dhcp-agent'
$dhcp_agent_service = 'quantum-dhcp-agent'
$dhcp_agent_package = 'neutron-dhcp-agent'
$dhcp_agent_service = 'neutron-dhcp-agent'
$lbaas_agent_package = 'quantum-lbaas-agent'
$lbaas_agent_service = 'quantum-lbaas-agent'
$lbaas_agent_package = 'neutron-lbaas-agent'
$lbaas_agent_service = 'neutron-lbaas-agent'
$haproxy_package = 'haproxy'
$metadata_agent_package = 'quantum-metadata-agent'
$metadata_agent_service = 'quantum-metadata-agent'
$metadata_agent_package = 'neutron-metadata-agent'
$metadata_agent_service = 'neutron-metadata-agent'
$dnsmasq_packages = ['dnsmasq-base', 'dnsmasq-utils']
$isc_dhcp_packages = ['isc-dhcp-server']
$l3_agent_package = 'quantum-l3-agent'
$l3_agent_service = 'quantum-l3-agent'
$l3_agent_package = 'neutron-l3-agent'
$l3_agent_service = 'neutron-l3-agent'
$cliff_package = 'python-cliff'
$kernel_headers = "linux-headers-${::kernelrelease}"

View File

@ -1,8 +1,8 @@
#
# Configure the cisco quantum plugin
# Configure the cisco neutron plugin
# More info available here:
# https://wiki.openstack.org/wiki/Cisco-quantum
# https://wiki.openstack.org/wiki/Cisco-neutron
#
# === Parameters
#
@ -14,11 +14,11 @@
#
# [*database_name*]
# The name of the db table to use
# Defaults to quantum
# Defaults to neutron
#
# [*database_user*]
# The user that will be used to connect to the db
# Defaults to quantum
# Defaults to neutron
#
# [*database_host*]
# The address or hostname of the database
@ -26,7 +26,7 @@
#
# [*keystone_username*]
# The admin username for the plugin to use
# Defaults to quantum
# Defaults to neutron
#
# [*keystone_auth_url*]
# The url against which to authenticate
@ -38,103 +38,103 @@
#
# [*vswitch_plugin*]
# (optional) The openvswitch plugin to use
# Defaults to ovs_quantum_plugin.OVSQuantumPluginV2
# Defaults to ovs_neutron_plugin.OVSNeutronPluginV2
#
# [*nexus_plugin*]
# (optional) The nexus plugin to use
# Defaults to undef. This will not set a nexus plugin to use
# Can be set to quantum.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin
# Can be set to neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin
#
# Other parameters are currently not used by the plugin and
# can be left unchanged, but in grizzly the plugin will fail
# to launch if they are not there. The config for Havana will
# move to a single config file and this will be simplified.
class quantum::plugins::cisco(
class neutron::plugins::cisco(
$keystone_password,
$database_pass,
# Database connection
$database_name = 'quantum',
$database_user = 'quantum',
$database_name = 'neutron',
$database_user = 'neutron',
$database_host = '127.0.0.1',
# Keystone connection
$keystone_username = 'quantum',
$keystone_username = 'neutron',
$keystone_tenant = 'services',
$keystone_auth_url = 'http://127.0.0.1:35357/v2.0/',
$vswitch_plugin = 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2',
$vswitch_plugin = 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
$nexus_plugin = undef,
# Plugin minimum configuration
$vlan_start = '100',
$vlan_end = '3000',
$vlan_name_prefix = 'q-',
$model_class = 'quantum.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2',
$model_class = 'neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2',
$max_ports = '100',
$max_port_profiles = '65568',
$manager_class = 'quantum.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr',
$manager_class = 'neutron.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr',
$max_networks = '65568'
)
{
Quantum_plugin_cisco<||> ~> Service['quantum-server']
Quantum_plugin_cisco_db_conn<||> ~> Service['quantum-server']
Quantum_plugin_cisco_l2network<||> ~> Service['quantum-server']
Neutron_plugin_cisco<||> ~> Service['neutron-server']
Neutron_plugin_cisco_db_conn<||> ~> Service['neutron-server']
Neutron_plugin_cisco_l2network<||> ~> Service['neutron-server']
ensure_resource('file', '/etc/quantum/plugins', {
ensure_resource('file', '/etc/neutron/plugins', {
ensure => directory,
owner => 'root',
group => 'quantum',
group => 'neutron',
mode => '0640'}
)
ensure_resource('file', '/etc/quantum/plugins/cisco', {
ensure_resource('file', '/etc/neutron/plugins/cisco', {
ensure => directory,
owner => 'root',
group => 'quantum',
group => 'neutron',
mode => '0640'}
)
# Ensure the quantum package is installed before config is set
# Ensure the neutron package is installed before config is set
# under both RHEL and Ubuntu
if ($::quantum::params::server_package) {
Package['quantum-server'] -> Quantum_plugin_cisco<||>
Package['quantum-server'] -> Quantum_plugin_cisco_db_conn<||>
Package['quantum-server'] -> Quantum_plugin_cisco_l2network<||>
if ($::neutron::params::server_package) {
Package['neutron-server'] -> Neutron_plugin_cisco<||>
Package['neutron-server'] -> Neutron_plugin_cisco_db_conn<||>
Package['neutron-server'] -> Neutron_plugin_cisco_l2network<||>
} else {
Package['quantum'] -> Quantum_plugin_cisco<||>
Package['quantum'] -> Quantum_plugin_cisco_db_conn<||>
Package['quantum'] -> Quantum_plugin_cisco_l2network<||>
Package['neutron'] -> Neutron_plugin_cisco<||>
Package['neutron'] -> Neutron_plugin_cisco_db_conn<||>
Package['neutron'] -> Neutron_plugin_cisco_l2network<||>
}
if $nexus_plugin {
quantum_plugin_cisco {
neutron_plugin_cisco {
'PLUGINS/nexus_plugin' : value => $nexus_plugin;
}
}
if $vswitch_plugin {
quantum_plugin_cisco {
neutron_plugin_cisco {
'PLUGINS/vswitch_plugin' : value => $vswitch_plugin;
}
}
# quantum-server will crash if the inventory section is empty.
# neutron-server will crash if the inventory section is empty.
# this is usually used for specifying which physical nexus
# devices are to be used.
quantum_plugin_cisco {
neutron_plugin_cisco {
'INVENTORY/dummy' : value => 'dummy';
}
quantum_plugin_cisco_db_conn {
neutron_plugin_cisco_db_conn {
'DATABASE/name': value => $database_name;
'DATABASE/user': value => $database_user;
'DATABASE/pass': value => $database_pass;
'DATABASE/host': value => $database_host;
}
quantum_plugin_cisco_l2network {
neutron_plugin_cisco_l2network {
'VLANS/vlan_start': value => $vlan_start;
'VLANS/vlan_end': value => $vlan_end;
'VLANS/vlan_name_prefix': value => $vlan_name_prefix;
@ -145,7 +145,7 @@ class quantum::plugins::cisco(
'SEGMENTATION/manager_class': value => $manager_class;
}
quantum_plugin_cisco_credentials {
neutron_plugin_cisco_credentials {
'keystone/username': value => $keystone_username;
'keystone/password': value => $keystone_password;
'keystone/auth_url': value => $keystone_auth_url;

View File

@ -1,6 +1,6 @@
# == Class: quantum::plugins::linuxbridge
# == Class: neutron::plugins::linuxbridge
#
# Setups linuxbridge plugin for quantum server.
# Setups linuxbridge plugin for neutron server.
#
# === Parameters
#
@ -20,46 +20,46 @@
# [*package_ensure*]
# (optional) Ensure state for package. Defaults to 'present'.
#
class quantum::plugins::linuxbridge (
$sql_connection = 'sqlite:////var/lib/quantum/linuxbridge.sqlite',
class neutron::plugins::linuxbridge (
$sql_connection = 'sqlite:////var/lib/neutron/linuxbridge.sqlite',
$network_vlan_ranges = 'physnet1:1000:2000',
$tenant_network_type = 'vlan',
$package_ensure = 'present'
) {
include quantum::params
include neutron::params
Package['quantum'] -> Package['quantum-plugin-linuxbridge']
Package['quantum-plugin-linuxbridge'] -> Quantum_plugin_linuxbridge<||>
Quantum_plugin_linuxbridge<||> ~> Service<| title == 'quantum-server' |>
Package['quantum-plugin-linuxbridge'] -> Service<| title == 'quantum-server' |>
Package['neutron'] -> Package['neutron-plugin-linuxbridge']
Package['neutron-plugin-linuxbridge'] -> Neutron_plugin_linuxbridge<||>
Neutron_plugin_linuxbridge<||> ~> Service<| title == 'neutron-server' |>
Package['neutron-plugin-linuxbridge'] -> Service<| title == 'neutron-server' |>
if $::osfamily == 'Debian' {
file_line { '/etc/default/quantum-server:QUANTUM_PLUGIN_CONFIG':
path => '/etc/default/quantum-server',
match => '^QUANTUM_PLUGIN_CONFIG=(.*)$',
line => "QUANTUM_PLUGIN_CONFIG=${::quantum::params::linuxbridge_config_file}",
require => Package['quantum-plugin-linuxbridge'],
notify => Service['quantum-server'],
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
path => '/etc/default/neutron-server',
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
line => "NEUTRON_PLUGIN_CONFIG=${::neutron::params::linuxbridge_config_file}",
require => Package['neutron-plugin-linuxbridge'],
notify => Service['neutron-server'],
}
}
package { 'quantum-plugin-linuxbridge':
package { 'neutron-plugin-linuxbridge':
ensure => $package_ensure,
name => $::quantum::params::linuxbridge_server_package,
name => $::neutron::params::linuxbridge_server_package,
}
quantum_plugin_linuxbridge {
neutron_plugin_linuxbridge {
'DATABASE/sql_connection': value => $sql_connection;
'VLANS/tenant_network_type': value => $tenant_network_type;
'VLANS/network_vlan_ranges': value => $network_vlan_ranges;
}
if $::osfamily == 'Redhat' {
file {'/etc/quantum/plugin.ini':
file {'/etc/neutron/plugin.ini':
ensure => link,
target => '/etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini',
require => Package['quantum-plugin-linuxbridge']
target => '/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini',
require => Package['neutron-plugin-linuxbridge']
}
}

View File

@ -1,4 +1,4 @@
# Configure the quantum server to use the OVS plugin.
# Configure the neutron server to use the OVS plugin.
# This configures the plugin for the API server, but does nothing
# about configuring the agents that must also run and share a config
# file with the OVS plugin if both are on the same machine.
@ -9,9 +9,9 @@
# (optional) Timeout for SQL to reap connetions.
# Defaults to '3600'.
#
class quantum::plugins::ovs (
class neutron::plugins::ovs (
$package_ensure = 'present',
$sql_connection = 'sqlite:////var/lib/quantum/ovs.sqlite',
$sql_connection = 'sqlite:////var/lib/neutron/ovs.sqlite',
$sql_max_retries = 10,
$sql_idle_timeout = '3600',
$reconnect_interval = 2,
@ -26,13 +26,13 @@ class quantum::plugins::ovs (
$tunnel_id_ranges = '1:1000'
) {
include quantum::params
include neutron::params
require vswitch::ovs
Package['quantum'] -> Package['quantum-plugin-ovs']
Package['quantum-plugin-ovs'] -> Quantum_plugin_ovs<||>
Quantum_plugin_ovs<||> ~> Service<| title == 'quantum-server' |>
Package['quantum-plugin-ovs'] -> Service<| title == 'quantum-server' |>
Package['neutron'] -> Package['neutron-plugin-ovs']
Package['neutron-plugin-ovs'] -> Neutron_plugin_ovs<||>
Neutron_plugin_ovs<||> ~> Service<| title == 'neutron-server' |>
Package['neutron-plugin-ovs'] -> Service<| title == 'neutron-server' |>
validate_re($sql_connection, '(sqlite|mysql|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
@ -51,14 +51,14 @@ class quantum::plugins::ovs (
}
}
if ! defined(Package['quantum-plugin-ovs']) {
package { 'quantum-plugin-ovs':
if ! defined(Package['neutron-plugin-ovs']) {
package { 'neutron-plugin-ovs':
ensure => $package_ensure,
name => $::quantum::params::ovs_server_package,
name => $::neutron::params::ovs_server_package,
}
}
quantum_plugin_ovs {
neutron_plugin_ovs {
'DATABASE/sql_connection': value => $sql_connection;
'DATABASE/sql_max_retries': value => $sql_max_retries;
'DATABASE/sql_idle_timeout': value => $sql_idle_timeout;
@ -67,7 +67,7 @@ class quantum::plugins::ovs (
}
if($tenant_network_type == 'gre') {
quantum_plugin_ovs {
neutron_plugin_ovs {
# this is set by the plugin and the agent - since the plugin node has the agent installed
# we rely on it setting it.
# TODO(ijw): do something with a virtualised node
@ -84,23 +84,23 @@ class quantum::plugins::ovs (
}
} else {
if ! $network_vlan_ranges {
quantum_plugin_ovs { 'OVS/network_vlan_ranges': ensure => absent }
neutron_plugin_ovs { 'OVS/network_vlan_ranges': ensure => absent }
}
}
# This might be set by the user for the gre case where
# provider networks are in use
if $network_vlan_ranges {
quantum_plugin_ovs {
neutron_plugin_ovs {
'OVS/network_vlan_ranges': value => $network_vlan_ranges
}
}
if $::osfamily == 'Redhat' {
file {'/etc/quantum/plugin.ini':
file {'/etc/neutron/plugin.ini':
ensure => link,
target => '/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini',
require => Package['quantum-plugin-ovs']
target => '/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini',
require => Package['neutron-plugin-ovs']
}
}
}

View File

@ -1,4 +1,4 @@
define quantum::plugins::ovs::bridge {
define neutron::plugins::ovs::bridge {
$mapping = split($name, ':')
$bridge = $mapping[1]

View File

@ -1,4 +1,4 @@
define quantum::plugins::ovs::port {
define neutron::plugins::ovs::port {
$mapping = split($name, ':')
vs_port {$mapping[1]:
ensure => present,

View File

@ -1,6 +1,6 @@
# == Class: quantum::quota
# == Class: neutron::quota
#
# Setups quantum quota.
# Setups neutron quota.
#
# === Parameters
#
@ -40,7 +40,7 @@
#
# [*quota_driver*]
# (optional) Default driver to use for quota checks.
# Defaults to 'quantum.quota.ConfDriver'.
# Defaults to 'neutron.quota.ConfDriver'.
#
# [*quota_firewall*]
# (optional) Number of firewalls allowed per tenant, -1 for unlimited.
@ -54,7 +54,7 @@
# (optional) Number of firewalls rules allowed per tenant, -1 for unlimited.
# Defaults to '-1'.
#
class quantum::quota (
class neutron::quota (
$default_quota = -1,
$quota_network = 10,
$quota_subnet = 10,
@ -65,13 +65,13 @@ class quantum::quota (
# securitygroup extension
$quota_security_group = 10,
$quota_security_group_rule = 100,
$quota_driver = 'quantum.quota.ConfDriver',
$quota_driver = 'neutron.quota.ConfDriver',
$quota_firewall = 1,
$quota_firewall_policy = 1,
$quota_firewall_rule = -1
) {
quantum_config {
neutron_config {
'QUOTAS/default_quota': value => $default_quota;
'QUOTAS/quota_network': value => $quota_network;
'QUOTAS/quota_subnet': value => $quota_subnet;

View File

@ -1,6 +1,6 @@
# == Class: quantum::server
# == Class: neutron::server
#
# Setup and configure the quantum API endpoint
# Setup and configure the neutron API endpoint
#
# === Parameters
#
@ -17,7 +17,7 @@
#
# [*log_dir*]
# (optional) Directory to store logs
# Defaults to /var/log/quantum
# Defaults to /var/log/neutron
#
# [*auth_password*]
# (optional) The password to use for authentication (keystone)
@ -51,13 +51,13 @@
#
# [*auth_user*]
# (optional) The name of the auth user
# Defaults to quantum
# Defaults to neutron
#
# [*auth_protocol*]
# (optional) The protocol to connect to keystone
# Defaults to http
#
class quantum::server (
class neutron::server (
$package_ensure = 'present',
$enabled = true,
$auth_password = false,
@ -66,25 +66,25 @@ class quantum::server (
$auth_port = '35357',
$auth_admin_prefix = false,
$auth_tenant = 'services',
$auth_user = 'quantum',
$auth_user = 'neutron',
$auth_protocol = 'http',
$log_file = false,
$log_dir = '/var/log/quantum'
$log_dir = '/var/log/neutron'
) {
include quantum::params
include neutron::params
require keystone::python
Quantum_config<||> ~> Service['quantum-server']
Quantum_api_config<||> ~> Service['quantum-server']
Neutron_config<||> ~> Service['neutron-server']
Neutron_api_config<||> ~> Service['neutron-server']
if $log_file {
quantum_config {
neutron_config {
'DEFAULT/log_file': value => $log_file;
'DEFAULT/log_dir': ensure => absent;
}
} else {
quantum_config {
neutron_config {
'DEFAULT/log_dir': value => $log_dir;
'DEFAULT/log_file': ensure => absent;
}
@ -96,18 +96,18 @@ class quantum::server (
$service_ensure = 'stopped'
}
if ($::quantum::params::server_package) {
Package['quantum-server'] -> Quantum_api_config<||>
Package['quantum-server'] -> Quantum_config<||>
Package['quantum-server'] -> Service['quantum-server']
package { 'quantum-server':
name => $::quantum::params::server_package,
if ($::neutron::params::server_package) {
Package['neutron-server'] -> Neutron_api_config<||>
Package['neutron-server'] -> Neutron_config<||>
Package['neutron-server'] -> Service['neutron-server']
package { 'neutron-server':
name => $::neutron::params::server_package,
ensure => $package_ensure
}
} else {
# Some platforms (RedHat) does not provide a quantum-server package.
# The quantum api config file is provided by the quantum package.
Package['quantum'] -> Quantum_api_config<||>
# Some platforms (RedHat) does not provide a neutron-server package.
# The neutron api config file is provided by the neutron package.
Package['neutron'] -> Neutron_api_config<||>
}
if ($auth_type == 'keystone') {
@ -115,7 +115,7 @@ class quantum::server (
if ($auth_password == false) {
fail('$auth_password must be set when using keystone authentication.')
} else {
quantum_config {
neutron_config {
'keystone_authtoken/auth_host': value => $auth_host;
'keystone_authtoken/auth_port': value => $auth_port;
'keystone_authtoken/auth_protocol': value => $auth_protocol;
@ -124,7 +124,7 @@ class quantum::server (
'keystone_authtoken/admin_password': value => $auth_password;
}
quantum_api_config {
neutron_api_config {
'filter:authtoken/auth_host': value => $auth_host;
'filter:authtoken/auth_port': value => $auth_port;
'filter:authtoken/auth_protocol': value => $auth_protocol;
@ -135,17 +135,17 @@ class quantum::server (
if $auth_admin_prefix {
validate_re($auth_admin_prefix, '^(/.+[^/])?$')
quantum_config {
neutron_config {
'keystone_authtoken/auth_admin_prefix': value => $auth_admin_prefix;
}
quantum_api_config {
neutron_api_config {
'filter:authtoken/auth_admin_prefix': value => $auth_admin_prefix;
}
} else {
quantum_config {
neutron_config {
'keystone_authtoken/auth_admin_prefix': ensure => absent;
}
quantum_api_config {
neutron_api_config {
'filter:authtoken/auth_admin_prefix': ensure => absent;
}
}
@ -153,12 +153,12 @@ class quantum::server (
}
service { 'quantum-server':
name => $::quantum::params::server_service,
service { 'neutron-server':
name => $::neutron::params::server_service,
ensure => $service_ensure,
enable => $enabled,
hasstatus => true,
hasrestart => true,
require => Class['quantum'],
require => Class['neutron'],
}
}

View File

@ -0,0 +1,108 @@
require 'spec_helper'
describe 'neutron::agents::dhcp' do
let :pre_condition do
"class { 'neutron': rabbit_password => 'passw0rd' }"
end
let :params do
{}
end
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:debug => false,
:state_path => '/var/lib/neutron',
:resync_interval => 30,
:interface_driver => 'neutron.agent.linux.interface.OVSInterfaceDriver',
:dhcp_driver => 'neutron.agent.linux.dhcp.Dnsmasq',
:root_helper => 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf',
:use_namespaces => true }
end
shared_examples_for 'neutron dhcp agent' do
let :p do
default_params.merge(params)
end
it { should include_class('neutron::params') }
it_configures 'dnsmasq dhcp_driver'
it 'configures dhcp_agent.ini' do
should contain_neutron_dhcp_agent_config('DEFAULT/debug').with_value(p[:debug]);
should contain_neutron_dhcp_agent_config('DEFAULT/state_path').with_value(p[:state_path]);
should contain_neutron_dhcp_agent_config('DEFAULT/resync_interval').with_value(p[:resync_interval]);
should contain_neutron_dhcp_agent_config('DEFAULT/interface_driver').with_value(p[:interface_driver]);
should contain_neutron_dhcp_agent_config('DEFAULT/dhcp_driver').with_value(p[:dhcp_driver]);
should contain_neutron_dhcp_agent_config('DEFAULT/root_helper').with_value(p[:root_helper]);
should contain_neutron_dhcp_agent_config('DEFAULT/use_namespaces').with_value(p[:use_namespaces]);
end
it 'installs neutron dhcp agent package' do
if platform_params.has_key?(:dhcp_agent_package)
should contain_package('neutron-dhcp-agent').with(
:name => platform_params[:dhcp_agent_package],
:ensure => p[:package_ensure]
)
should contain_package('neutron').with_before(/Package\[neutron-dhcp-agent\]/)
should contain_package('neutron-dhcp-agent').with_before(/Neutron_dhcp_agent_config\[.+\]/)
should contain_package('neutron-dhcp-agent').with_before(/Neutron_config\[.+\]/)
else
should contain_package('neutron').with_before(/Neutron_dhcp_agent_config\[.+\]/)
end
end
it 'configures neutron dhcp agent service' do
should contain_service('neutron-dhcp-service').with(
:name => platform_params[:dhcp_agent_service],
:enable => true,
:ensure => 'running',
:require => 'Class[Neutron]'
)
end
end
shared_examples_for 'dnsmasq dhcp_driver' do
it 'installs dnsmasq packages' do
if platform_params.has_key?(:dhcp_agent_package)
should contain_package('dnsmasq').with_before('Package[neutron-dhcp-agent]')
end
should contain_package('dnsmasq').with(
:ensure => 'present',
:name => platform_params[:dnsmasq_packages]
)
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
let :platform_params do
{ :dnsmasq_packages => ['dnsmasq-base', 'dnsmasq-utils'],
:dhcp_agent_package => 'neutron-dhcp-agent',
:dhcp_agent_service => 'neutron-dhcp-agent' }
end
it_configures 'neutron dhcp agent'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
let :platform_params do
{ :dnsmasq_packages => ['dnsmasq', 'dnsmasq-utils'],
:dhcp_agent_service => 'neutron-dhcp-agent' }
end
it_configures 'neutron dhcp agent'
end
end

View File

@ -1,9 +1,9 @@
require 'spec_helper'
describe 'quantum::agents::l3' do
describe 'neutron::agents::l3' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }"
"class { 'neutron': rabbit_password => 'passw0rd' }"
end
let :default_params do
@ -12,7 +12,7 @@ describe 'quantum::agents::l3' do
:debug => false,
:external_network_bridge => 'br-ex',
:use_namespaces => true,
:interface_driver => 'quantum.agent.linux.interface.OVSInterfaceDriver',
:interface_driver => 'neutron.agent.linux.interface.OVSInterfaceDriver',
:router_id => nil,
:gateway_external_network_id => nil,
:handle_internal_only_routers => true,
@ -27,47 +27,47 @@ describe 'quantum::agents::l3' do
{ }
end
shared_examples_for 'quantum l3 agent' do
shared_examples_for 'neutron l3 agent' do
let :p do
default_params.merge(params)
end
it { should include_class('quantum::params') }
it { should include_class('neutron::params') }
it 'configures l3_agent.ini' do
should contain_quantum_l3_agent_config('DEFAULT/debug').with_value(p[:debug])
should contain_quantum_l3_agent_config('DEFAULT/external_network_bridge').with_value(p[:external_network_bridge])
should contain_quantum_l3_agent_config('DEFAULT/use_namespaces').with_value(p[:use_namespaces])
should contain_quantum_l3_agent_config('DEFAULT/interface_driver').with_value(p[:interface_driver])
should contain_quantum_l3_agent_config('DEFAULT/router_id').with_value(p[:router_id])
should contain_quantum_l3_agent_config('DEFAULT/gateway_external_network_id').with_value(p[:gateway_external_network_id])
should contain_quantum_l3_agent_config('DEFAULT/handle_internal_only_routers').with_value(p[:handle_internal_only_routers])
should contain_quantum_l3_agent_config('DEFAULT/metadata_port').with_value(p[:metadata_port])
should contain_quantum_l3_agent_config('DEFAULT/send_arp_for_ha').with_value(p[:send_arp_for_ha])
should contain_quantum_l3_agent_config('DEFAULT/periodic_interval').with_value(p[:periodic_interval])
should contain_quantum_l3_agent_config('DEFAULT/periodic_fuzzy_delay').with_value(p[:periodic_fuzzy_delay])
should contain_quantum_l3_agent_config('DEFAULT/enable_metadata_proxy').with_value(p[:enable_metadata_proxy])
should contain_neutron_l3_agent_config('DEFAULT/debug').with_value(p[:debug])
should contain_neutron_l3_agent_config('DEFAULT/external_network_bridge').with_value(p[:external_network_bridge])
should contain_neutron_l3_agent_config('DEFAULT/use_namespaces').with_value(p[:use_namespaces])
should contain_neutron_l3_agent_config('DEFAULT/interface_driver').with_value(p[:interface_driver])
should contain_neutron_l3_agent_config('DEFAULT/router_id').with_value(p[:router_id])
should contain_neutron_l3_agent_config('DEFAULT/gateway_external_network_id').with_value(p[:gateway_external_network_id])
should contain_neutron_l3_agent_config('DEFAULT/handle_internal_only_routers').with_value(p[:handle_internal_only_routers])
should contain_neutron_l3_agent_config('DEFAULT/metadata_port').with_value(p[:metadata_port])
should contain_neutron_l3_agent_config('DEFAULT/send_arp_for_ha').with_value(p[:send_arp_for_ha])
should contain_neutron_l3_agent_config('DEFAULT/periodic_interval').with_value(p[:periodic_interval])
should contain_neutron_l3_agent_config('DEFAULT/periodic_fuzzy_delay').with_value(p[:periodic_fuzzy_delay])
should contain_neutron_l3_agent_config('DEFAULT/enable_metadata_proxy').with_value(p[:enable_metadata_proxy])
end
it 'installs quantum l3 agent package' do
it 'installs neutron l3 agent package' do
if platform_params.has_key?(:l3_agent_package)
should contain_package('quantum-l3').with(
should contain_package('neutron-l3').with(
:name => platform_params[:l3_agent_package],
:ensure => p[:package_ensure],
:require => 'Package[quantum]'
:require => 'Package[neutron]'
)
should contain_package('quantum-l3').with_before(/Quantum_l3_agent_config\[.+\]/)
should contain_package('neutron-l3').with_before(/Neutron_l3_agent_config\[.+\]/)
else
should contain_package('quantum').with_before(/Quantum_l3_agent_config\[.+\]/)
should contain_package('neutron').with_before(/Neutron_l3_agent_config\[.+\]/)
end
end
it 'configures quantum l3 agent service' do
should contain_service('quantum-l3').with(
it 'configures neutron l3 agent service' do
should contain_service('neutron-l3').with(
:name => platform_params[:l3_agent_service],
:enable => true,
:ensure => 'running',
:require => 'Class[Quantum]'
:require => 'Class[Neutron]'
)
end
@ -79,11 +79,11 @@ describe 'quantum::agents::l3' do
end
let :platform_params do
{ :l3_agent_package => 'quantum-l3-agent',
:l3_agent_service => 'quantum-l3-agent' }
{ :l3_agent_package => 'neutron-l3-agent',
:l3_agent_service => 'neutron-l3-agent' }
end
it_configures 'quantum l3 agent'
it_configures 'neutron l3 agent'
end
context 'on RedHat platforms' do
@ -92,9 +92,9 @@ describe 'quantum::agents::l3' do
end
let :platform_params do
{ :l3_agent_service => 'quantum-l3-agent' }
{ :l3_agent_service => 'neutron-l3-agent' }
end
it_configures 'quantum l3 agent'
it_configures 'neutron l3 agent'
end
end

View File

@ -1,9 +1,9 @@
require 'spec_helper'
describe 'quantum::agents::lbaas' do
describe 'neutron::agents::lbaas' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }"
"class { 'neutron': rabbit_password => 'passw0rd' }"
end
let :params do
@ -14,51 +14,51 @@ describe 'quantum::agents::lbaas' do
{ :package_ensure => 'present',
:enabled => true,
:debug => false,
:interface_driver => 'quantum.agent.linux.interface.OVSInterfaceDriver',
:device_driver => 'quantum.plugins.services.agent_loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver',
:interface_driver => 'neutron.agent.linux.interface.OVSInterfaceDriver',
:device_driver => 'neutron.plugins.services.agent_loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver',
:use_namespaces => true,
:user_group => 'nogroup',
}
end
shared_examples_for 'quantum lbaas agent' do
shared_examples_for 'neutron lbaas agent' do
let :p do
default_params.merge(params)
end
it { should include_class('quantum::params') }
it { should include_class('neutron::params') }
it_configures 'haproxy lbaas_driver'
it 'configures lbaas_agent.ini' do
should contain_quantum_lbaas_agent_config('DEFAULT/debug').with_value(p[:debug]);
should contain_quantum_lbaas_agent_config('DEFAULT/interface_driver').with_value(p[:interface_driver]);
should contain_quantum_lbaas_agent_config('DEFAULT/device_driver').with_value(p[:device_driver]);
should contain_quantum_lbaas_agent_config('DEFAULT/use_namespaces').with_value(p[:use_namespaces]);
should contain_quantum_lbaas_agent_config('DEFAULT/user_group').with_value(p[:user_group]);
should contain_neutron_lbaas_agent_config('DEFAULT/debug').with_value(p[:debug]);
should contain_neutron_lbaas_agent_config('DEFAULT/interface_driver').with_value(p[:interface_driver]);
should contain_neutron_lbaas_agent_config('DEFAULT/device_driver').with_value(p[:device_driver]);
should contain_neutron_lbaas_agent_config('DEFAULT/use_namespaces').with_value(p[:use_namespaces]);
should contain_neutron_lbaas_agent_config('DEFAULT/user_group').with_value(p[:user_group]);
end
it 'installs quantum lbaas agent package' do
it 'installs neutron lbaas agent package' do
if platform_params.has_key?(:lbaas_agent_package)
should contain_package('quantum-lbaas-agent').with(
should contain_package('neutron-lbaas-agent').with(
:name => platform_params[:lbaas_agent_package],
:ensure => p[:package_ensure]
)
should contain_package('quantum').with_before(/Package\[quantum-lbaas-agent\]/)
should contain_package('quantum-lbaas-agent').with_before(/Quantum_lbaas_agent_config\[.+\]/)
should contain_package('quantum-lbaas-agent').with_before(/Quantum_config\[.+\]/)
should contain_package('neutron').with_before(/Package\[neutron-lbaas-agent\]/)
should contain_package('neutron-lbaas-agent').with_before(/Neutron_lbaas_agent_config\[.+\]/)
should contain_package('neutron-lbaas-agent').with_before(/Neutron_config\[.+\]/)
else
should contain_package('quantum').with_before(/Quantum_lbaas_agent_config\[.+\]/)
should contain_package('neutron').with_before(/Neutron_lbaas_agent_config\[.+\]/)
end
end
it 'configures quantum lbaas agent service' do
should contain_service('quantum-lbaas-service').with(
it 'configures neutron lbaas agent service' do
should contain_service('neutron-lbaas-service').with(
:name => platform_params[:lbaas_agent_service],
:enable => true,
:ensure => 'running',
:require => 'Class[Quantum]'
:require => 'Class[Neutron]'
)
end
end
@ -66,7 +66,7 @@ describe 'quantum::agents::lbaas' do
shared_examples_for 'haproxy lbaas_driver' do
it 'installs haproxy packages' do
if platform_params.has_key?(:lbaas_agent_package)
should contain_package('haproxy').with_before('Package[quantum-lbaas-agent]')
should contain_package('haproxy').with_before('Package[neutron-lbaas-agent]')
end
should contain_package('haproxy').with(
:ensure => 'present',
@ -83,11 +83,11 @@ describe 'quantum::agents::lbaas' do
let :platform_params do
{ :haproxy_package => 'haproxy',
:lbaas_agent_package => 'quantum-lbaas-agent',
:lbaas_agent_service => 'quantum-lbaas-agent' }
:lbaas_agent_package => 'neutron-lbaas-agent',
:lbaas_agent_service => 'neutron-lbaas-agent' }
end
it_configures 'quantum lbaas agent'
it_configures 'neutron lbaas agent'
end
context 'on RedHat platforms' do
@ -97,9 +97,9 @@ describe 'quantum::agents::lbaas' do
let :platform_params do
{ :haproxy_package => 'haproxy',
:lbaas_agent_service => 'quantum-lbaas-agent' }
:lbaas_agent_service => 'neutron-lbaas-agent' }
end
it_configures 'quantum lbaas agent'
it_configures 'neutron lbaas agent'
end
end

View File

@ -1,26 +1,26 @@
require 'spec_helper'
describe 'quantum::agents::linuxbridge' do
describe 'neutron::agents::linuxbridge' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }\n" +
"class { 'quantum::plugins::linuxbridge': }"
"class { 'neutron': rabbit_password => 'passw0rd' }\n" +
"class { 'neutron::plugins::linuxbridge': }"
end
let :params do
{ :physical_interface_mappings => 'physnet:eth0',
:firewall_driver => 'quantum.agent.linux.iptables_firewall.IptablesFirewallDriver',
:firewall_driver => 'neutron.agent.linux.iptables_firewall.IptablesFirewallDriver',
:package_ensure => 'present',
:enable => true
}
end
shared_examples_for 'quantum linuxbridge agent' do
shared_examples_for 'neutron linuxbridge agent' do
it { should include_class('quantum::params') }
it { should include_class('neutron::params') }
it 'configures quantum linuxbridge agent service' do
should contain_service('quantum-plugin-linuxbridge-service').with(
it 'configures neutron linuxbridge agent service' do
should contain_service('neutron-plugin-linuxbridge-service').with(
:ensure => 'running',
:name => platform_params[:linuxbridge_agent_service],
:enable => params[:enable]
@ -28,10 +28,10 @@ describe 'quantum::agents::linuxbridge' do
end
it 'configures linuxbridge_conf.ini' do
should contain_quantum_plugin_linuxbridge('LINUX_BRIDGE/physical_interface_mappings').with(
should contain_neutron_plugin_linuxbridge('LINUX_BRIDGE/physical_interface_mappings').with(
:value => params[:physical_interface_mappings]
)
should contain_quantum_plugin_linuxbridge('SECURITYGROUP/firewall_driver').with(
should contain_neutron_plugin_linuxbridge('SECURITYGROUP/firewall_driver').with(
:value => params[:firewall_driver]
)
end
@ -44,14 +44,14 @@ describe 'quantum::agents::linuxbridge' do
end
let :platform_params do
{ :linuxbridge_agent_package => 'quantum-plugin-linuxbridge-agent',
:linuxbridge_agent_service => 'quantum-plugin-linuxbridge-agent' }
{ :linuxbridge_agent_package => 'neutron-plugin-linuxbridge-agent',
:linuxbridge_agent_service => 'neutron-plugin-linuxbridge-agent' }
end
it_configures 'quantum linuxbridge agent'
it_configures 'neutron linuxbridge agent'
it 'installs quantum linuxbridge agent package' do
should contain_package('quantum-plugin-linuxbridge-agent').with(
it 'installs neutron linuxbridge agent package' do
should contain_package('neutron-plugin-linuxbridge-agent').with(
:ensure => params[:package_ensure],
:name => platform_params[:linuxbridge_agent_package]
)
@ -64,10 +64,10 @@ describe 'quantum::agents::linuxbridge' do
end
let :platform_params do
{ :linuxbridge_agent_package => 'openstack-quantum-linuxbridge',
:linuxbridge_agent_service => 'quantum-linuxbridge-agent' }
{ :linuxbridge_agent_package => 'openstack-neutron-linuxbridge',
:linuxbridge_agent_service => 'neutron-linuxbridge-agent' }
end
it_configures 'quantum linuxbridge agent'
it_configures 'neutron linuxbridge agent'
end
end

View File

@ -1,9 +1,9 @@
require 'spec_helper'
describe 'quantum::agents::metadata' do
describe 'neutron::agents::metadata' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }"
"class { 'neutron': rabbit_password => 'passw0rd' }"
end
let :params do
@ -13,7 +13,7 @@ describe 'quantum::agents::metadata' do
:auth_url => 'http://localhost:35357/v2.0',
:auth_region => 'RegionOne',
:auth_tenant => 'services',
:auth_user => 'quantum',
:auth_user => 'neutron',
:auth_password => 'password',
:metadata_ip => '127.0.0.1',
:metadata_port => '8775',
@ -21,29 +21,29 @@ describe 'quantum::agents::metadata' do
}
end
shared_examples_for 'quantum metadata agent' do
shared_examples_for 'neutron metadata agent' do
it { should include_class('quantum::params') }
it { should include_class('neutron::params') }
it 'configures quantum metadata agent service' do
should contain_service('quantum-metadata').with(
it 'configures neutron metadata agent service' do
should contain_service('neutron-metadata').with(
:name => platform_params[:metadata_agent_service],
:enable => params[:enabled],
:ensure => 'running',
:require => 'Class[Quantum]'
:require => 'Class[Neutron]'
)
end
it 'configures metadata_agent.ini' do
should contain_quantum_metadata_agent_config('DEFAULT/debug').with(:value => params[:debug])
should contain_quantum_metadata_agent_config('DEFAULT/auth_url').with(:value => params[:auth_url])
should contain_quantum_metadata_agent_config('DEFAULT/auth_region').with(:value => params[:auth_region])
should contain_quantum_metadata_agent_config('DEFAULT/admin_tenant_name').with(:value => params[:auth_tenant])
should contain_quantum_metadata_agent_config('DEFAULT/admin_user').with(:value => params[:auth_user])
should contain_quantum_metadata_agent_config('DEFAULT/admin_password').with(:value => params[:auth_password])
should contain_quantum_metadata_agent_config('DEFAULT/nova_metadata_ip').with(:value => params[:metadata_ip])
should contain_quantum_metadata_agent_config('DEFAULT/nova_metadata_port').with(:value => params[:metadata_port])
should contain_quantum_metadata_agent_config('DEFAULT/metadata_proxy_shared_secret').with(:value => params[:shared_secret])
should contain_neutron_metadata_agent_config('DEFAULT/debug').with(:value => params[:debug])
should contain_neutron_metadata_agent_config('DEFAULT/auth_url').with(:value => params[:auth_url])
should contain_neutron_metadata_agent_config('DEFAULT/auth_region').with(:value => params[:auth_region])
should contain_neutron_metadata_agent_config('DEFAULT/admin_tenant_name').with(:value => params[:auth_tenant])
should contain_neutron_metadata_agent_config('DEFAULT/admin_user').with(:value => params[:auth_user])
should contain_neutron_metadata_agent_config('DEFAULT/admin_password').with(:value => params[:auth_password])
should contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_ip').with(:value => params[:metadata_ip])
should contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_port').with(:value => params[:metadata_port])
should contain_neutron_metadata_agent_config('DEFAULT/metadata_proxy_shared_secret').with(:value => params[:shared_secret])
end
end
@ -53,18 +53,18 @@ describe 'quantum::agents::metadata' do
end
let :platform_params do
{ :metadata_agent_package => 'quantum-metadata-agent',
:metadata_agent_service => 'quantum-metadata-agent' }
{ :metadata_agent_package => 'neutron-metadata-agent',
:metadata_agent_service => 'neutron-metadata-agent' }
end
it 'installs quantum metadata agent package' do
should contain_package('quantum-metadata').with(
it 'installs neutron metadata agent package' do
should contain_package('neutron-metadata').with(
:ensure => params[:package_ensure],
:name => platform_params[:metadata_agent_package]
)
end
it_configures 'quantum metadata agent'
it_configures 'neutron metadata agent'
end
@ -74,10 +74,10 @@ describe 'quantum::agents::metadata' do
end
let :platform_params do
{ :metadata_agent_service => 'quantum-metadata-agent' }
{ :metadata_agent_service => 'neutron-metadata-agent' }
end
it_configures 'quantum metadata agent'
it_configures 'neutron metadata agent'
end

View File

@ -1,10 +1,10 @@
require 'spec_helper'
describe 'quantum::agents::ovs' do
describe 'neutron::agents::ovs' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }\n" +
"class { 'quantum::plugins::ovs': network_vlan_ranges => 'test' }"
"class { 'neutron': rabbit_password => 'passw0rd' }\n" +
"class { 'neutron::plugins::ovs': network_vlan_ranges => 'test' }"
end
let :default_params do
@ -17,56 +17,56 @@ describe 'quantum::agents::ovs' do
:local_ip => false,
:tunnel_bridge => 'br-tun',
:polling_interval => 2,
:firewall_driver => 'quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' }
:firewall_driver => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' }
end
let :params do
{}
end
shared_examples_for 'quantum plugin ovs agent' do
shared_examples_for 'neutron plugin ovs agent' do
let :p do
default_params.merge(params)
end
it { should include_class('quantum::params') }
it { should include_class('neutron::params') }
it 'configures ovs_quantum_plugin.ini' do
should contain_quantum_plugin_ovs('AGENT/polling_interval').with_value(p[:polling_interval])
should contain_quantum_plugin_ovs('OVS/integration_bridge').with_value(p[:integration_bridge])
should contain_quantum_plugin_ovs('SECURITYGROUP/firewall_driver').\
it 'configures ovs_neutron_plugin.ini' do
should contain_neutron_plugin_ovs('AGENT/polling_interval').with_value(p[:polling_interval])
should contain_neutron_plugin_ovs('OVS/integration_bridge').with_value(p[:integration_bridge])
should contain_neutron_plugin_ovs('SECURITYGROUP/firewall_driver').\
with_value(p[:firewall_driver])
should contain_quantum_plugin_ovs('OVS/enable_tunneling').with_value(false)
should contain_quantum_plugin_ovs('OVS/tunnel_bridge').with_ensure('absent')
should contain_quantum_plugin_ovs('OVS/local_ip').with_ensure('absent')
should contain_neutron_plugin_ovs('OVS/enable_tunneling').with_value(false)
should contain_neutron_plugin_ovs('OVS/tunnel_bridge').with_ensure('absent')
should contain_neutron_plugin_ovs('OVS/local_ip').with_ensure('absent')
end
it 'configures vs_bridge' do
should contain_vs_bridge(p[:integration_bridge]).with(
:ensure => 'present',
:before => 'Service[quantum-plugin-ovs-service]'
:before => 'Service[neutron-plugin-ovs-service]'
)
should_not contain_vs_brige(p[:integration_bridge])
end
it 'installs quantum ovs agent package' do
it 'installs neutron ovs agent package' do
if platform_params.has_key?(:ovs_agent_package)
should contain_package('quantum-plugin-ovs-agent').with(
should contain_package('neutron-plugin-ovs-agent').with(
:name => platform_params[:ovs_agent_package],
:ensure => p[:package_ensure]
)
should contain_package('quantum-plugin-ovs-agent').with_before(/Quantum_plugin_ovs\[.+\]/)
should contain_package('neutron-plugin-ovs-agent').with_before(/Neutron_plugin_ovs\[.+\]/)
else
should contain_package('quantum-plugin-ovs').with_before(/Quantum_plugin_ovs\[.+\]/)
should contain_package('neutron-plugin-ovs').with_before(/Neutron_plugin_ovs\[.+\]/)
end
end
it 'configures quantum ovs agent service' do
should contain_service('quantum-plugin-ovs-service').with(
it 'configures neutron ovs agent service' do
should contain_service('neutron-plugin-ovs-service').with(
:name => platform_params[:ovs_agent_service],
:enable => true,
:ensure => 'running',
:require => 'Class[Quantum]'
:require => 'Class[Neutron]'
)
end
@ -75,7 +75,7 @@ describe 'quantum::agents::ovs' do
params.merge!(:firewall_driver => false)
end
it 'should configure firewall driver' do
should contain_quantum_plugin_ovs('SECURITYGROUP/firewall_driver').with_ensure('absent')
should contain_neutron_plugin_ovs('SECURITYGROUP/firewall_driver').with_ensure('absent')
end
end
@ -85,18 +85,18 @@ describe 'quantum::agents::ovs' do
end
it 'configures bridge mappings' do
should contain_quantum_plugin_ovs('OVS/bridge_mappings')
should contain_neutron_plugin_ovs('OVS/bridge_mappings')
end
it 'should configure bridge mappings' do
should contain_quantum__plugins__ovs__bridge(params[:bridge_mappings].join(',')).with(
:before => 'Service[quantum-plugin-ovs-service]'
should contain_neutron__plugins__ovs__bridge(params[:bridge_mappings].join(',')).with(
:before => 'Service[neutron-plugin-ovs-service]'
)
end
it 'should configure bridge uplinks' do
should contain_quantum__plugins__ovs__port(params[:bridge_uplinks].join(',')).with(
:before => 'Service[quantum-plugin-ovs-service]'
should contain_neutron__plugins__ovs__port(params[:bridge_uplinks].join(',')).with(
:before => 'Service[neutron-plugin-ovs-service]'
)
end
end
@ -117,12 +117,12 @@ describe 'quantum::agents::ovs' do
params.merge!(:enable_tunneling => true, :local_ip => '127.0.0.1' )
end
it 'should configure ovs for tunneling' do
should contain_quantum_plugin_ovs('OVS/enable_tunneling').with_value(true)
should contain_quantum_plugin_ovs('OVS/tunnel_bridge').with_value(default_params[:tunnel_bridge])
should contain_quantum_plugin_ovs('OVS/local_ip').with_value('127.0.0.1')
should contain_neutron_plugin_ovs('OVS/enable_tunneling').with_value(true)
should contain_neutron_plugin_ovs('OVS/tunnel_bridge').with_value(default_params[:tunnel_bridge])
should contain_neutron_plugin_ovs('OVS/local_ip').with_value('127.0.0.1')
should contain_vs_bridge(default_params[:tunnel_bridge]).with(
:ensure => 'present',
:before => 'Service[quantum-plugin-ovs-service]'
:before => 'Service[neutron-plugin-ovs-service]'
)
end
end
@ -135,11 +135,11 @@ describe 'quantum::agents::ovs' do
end
let :platform_params do
{ :ovs_agent_package => 'quantum-plugin-openvswitch-agent',
:ovs_agent_service => 'quantum-plugin-openvswitch-agent' }
{ :ovs_agent_package => 'neutron-plugin-openvswitch-agent',
:ovs_agent_service => 'neutron-plugin-openvswitch-agent' }
end
it_configures 'quantum plugin ovs agent'
it_configures 'neutron plugin ovs agent'
end
context 'on RedHat platforms' do
@ -148,18 +148,18 @@ describe 'quantum::agents::ovs' do
end
let :platform_params do
{ :ovs_cleanup_service => 'quantum-ovs-cleanup',
:ovs_agent_service => 'quantum-openvswitch-agent' }
{ :ovs_cleanup_service => 'neutron-ovs-cleanup',
:ovs_agent_service => 'neutron-openvswitch-agent' }
end
it_configures 'quantum plugin ovs agent'
it 'configures quantum ovs cleanup service' do
it_configures 'neutron plugin ovs agent'
it 'configures neutron ovs cleanup service' do
should contain_service('ovs-cleanup-service').with(
:name => platform_params[:ovs_cleanup_service],
:enable => true,
:ensure => 'running'
)
should contain_package('quantum-plugin-ovs').with_before(/Service\[ovs-cleanup-service\]/)
should contain_package('neutron-plugin-ovs').with_before(/Service\[ovs-cleanup-service\]/)
end
end

View File

@ -1,13 +1,13 @@
require 'spec_helper'
describe 'quantum::client' do
describe 'neutron::client' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it { should contain_class('quantum::client') }
it { should contain_class('neutron::client') }
end
context 'on RedHat platforms' do
@ -15,6 +15,6 @@ describe 'quantum::client' do
{ :osfamily => 'RedHat' }
end
it { should contain_class('quantum::client') }
it { should contain_class('neutron::client') }
end
end

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe 'quantum::db::mysql' do
describe 'neutron::db::mysql' do
let :pre_condition do
'include mysql::server'
@ -19,7 +19,7 @@ describe 'quantum::db::mysql' do
{ :osfamily => 'Debian' }
end
it { should contain_class('quantum::db::mysql') }
it { should contain_class('neutron::db::mysql') }
end
context 'on RedHat platforms' do
@ -27,56 +27,56 @@ describe 'quantum::db::mysql' do
{ :osfamily => 'RedHat' }
end
it { should contain_class('quantum::db::mysql') }
it { should contain_class('neutron::db::mysql') }
end
describe "overriding allowed_hosts param to array" do
let :params do
{
:password => 'quantumpass',
:password => 'neutronpass',
:allowed_hosts => ['127.0.0.1','%']
}
end
it {should_not contain_quantum__db__mysql__host_access("127.0.0.1").with(
:user => 'quantum',
:password => 'quantumpass',
:database => 'quantum'
it {should_not contain_neutron__db__mysql__host_access("127.0.0.1").with(
:user => 'neutron',
:password => 'neutronpass',
:database => 'neutron'
)}
it {should contain_quantum__db__mysql__host_access("%").with(
:user => 'quantum',
:password => 'quantumpass',
:database => 'quantum'
it {should contain_neutron__db__mysql__host_access("%").with(
:user => 'neutron',
:password => 'neutronpass',
:database => 'neutron'
)}
end
describe "overriding allowed_hosts param to string" do
let :params do
{
:password => 'quantumpass2',
:password => 'neutronpass2',
:allowed_hosts => '192.168.1.1'
}
end
it {should contain_quantum__db__mysql__host_access("192.168.1.1").with(
:user => 'quantum',
:password => 'quantumpass2',
:database => 'quantum'
it {should contain_neutron__db__mysql__host_access("192.168.1.1").with(
:user => 'neutron',
:password => 'neutronpass2',
:database => 'neutron'
)}
end
describe "overriding allowed_hosts param equals to host param " do
let :params do
{
:password => 'quantumpass2',
:password => 'neutronpass2',
:allowed_hosts => '127.0.0.1'
}
end
it {should_not contain_quantum__db__mysql__host_access("127.0.0.1").with(
:user => 'quantum',
:password => 'quantumpass2',
:database => 'quantum'
it {should_not contain_neutron__db__mysql__host_access("127.0.0.1").with(
:user => 'neutron',
:password => 'neutronpass2',
:database => 'neutron'
)}
end
end

View File

@ -0,0 +1,139 @@
require 'spec_helper'
describe 'neutron' do
let :params do
{ :package_ensure => 'present',
:verbose => false,
:debug => false,
:core_plugin => 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2',
:rabbit_host => '127.0.0.1',
:rabbit_port => 5672,
:rabbit_hosts => false,
:rabbit_user => 'guest',
:rabbit_password => 'guest',
:rabbit_virtual_host => '/'
}
end
shared_examples_for 'neutron' do
context 'and if rabbit_host parameter is provided' do
it_configures 'a neutron base installation'
end
context 'and if rabbit_hosts parameter is provided' do
before do
params.delete(:rabbit_host)
params.delete(:rabbit_port)
end
context 'with one server' do
before { params.merge!( :rabbit_hosts => ['127.0.0.1:5672'] ) }
it_configures 'a neutron base installation'
it_configures 'rabbit HA with a single virtual host'
end
context 'with multiple servers' do
before { params.merge!( :rabbit_hosts => ['rabbit1:5672', 'rabbit2:5672'] ) }
it_configures 'a neutron base installation'
it_configures 'rabbit HA with multiple hosts'
end
end
end
shared_examples_for 'a neutron base installation' do
it { should include_class('neutron::params') }
it 'configures neutron configuration folder' do
should contain_file('/etc/neutron/').with(
:ensure => 'directory',
:owner => 'root',
:group => 'neutron',
:mode => '0750',
:require => 'Package[neutron]'
)
end
it 'configures neutron configuration file' do
should contain_file('/etc/neutron/neutron.conf').with(
:owner => 'root',
:group => 'neutron',
:mode => '0640',
:require => 'Package[neutron]'
)
end
it 'installs neutron package' do
should contain_package('neutron').with(
:ensure => 'present',
:name => platform_params[:common_package_name]
)
end
it 'configures credentials for rabbit' do
should contain_neutron_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_user] )
should contain_neutron_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
should contain_neutron_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
end
it 'configures neutron.conf' do
should contain_neutron_config('DEFAULT/verbose').with_value( params[:verbose] )
should contain_neutron_config('DEFAULT/bind_host').with_value('0.0.0.0')
should contain_neutron_config('DEFAULT/bind_port').with_value('9696')
should contain_neutron_config('DEFAULT/auth_strategy').with_value('keystone')
should contain_neutron_config('DEFAULT/core_plugin').with_value( params[:core_plugin] )
should contain_neutron_config('DEFAULT/base_mac').with_value('fa:16:3e:00:00:00')
should contain_neutron_config('DEFAULT/mac_generation_retries').with_value(16)
should contain_neutron_config('DEFAULT/dhcp_lease_duration').with_value(120)
should contain_neutron_config('DEFAULT/allow_bulk').with_value(true)
should contain_neutron_config('DEFAULT/allow_overlapping_ips').with_value(false)
should contain_neutron_config('DEFAULT/control_exchange').with_value('neutron')
should contain_neutron_config('AGENT/root_helper').with_value('sudo neutron-rootwrap /etc/neutron/rootwrap.conf')
end
end
shared_examples_for 'rabbit HA with a single virtual host' do
it 'in neutron.conf' do
should_not contain_neutron_config('DEFAULT/rabbit_host')
should_not contain_neutron_config('DEFAULT/rabbit_port')
should contain_neutron_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts] )
should contain_neutron_config('DEFAULT/rabbit_ha_queues').with_value(true)
end
end
shared_examples_for 'rabbit HA with multiple hosts' do
it 'in neutron.conf' do
should_not contain_neutron_config('DEFAULT/rabbit_host')
should_not contain_neutron_config('DEFAULT/rabbit_port')
should contain_neutron_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') )
should contain_neutron_config('DEFAULT/rabbit_ha_queues').with_value(true)
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
let :platform_params do
{ :common_package_name => 'neutron-common' }
end
it_configures 'neutron'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
let :platform_params do
{ :common_package_name => 'openstack-neutron' }
end
it_configures 'neutron'
end
end

View File

@ -1,33 +1,33 @@
require 'spec_helper'
describe 'quantum::keystone::auth' do
describe 'neutron::keystone::auth' do
describe 'with default class parameters' do
let :params do
{
:password => 'quantum_password',
:password => 'neutron_password',
:tenant => 'foobar'
}
end
it { should contain_keystone_user('quantum').with(
it { should contain_keystone_user('neutron').with(
:ensure => 'present',
:password => 'quantum_password',
:password => 'neutron_password',
:tenant => 'foobar'
) }
it { should contain_keystone_user_role('quantum@foobar').with(
it { should contain_keystone_user_role('neutron@foobar').with(
:ensure => 'present',
:roles => 'admin'
)}
it { should contain_keystone_service('quantum').with(
it { should contain_keystone_service('neutron').with(
:ensure => 'present',
:type => 'network',
:description => 'Quantum Networking Service'
:description => 'Neutron Networking Service'
) }
it { should contain_keystone_endpoint('RegionOne/quantum').with(
it { should contain_keystone_endpoint('RegionOne/neutron').with(
:ensure => 'present',
:public_url => "http://127.0.0.1:9696/",
:admin_url => "http://127.0.0.1:9696/",
@ -40,7 +40,7 @@ describe 'quantum::keystone::auth' do
let :params do
{
:password => 'quantum_password',
:password => 'neutron_password',
:public_protocol => 'https',
:public_port => '80',
:public_address => '10.10.10.10',
@ -50,7 +50,7 @@ describe 'quantum::keystone::auth' do
}
end
it { should contain_keystone_endpoint('RegionOne/quantum').with(
it { should contain_keystone_endpoint('RegionOne/neutron').with(
:ensure => 'present',
:public_url => "https://10.10.10.10:80/",
:internal_url => "http://10.10.10.11:81/",
@ -64,17 +64,17 @@ describe 'quantum::keystone::auth' do
let :params do
{
:password => 'foo',
:auth_name => 'quantumy'
:auth_name => 'neutrony'
}
end
it { should contain_keystone_user('quantumy') }
it { should contain_keystone_user('neutrony') }
it { should contain_keystone_user_role('quantumy@services') }
it { should contain_keystone_user_role('neutrony@services') }
it { should contain_keystone_service('quantumy') }
it { should contain_keystone_service('neutrony') }
it { should contain_keystone_endpoint('RegionOne/quantumy') }
it { should contain_keystone_endpoint('RegionOne/neutrony') }
end

View File

@ -1,34 +1,34 @@
require 'spec_helper'
describe 'quantum::plugins::cisco' do
describe 'neutron::plugins::cisco' do
let :pre_condition do
"class { 'quantum::server': auth_password => 'password'}"
"class { 'neutron::server': auth_password => 'password'}"
end
let :params do
{ :keystone_username => 'quantum',
:keystone_password => 'quantum_pass',
{ :keystone_username => 'neutron',
:keystone_password => 'neutron_pass',
:keystone_auth_url => 'http://127.0.0.1:35357/v2.0/',
:keystone_tenant => 'tenant',
:database_name => 'quantum',
:database_name => 'neutron',
:database_pass => 'dbpass',
:database_host => 'localhost',
:database_user => 'quantum'}
:database_user => 'neutron'}
end
let :params_default do
{
:vswitch_plugin => 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2',
:vswitch_plugin => 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
:vlan_start => '100',
:vlan_end => '3000',
:vlan_name_prefix => 'q-',
:model_class => 'quantum.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2',
:model_class => 'neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2',
:max_ports => '100',
:max_port_profiles => '65568',
:max_networks => '65568',
:manager_class => 'quantum.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr'
:manager_class => 'neutron.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr'
}
end
@ -39,82 +39,82 @@ describe 'quantum::plugins::cisco' do
end
it 'should have a plugin config folder' do
should contain_file('/etc/quantum/plugins').with(
should contain_file('/etc/neutron/plugins').with(
:ensure => 'directory',
:owner => 'root',
:group => 'quantum',
:group => 'neutron',
:mode => '0640'
)
end
it 'should have a cisco plugin config folder' do
should contain_file('/etc/quantum/plugins/cisco').with(
should contain_file('/etc/neutron/plugins/cisco').with(
:ensure => 'directory',
:owner => 'root',
:group => 'quantum',
:group => 'neutron',
:mode => '0640'
)
end
it 'should perform default l2 configuration' do
should contain_quantum_plugin_cisco_l2network('VLANS/vlan_start').\
should contain_neutron_plugin_cisco_l2network('VLANS/vlan_start').\
with_value(params[:vlan_start])
should contain_quantum_plugin_cisco_l2network('VLANS/vlan_end').\
should contain_neutron_plugin_cisco_l2network('VLANS/vlan_end').\
with_value(params[:vlan_end])
should contain_quantum_plugin_cisco_l2network('VLANS/vlan_name_prefix').\
should contain_neutron_plugin_cisco_l2network('VLANS/vlan_name_prefix').\
with_value(params[:vlan_name_prefix])
should contain_quantum_plugin_cisco_l2network('MODEL/model_class').\
should contain_neutron_plugin_cisco_l2network('MODEL/model_class').\
with_value(params[:model_class])
should contain_quantum_plugin_cisco_l2network('PORTS/max_ports').\
should contain_neutron_plugin_cisco_l2network('PORTS/max_ports').\
with_value(params[:max_ports])
should contain_quantum_plugin_cisco_l2network('PORTPROFILES/max_port_profiles').\
should contain_neutron_plugin_cisco_l2network('PORTPROFILES/max_port_profiles').\
with_value(params[:max_port_profiles])
should contain_quantum_plugin_cisco_l2network('NETWORKS/max_networks').\
should contain_neutron_plugin_cisco_l2network('NETWORKS/max_networks').\
with_value(params[:max_networks])
should contain_quantum_plugin_cisco_l2network('SEGMENTATION/manager_class').\
should contain_neutron_plugin_cisco_l2network('SEGMENTATION/manager_class').\
with_value(params[:manager_class])
end
it 'should create a dummy inventory item' do
should contain_quantum_plugin_cisco('INVENTORY/dummy').\
should contain_neutron_plugin_cisco('INVENTORY/dummy').\
with_value('dummy')
end
it 'should configure the db connection' do
should contain_quantum_plugin_cisco_db_conn('DATABASE/name').\
should contain_neutron_plugin_cisco_db_conn('DATABASE/name').\
with_value(params[:database_name])
should contain_quantum_plugin_cisco_db_conn('DATABASE/user').\
should contain_neutron_plugin_cisco_db_conn('DATABASE/user').\
with_value(params[:database_user])
should contain_quantum_plugin_cisco_db_conn('DATABASE/pass').\
should contain_neutron_plugin_cisco_db_conn('DATABASE/pass').\
with_value(params[:database_pass])
should contain_quantum_plugin_cisco_db_conn('DATABASE/host').\
should contain_neutron_plugin_cisco_db_conn('DATABASE/host').\
with_value(params[:database_host])
end
it 'should configure the admin credentials' do
should contain_quantum_plugin_cisco_credentials('keystone/username').\
should contain_neutron_plugin_cisco_credentials('keystone/username').\
with_value(params[:keystone_username])
should contain_quantum_plugin_cisco_credentials('keystone/password').\
should contain_neutron_plugin_cisco_credentials('keystone/password').\
with_value(params[:keystone_password])
should contain_quantum_plugin_cisco_credentials('keystone/auth_url').\
should contain_neutron_plugin_cisco_credentials('keystone/auth_url').\
with_value(params[:keystone_auth_url])
should contain_quantum_plugin_cisco_credentials('keystone/tenant').\
should contain_neutron_plugin_cisco_credentials('keystone/tenant').\
with_value(params[:keystone_tenant])
end
it 'should perform vswitch plugin configuration' do
should contain_quantum_plugin_cisco('PLUGINS/vswitch_plugin').\
with_value('quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2')
should contain_neutron_plugin_cisco('PLUGINS/vswitch_plugin').\
with_value('neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2')
end
describe 'with nexus plugin' do
before do
params.merge!(:nexus_plugin => 'quantum.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin')
params.merge!(:nexus_plugin => 'neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin')
end
it 'should perform nexus plugin configuration' do
should contain_quantum_plugin_cisco('PLUGINS/nexus_plugin').\
with_value('quantum.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin')
should contain_neutron_plugin_cisco('PLUGINS/nexus_plugin').\
with_value('neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin')
end
end

View File

@ -1,9 +1,9 @@
require 'spec_helper'
describe 'quantum::plugins::linuxbridge' do
describe 'neutron::plugins::linuxbridge' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }"
"class { 'neutron': rabbit_password => 'passw0rd' }"
end
let :params do
@ -14,25 +14,25 @@ describe 'quantum::plugins::linuxbridge' do
}
end
shared_examples_for 'quantum linuxbridge plugin' do
shared_examples_for 'neutron linuxbridge plugin' do
it { should include_class('quantum::params') }
it { should include_class('neutron::params') }
it 'installs quantum linuxbridge plugin package' do
should contain_package('quantum-plugin-linuxbridge').with(
it 'installs neutron linuxbridge plugin package' do
should contain_package('neutron-plugin-linuxbridge').with(
:ensure => params[:package_ensure],
:name => platform_params[:linuxbridge_plugin_package]
)
end
it 'configures linuxbridge_conf.ini' do
should contain_quantum_plugin_linuxbridge('DATABASE/sql_connection').with(
should contain_neutron_plugin_linuxbridge('DATABASE/sql_connection').with(
:value => params[:sql_connection]
)
should contain_quantum_plugin_linuxbridge('VLANS/tenant_network_type').with(
should contain_neutron_plugin_linuxbridge('VLANS/tenant_network_type').with(
:value => params[:tenant_network_type]
)
should contain_quantum_plugin_linuxbridge('VLANS/network_vlan_ranges').with(
should contain_neutron_plugin_linuxbridge('VLANS/network_vlan_ranges').with(
:value => params[:network_vlan_ranges]
)
end
@ -45,13 +45,13 @@ describe 'quantum::plugins::linuxbridge' do
end
let :platform_params do
{ :linuxbridge_plugin_package => 'quantum-plugin-linuxbridge' }
{ :linuxbridge_plugin_package => 'neutron-plugin-linuxbridge' }
end
it_configures 'quantum linuxbridge plugin'
it 'configures /etc/default/quantum-server' do
should contain_file_line('/etc/default/quantum-server:QUANTUM_PLUGIN_CONFIG').with(
:line => 'QUANTUM_PLUGIN_CONFIG=/etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini'
it_configures 'neutron linuxbridge plugin'
it 'configures /etc/default/neutron-server' do
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini'
)
end
end
@ -62,9 +62,9 @@ describe 'quantum::plugins::linuxbridge' do
end
let :platform_params do
{ :linuxbridge_plugin_package => 'openstack-quantum-linuxbridge' }
{ :linuxbridge_plugin_package => 'openstack-neutron-linuxbridge' }
end
it_configures 'quantum linuxbridge plugin'
it_configures 'neutron linuxbridge plugin'
end
end

View File

@ -1,15 +1,15 @@
require 'spec_helper'
describe 'quantum::plugins::ovs' do
describe 'neutron::plugins::ovs' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }"
"class { 'neutron': rabbit_password => 'passw0rd' }"
end
let :default_params do
{
:package_ensure => 'present',
:sql_connection => 'sqlite:////var/lib/quantum/ovs.sqlite',
:sql_connection => 'sqlite:////var/lib/neutron/ovs.sqlite',
:sql_max_retries => 10,
:sql_idle_timeout => '3600',
:reconnect_interval => 2,
@ -22,7 +22,7 @@ describe 'quantum::plugins::ovs' do
{ }
end
shared_examples_for 'quantum ovs plugin' do
shared_examples_for 'neutron ovs plugin' do
before do
params.merge!(default_params)
end
@ -32,12 +32,12 @@ describe 'quantum::plugins::ovs' do
end
it 'should perform default configuration of' do
should contain_quantum_plugin_ovs('DATABASE/sql_connection').with_value(params[:sql_connection])
should contain_quantum_plugin_ovs('DATABASE/sql_max_retries').with_value(params[:sql_max_retries])
should contain_quantum_plugin_ovs('DATABASE/sql_idle_timeout').with_value(params[:sql_idle_timeout])
should contain_quantum_plugin_ovs('DATABASE/reconnect_interval').with_value(params[:reconnect_interval])
should contain_quantum_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
should contain_package('quantum-plugin-ovs').with(
should contain_neutron_plugin_ovs('DATABASE/sql_connection').with_value(params[:sql_connection])
should contain_neutron_plugin_ovs('DATABASE/sql_max_retries').with_value(params[:sql_max_retries])
should contain_neutron_plugin_ovs('DATABASE/sql_idle_timeout').with_value(params[:sql_idle_timeout])
should contain_neutron_plugin_ovs('DATABASE/reconnect_interval').with_value(params[:reconnect_interval])
should contain_neutron_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
should contain_package('neutron-plugin-ovs').with(
:name => platform_params[:ovs_server_package],
:ensure => params[:package_ensure]
)
@ -49,8 +49,8 @@ describe 'quantum::plugins::ovs' do
end
it 'should perform vlan network configuration' do
should contain_quantum_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
should contain_quantum_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges])
should contain_neutron_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
should contain_neutron_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges])
end
end
@ -64,8 +64,8 @@ describe 'quantum::plugins::ovs' do
end
it 'should perform gre network configuration' do
should contain_quantum_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
should contain_quantum_plugin_ovs('OVS/tunnel_id_ranges').with_value(params[:tunnel_id_ranges])
should contain_neutron_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
should contain_neutron_plugin_ovs('OVS/tunnel_id_ranges').with_value(params[:tunnel_id_ranges])
end
end
@ -77,9 +77,9 @@ describe 'quantum::plugins::ovs' do
end
it 'should perform gre network configuration' do
should contain_quantum_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges])
should contain_quantum_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
should contain_quantum_plugin_ovs('OVS/tunnel_id_ranges').with_value(params[:tunnel_id_ranges])
should contain_neutron_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges])
should contain_neutron_plugin_ovs('OVS/tenant_network_type').with_value(params[:tenant_network_type])
should contain_neutron_plugin_ovs('OVS/tunnel_id_ranges').with_value(params[:tunnel_id_ranges])
end
end
@ -87,7 +87,7 @@ describe 'quantum::plugins::ovs' do
let :params do
{ :tenant_network_type => 'flat'}
end
it { should contain_quantum_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges]) }
it { should contain_neutron_plugin_ovs('OVS/network_vlan_ranges').with_value(params[:network_vlan_ranges]) }
end
end
@ -97,10 +97,10 @@ describe 'quantum::plugins::ovs' do
end
let :platform_params do
{ :ovs_server_package => 'quantum-plugin-openvswitch' }
{ :ovs_server_package => 'neutron-plugin-openvswitch' }
end
it_configures 'quantum ovs plugin'
it_configures 'neutron ovs plugin'
end
context 'on RedHat platforms' do
@ -113,17 +113,17 @@ describe 'quantum::plugins::ovs' do
end
let :platform_params do
{ :ovs_server_package => 'openstack-quantum-openvswitch' }
{ :ovs_server_package => 'openstack-neutron-openvswitch' }
end
it 'should perform redhat specific configuration' do
should contain_file('/etc/quantum/plugin.ini').with(
should contain_file('/etc/neutron/plugin.ini').with(
:ensure => 'link',
:target => '/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini',
:require => 'Package[quantum-plugin-ovs]'
:target => '/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini',
:require => 'Package[neutron-plugin-ovs]'
)
end
it_configures 'quantum ovs plugin'
it_configures 'neutron ovs plugin'
end
end

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe 'quantum::quota' do
describe 'neutron::quota' do
let :params do
{}
@ -15,26 +15,26 @@ describe 'quantum::quota' do
:quota_floatingip => 50,
:quota_security_group => 10,
:quota_security_group_rule => 100,
:quota_driver => 'quantum.quota.ConfDriver',
:quota_driver => 'neutron.quota.ConfDriver',
:quota_firewall => 1,
:quota_firewall_policy => 1,
:quota_firewall_rule => -1 }
end
shared_examples_for 'quantum quota' do
shared_examples_for 'neutron quota' do
let :params_hash do
default_params.merge(params)
end
it 'configures quota in quantum.conf' do
it 'configures quota in neutron.conf' do
params_hash.each_pair do |config,value|
should contain_quantum_config("QUOTAS/#{config}").with_value( value )
should contain_neutron_config("QUOTAS/#{config}").with_value( value )
end
end
end
context 'with default parameters' do
it_configures 'quantum quota'
it_configures 'neutron quota'
end
context 'with provided parameters' do
@ -53,6 +53,6 @@ describe 'quantum::quota' do
})
end
it_configures 'quantum quota'
it_configures 'neutron quota'
end
end

View File

@ -0,0 +1,158 @@
require 'spec_helper'
describe 'neutron::server' do
let :pre_condition do
"class { 'neutron': rabbit_password => 'passw0rd' }"
end
let :params do
{ :auth_password => 'passw0rd',
:auth_user => 'neutron' }
end
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:log_dir => '/var/log/neutron',
:auth_type => 'keystone',
:auth_host => 'localhost',
:auth_port => '35357',
:auth_tenant => 'services',
:auth_user => 'neutron' }
end
shared_examples_for 'a neutron server' do
let :p do
default_params.merge(params)
end
it { should include_class('neutron::params') }
it 'configures logging' do
should contain_neutron_config('DEFAULT/log_file').with_ensure('absent')
should contain_neutron_config('DEFAULT/log_dir').with_value(p[:log_dir])
end
it 'configures authentication middleware' do
should contain_neutron_api_config('filter:authtoken/auth_host').with_value(p[:auth_host]);
should contain_neutron_api_config('filter:authtoken/auth_port').with_value(p[:auth_port]);
should contain_neutron_api_config('filter:authtoken/admin_tenant_name').with_value(p[:auth_tenant]);
should contain_neutron_api_config('filter:authtoken/admin_user').with_value(p[:auth_user]);
should contain_neutron_api_config('filter:authtoken/admin_password').with_value(p[:auth_password]);
should contain_neutron_api_config('filter:authtoken/auth_admin_prefix').with(:ensure => 'absent')
end
it 'installs neutron server package' do
if platform_params.has_key?(:server_package)
should contain_package('neutron-server').with(
:name => platform_params[:server_package],
:ensure => p[:package_ensure]
)
should contain_package('neutron-server').with_before(/Neutron_api_config\[.+\]/)
should contain_package('neutron-server').with_before(/Neutron_config\[.+\]/)
should contain_package('neutron-server').with_before(/Service\[neutron-server\]/)
else
should contain_package('neutron').with_before(/Neutron_api_config\[.+\]/)
end
end
it 'configures neutron server service' do
should contain_service('neutron-server').with(
:name => platform_params[:server_service],
:enable => true,
:ensure => 'running',
:require => 'Class[Neutron]'
)
should contain_neutron_api_config('filter:authtoken/auth_admin_prefix').with(
:ensure => 'absent'
)
end
end
shared_examples_for 'a neutron server with auth_admin_prefix set' do
[ '/keystone', '/keystone/admin', '' ].each do |auth_admin_prefix|
describe "with keystone_auth_admin_prefix containing incorrect value #{auth_admin_prefix}" do
before do
params.merge!({
:auth_admin_prefix => auth_admin_prefix,
})
end
it do
should contain_neutron_api_config('filter:authtoken/auth_admin_prefix').with(
:value => params[:auth_admin_prefix]
)
end
end
end
end
shared_examples_for 'a neutron server with some incorrect auth_admin_prefix set' do
[ '/keystone/', 'keystone/', 'keystone' ].each do |auth_admin_prefix|
describe "with keystone_auth_admin_prefix containing incorrect value #{auth_admin_prefix}" do
before do
params.merge!({
:auth_admin_prefix => auth_admin_prefix,
})
end
it do
expect {
should contain_neutron_api_config('filter:authtoken/auth_admin_prefix')
}.to raise_error(Puppet::Error, /validate_re\(\): "#{auth_admin_prefix}" does not match/)
end
end
end
end
shared_examples_for 'a neutron server with broken authentication' do
before do
params.delete(:auth_password)
end
it_raises 'a Puppet::Error', /auth_password must be set/
end
shared_examples_for 'a neutron server with log_file specified' do
before do
params.merge!(
:log_file => '/var/log/neutron/server.log'
)
end
it 'configures logging' do
should contain_neutron_config('DEFAULT/log_file').with_value(params[:log_file])
should contain_neutron_config('DEFAULT/log_dir').with_ensure('absent')
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
let :platform_params do
{ :server_package => 'neutron-server',
:server_service => 'neutron-server' }
end
it_configures 'a neutron server'
it_configures 'a neutron server with broken authentication'
it_configures 'a neutron server with log_file specified'
it_configures 'a neutron server with auth_admin_prefix set'
it_configures 'a neutron server with some incorrect auth_admin_prefix set'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
let :platform_params do
{ :server_service => 'neutron-server' }
end
it_configures 'a neutron server'
it_configures 'a neutron server with broken authentication'
it_configures 'a neutron server with log_file specified'
it_configures 'a neutron server with auth_admin_prefix set'
it_configures 'a neutron server with some incorrect auth_admin_prefix set'
end
end

View File

@ -1,108 +0,0 @@
require 'spec_helper'
describe 'quantum::agents::dhcp' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }"
end
let :params do
{}
end
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:debug => false,
:state_path => '/var/lib/quantum',
:resync_interval => 30,
:interface_driver => 'quantum.agent.linux.interface.OVSInterfaceDriver',
:dhcp_driver => 'quantum.agent.linux.dhcp.Dnsmasq',
:root_helper => 'sudo quantum-rootwrap /etc/quantum/rootwrap.conf',
:use_namespaces => true }
end
shared_examples_for 'quantum dhcp agent' do
let :p do
default_params.merge(params)
end
it { should include_class('quantum::params') }
it_configures 'dnsmasq dhcp_driver'
it 'configures dhcp_agent.ini' do
should contain_quantum_dhcp_agent_config('DEFAULT/debug').with_value(p[:debug]);
should contain_quantum_dhcp_agent_config('DEFAULT/state_path').with_value(p[:state_path]);
should contain_quantum_dhcp_agent_config('DEFAULT/resync_interval').with_value(p[:resync_interval]);
should contain_quantum_dhcp_agent_config('DEFAULT/interface_driver').with_value(p[:interface_driver]);
should contain_quantum_dhcp_agent_config('DEFAULT/dhcp_driver').with_value(p[:dhcp_driver]);
should contain_quantum_dhcp_agent_config('DEFAULT/root_helper').with_value(p[:root_helper]);
should contain_quantum_dhcp_agent_config('DEFAULT/use_namespaces').with_value(p[:use_namespaces]);
end
it 'installs quantum dhcp agent package' do
if platform_params.has_key?(:dhcp_agent_package)
should contain_package('quantum-dhcp-agent').with(
:name => platform_params[:dhcp_agent_package],
:ensure => p[:package_ensure]
)
should contain_package('quantum').with_before(/Package\[quantum-dhcp-agent\]/)
should contain_package('quantum-dhcp-agent').with_before(/Quantum_dhcp_agent_config\[.+\]/)
should contain_package('quantum-dhcp-agent').with_before(/Quantum_config\[.+\]/)
else
should contain_package('quantum').with_before(/Quantum_dhcp_agent_config\[.+\]/)
end
end
it 'configures quantum dhcp agent service' do
should contain_service('quantum-dhcp-service').with(
:name => platform_params[:dhcp_agent_service],
:enable => true,
:ensure => 'running',
:require => 'Class[Quantum]'
)
end
end
shared_examples_for 'dnsmasq dhcp_driver' do
it 'installs dnsmasq packages' do
if platform_params.has_key?(:dhcp_agent_package)
should contain_package('dnsmasq').with_before('Package[quantum-dhcp-agent]')
end
should contain_package('dnsmasq').with(
:ensure => 'present',
:name => platform_params[:dnsmasq_packages]
)
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
let :platform_params do
{ :dnsmasq_packages => ['dnsmasq-base', 'dnsmasq-utils'],
:dhcp_agent_package => 'quantum-dhcp-agent',
:dhcp_agent_service => 'quantum-dhcp-agent' }
end
it_configures 'quantum dhcp agent'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
let :platform_params do
{ :dnsmasq_packages => ['dnsmasq', 'dnsmasq-utils'],
:dhcp_agent_service => 'quantum-dhcp-agent' }
end
it_configures 'quantum dhcp agent'
end
end

View File

@ -1,139 +0,0 @@
require 'spec_helper'
describe 'quantum' do
let :params do
{ :package_ensure => 'present',
:verbose => false,
:debug => false,
:core_plugin => 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2',
:rabbit_host => '127.0.0.1',
:rabbit_port => 5672,
:rabbit_hosts => false,
:rabbit_user => 'guest',
:rabbit_password => 'guest',
:rabbit_virtual_host => '/'
}
end
shared_examples_for 'quantum' do
context 'and if rabbit_host parameter is provided' do
it_configures 'a quantum base installation'
end
context 'and if rabbit_hosts parameter is provided' do
before do
params.delete(:rabbit_host)
params.delete(:rabbit_port)
end
context 'with one server' do
before { params.merge!( :rabbit_hosts => ['127.0.0.1:5672'] ) }
it_configures 'a quantum base installation'
it_configures 'rabbit HA with a single virtual host'
end
context 'with multiple servers' do
before { params.merge!( :rabbit_hosts => ['rabbit1:5672', 'rabbit2:5672'] ) }
it_configures 'a quantum base installation'
it_configures 'rabbit HA with multiple hosts'
end
end
end
shared_examples_for 'a quantum base installation' do
it { should include_class('quantum::params') }
it 'configures quantum configuration folder' do
should contain_file('/etc/quantum/').with(
:ensure => 'directory',
:owner => 'root',
:group => 'quantum',
:mode => '0750',
:require => 'Package[quantum]'
)
end
it 'configures quantum configuration file' do
should contain_file('/etc/quantum/quantum.conf').with(
:owner => 'root',
:group => 'quantum',
:mode => '0640',
:require => 'Package[quantum]'
)
end
it 'installs quantum package' do
should contain_package('quantum').with(
:ensure => 'present',
:name => platform_params[:common_package_name]
)
end
it 'configures credentials for rabbit' do
should contain_quantum_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_user] )
should contain_quantum_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
should contain_quantum_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
end
it 'configures quantum.conf' do
should contain_quantum_config('DEFAULT/verbose').with_value( params[:verbose] )
should contain_quantum_config('DEFAULT/bind_host').with_value('0.0.0.0')
should contain_quantum_config('DEFAULT/bind_port').with_value('9696')
should contain_quantum_config('DEFAULT/auth_strategy').with_value('keystone')
should contain_quantum_config('DEFAULT/core_plugin').with_value( params[:core_plugin] )
should contain_quantum_config('DEFAULT/base_mac').with_value('fa:16:3e:00:00:00')
should contain_quantum_config('DEFAULT/mac_generation_retries').with_value(16)
should contain_quantum_config('DEFAULT/dhcp_lease_duration').with_value(120)
should contain_quantum_config('DEFAULT/allow_bulk').with_value(true)
should contain_quantum_config('DEFAULT/allow_overlapping_ips').with_value(false)
should contain_quantum_config('DEFAULT/control_exchange').with_value('quantum')
should contain_quantum_config('AGENT/root_helper').with_value('sudo quantum-rootwrap /etc/quantum/rootwrap.conf')
end
end
shared_examples_for 'rabbit HA with a single virtual host' do
it 'in quantum.conf' do
should_not contain_quantum_config('DEFAULT/rabbit_host')
should_not contain_quantum_config('DEFAULT/rabbit_port')
should contain_quantum_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts] )
should contain_quantum_config('DEFAULT/rabbit_ha_queues').with_value(true)
end
end
shared_examples_for 'rabbit HA with multiple hosts' do
it 'in quantum.conf' do
should_not contain_quantum_config('DEFAULT/rabbit_host')
should_not contain_quantum_config('DEFAULT/rabbit_port')
should contain_quantum_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') )
should contain_quantum_config('DEFAULT/rabbit_ha_queues').with_value(true)
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
let :platform_params do
{ :common_package_name => 'quantum-common' }
end
it_configures 'quantum'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
let :platform_params do
{ :common_package_name => 'openstack-quantum' }
end
it_configures 'quantum'
end
end

View File

@ -1,158 +0,0 @@
require 'spec_helper'
describe 'quantum::server' do
let :pre_condition do
"class { 'quantum': rabbit_password => 'passw0rd' }"
end
let :params do
{ :auth_password => 'passw0rd',
:auth_user => 'quantum' }
end
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:log_dir => '/var/log/quantum',
:auth_type => 'keystone',
:auth_host => 'localhost',
:auth_port => '35357',
:auth_tenant => 'services',
:auth_user => 'quantum' }
end
shared_examples_for 'a quantum server' do
let :p do
default_params.merge(params)
end
it { should include_class('quantum::params') }
it 'configures logging' do
should contain_quantum_config('DEFAULT/log_file').with_ensure('absent')
should contain_quantum_config('DEFAULT/log_dir').with_value(p[:log_dir])
end
it 'configures authentication middleware' do
should contain_quantum_api_config('filter:authtoken/auth_host').with_value(p[:auth_host]);
should contain_quantum_api_config('filter:authtoken/auth_port').with_value(p[:auth_port]);
should contain_quantum_api_config('filter:authtoken/admin_tenant_name').with_value(p[:auth_tenant]);
should contain_quantum_api_config('filter:authtoken/admin_user').with_value(p[:auth_user]);
should contain_quantum_api_config('filter:authtoken/admin_password').with_value(p[:auth_password]);
should contain_quantum_api_config('filter:authtoken/auth_admin_prefix').with(:ensure => 'absent')
end
it 'installs quantum server package' do
if platform_params.has_key?(:server_package)
should contain_package('quantum-server').with(
:name => platform_params[:server_package],
:ensure => p[:package_ensure]
)
should contain_package('quantum-server').with_before(/Quantum_api_config\[.+\]/)
should contain_package('quantum-server').with_before(/Quantum_config\[.+\]/)
should contain_package('quantum-server').with_before(/Service\[quantum-server\]/)
else
should contain_package('quantum').with_before(/Quantum_api_config\[.+\]/)
end
end
it 'configures quantum server service' do
should contain_service('quantum-server').with(
:name => platform_params[:server_service],
:enable => true,
:ensure => 'running',
:require => 'Class[Quantum]'
)
should contain_quantum_api_config('filter:authtoken/auth_admin_prefix').with(
:ensure => 'absent'
)
end
end
shared_examples_for 'a quantum server with auth_admin_prefix set' do
[ '/keystone', '/keystone/admin', '' ].each do |auth_admin_prefix|
describe "with keystone_auth_admin_prefix containing incorrect value #{auth_admin_prefix}" do
before do
params.merge!({
:auth_admin_prefix => auth_admin_prefix,
})
end
it do
should contain_quantum_api_config('filter:authtoken/auth_admin_prefix').with(
:value => params[:auth_admin_prefix]
)
end
end
end
end
shared_examples_for 'a quantum server with some incorrect auth_admin_prefix set' do
[ '/keystone/', 'keystone/', 'keystone' ].each do |auth_admin_prefix|
describe "with keystone_auth_admin_prefix containing incorrect value #{auth_admin_prefix}" do
before do
params.merge!({
:auth_admin_prefix => auth_admin_prefix,
})
end
it do
expect {
should contain_quantum_api_config('filter:authtoken/auth_admin_prefix')
}.to raise_error(Puppet::Error, /validate_re\(\): "#{auth_admin_prefix}" does not match/)
end
end
end
end
shared_examples_for 'a quantum server with broken authentication' do
before do
params.delete(:auth_password)
end
it_raises 'a Puppet::Error', /auth_password must be set/
end
shared_examples_for 'a quantum server with log_file specified' do
before do
params.merge!(
:log_file => '/var/log/quantum/server.log'
)
end
it 'configures logging' do
should contain_quantum_config('DEFAULT/log_file').with_value(params[:log_file])
should contain_quantum_config('DEFAULT/log_dir').with_ensure('absent')
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
let :platform_params do
{ :server_package => 'quantum-server',
:server_service => 'quantum-server' }
end
it_configures 'a quantum server'
it_configures 'a quantum server with broken authentication'
it_configures 'a quantum server with log_file specified'
it_configures 'a quantum server with auth_admin_prefix set'
it_configures 'a quantum server with some incorrect auth_admin_prefix set'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
let :platform_params do
{ :server_service => 'quantum-server' }
end
it_configures 'a quantum server'
it_configures 'a quantum server with broken authentication'
it_configures 'a quantum server with log_file specified'
it_configures 'a quantum server with auth_admin_prefix set'
it_configures 'a quantum server with some incorrect auth_admin_prefix set'
end
end

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe 'quantum::db::mysql::host_access' do
describe 'neutron::db::mysql::host_access' do
let :pre_condition do
'include mysql'
@ -11,15 +11,15 @@ describe 'quantum::db::mysql::host_access' do
end
let :params do
{ :user => 'quantum',
{ :user => 'neutron',
:password => 'passw0rd',
:database => 'quantum' }
:database => 'neutron' }
end
let :facts do
{ :osfamily => 'Debian' }
end
it { should contain_database_user('quantum@127.0.0.1') }
it { should contain_database_grant('quantum@127.0.0.1/quantum') }
it { should contain_database_user('neutron@127.0.0.1') }
it { should contain_database_grant('neutron@127.0.0.1/neutron') }
end

View File

@ -1,13 +1,13 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/quantum_l3_ovs_bridge/quantum'
require 'puppet/provider/neutron_l3_ovs_bridge/neutron'
provider_class = Puppet::Type.type(:quantum_l3_ovs_bridge).provider(:quantum)
provider_class = Puppet::Type.type(:neutron_l3_ovs_bridge).provider(:neutron)
describe provider_class do
let :resource do
Puppet::Type::Quantum_l3_ovs_bridge.new(
Puppet::Type::Neutron_l3_ovs_bridge.new(
:name => 'br-ex',
:subnet_name => 'subnet1'
)

View File

@ -1,8 +1,8 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/quantum_network/quantum'
require 'puppet/provider/neutron_network/neutron'
provider_class = Puppet::Type.type(:quantum_network).provider(:quantum)
provider_class = Puppet::Type.type(:neutron_network).provider(:neutron)
describe provider_class do
@ -23,7 +23,7 @@ describe provider_class do
describe 'when updating a network' do
let :resource do
Puppet::Type::Quantum_network.new(net_attrs)
Puppet::Type::Neutron_network.new(net_attrs)
end
let :provider do
@ -31,21 +31,21 @@ describe provider_class do
end
it 'should call net-update to change admin_state_up' do
provider.expects(:auth_quantum).with('net-update',
provider.expects(:auth_neutron).with('net-update',
'--admin_state_up=False',
net_name)
provider.admin_state_up=('False')
end
it 'should call net-update to change shared' do
provider.expects(:auth_quantum).with('net-update',
provider.expects(:auth_neutron).with('net-update',
'--shared=True',
net_name)
provider.shared=('True')
end
it 'should call net-update to change router_external' do
provider.expects(:auth_quantum).with('net-update',
provider.expects(:auth_neutron).with('net-update',
'--router:external=True',
net_name)
provider.router_external=('True')

View File

@ -1,8 +1,8 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/quantum_router/quantum'
require 'puppet/provider/neutron_router/neutron'
provider_class = Puppet::Type.type(:quantum_router).provider(:quantum)
provider_class = Puppet::Type.type(:neutron_router).provider(:neutron)
describe provider_class do
@ -21,7 +21,7 @@ describe provider_class do
describe 'when updating a router' do
let :resource do
Puppet::Type::Quantum_router.new(router_attrs)
Puppet::Type::Neutron_router.new(router_attrs)
end
let :provider do
@ -29,20 +29,20 @@ describe provider_class do
end
it 'should call router-update to change admin_state_up' do
provider.expects(:auth_quantum).with('router-update',
provider.expects(:auth_neutron).with('router-update',
'--admin-state-up=False',
router_name)
provider.admin_state_up=('False')
end
it 'should call router-gateway-clear for an empty network name' do
provider.expects(:auth_quantum).with('router-gateway-clear',
provider.expects(:auth_neutron).with('router-gateway-clear',
router_name)
provider.gateway_network_name=('')
end
it 'should call router-gateway-set to configure an external network' do
provider.expects(:auth_quantum).with('router-gateway-set',
provider.expects(:auth_neutron).with('router-gateway-set',
router_name,
'net1')
provider.gateway_network_name=('net1')

View File

@ -1,9 +1,9 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/quantum_router_interface/quantum'
require 'puppet/provider/neutron_router_interface/neutron'
provider_class = Puppet::Type.type(:quantum_router_interface).
provider(:quantum)
provider_class = Puppet::Type.type(:neutron_router_interface).
provider(:neutron)
describe provider_class do
@ -16,7 +16,7 @@ describe provider_class do
describe 'when accessing attributes of an interface' do
let :resource do
Puppet::Type::Quantum_router_interface.new(interface_attrs)
Puppet::Type::Neutron_router_interface.new(interface_attrs)
end
let :provider do

View File

@ -1,9 +1,9 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/quantum'
require 'puppet/provider/neutron'
require 'tempfile'
describe Puppet::Provider::Quantum do
describe Puppet::Provider::Neutron do
def klass
described_class
@ -25,7 +25,7 @@ describe Puppet::Provider::Quantum do
end
let :credential_error do
/Quantum types will not work/
/Neutron types will not work/
end
after :each do
@ -36,37 +36,37 @@ describe Puppet::Provider::Quantum do
it 'should fail if config is empty' do
conf = {}
klass.expects(:quantum_conf).returns(conf)
klass.expects(:neutron_conf).returns(conf)
expect do
klass.quantum_credentials
klass.neutron_credentials
end.to raise_error(Puppet::Error, credential_error)
end
it 'should fail if config does not have keystone_authtoken section.' do
conf = {'foo' => 'bar'}
klass.expects(:quantum_conf).returns(conf)
klass.expects(:neutron_conf).returns(conf)
expect do
klass.quantum_credentials
klass.neutron_credentials
end.to raise_error(Puppet::Error, credential_error)
end
it 'should fail if config does not contain all auth params' do
conf = {'keystone_authtoken' => {'invalid_value' => 'foo'}}
klass.expects(:quantum_conf).returns(conf)
klass.expects(:neutron_conf).returns(conf)
expect do
klass.quantum_credentials
klass.neutron_credentials
end.to raise_error(Puppet::Error, credential_error)
end
it 'should use specified host/port/protocol in the auth endpoint' do
conf = {'keystone_authtoken' => credential_hash}
klass.expects(:quantum_conf).returns(conf)
klass.expects(:neutron_conf).returns(conf)
klass.get_auth_endpoint.should == auth_endpoint
end
end
describe 'when invoking the quantum cli' do
describe 'when invoking the neutron cli' do
it 'should set auth credentials in the environment' do
authenv = {
@ -75,25 +75,25 @@ describe Puppet::Provider::Quantum do
:OS_TENANT_NAME => credential_hash['admin_tenant_name'],
:OS_PASSWORD => credential_hash['admin_password'],
}
klass.expects(:get_quantum_credentials).with().returns(credential_hash)
klass.expects(:get_neutron_credentials).with().returns(credential_hash)
klass.expects(:withenv).with(authenv)
klass.auth_quantum('test_retries')
klass.auth_neutron('test_retries')
end
['[Errno 111] Connection refused',
'(HTTP 400)'].reverse.each do |valid_message|
it "should retry when quantum cli returns with error #{valid_message}" do
klass.expects(:get_quantum_credentials).with().returns({})
it "should retry when neutron cli returns with error #{valid_message}" do
klass.expects(:get_neutron_credentials).with().returns({})
klass.expects(:sleep).with(10).returns(nil)
klass.expects(:quantum).twice.with(['test_retries']).raises(
klass.expects(:neutron).twice.with(['test_retries']).raises(
Exception, valid_message).then.returns('')
klass.auth_quantum('test_retries')
klass.auth_neutron('test_retries')
end
end
end
describe 'when listing quantum resources' do
describe 'when listing neutron resources' do
it 'should exclude the column header' do
output = <<-EOT
@ -101,18 +101,18 @@ describe Puppet::Provider::Quantum do
net1
net2
EOT
klass.expects(:auth_quantum).returns(output)
result = klass.list_quantum_resources('foo')
klass.expects(:auth_neutron).returns(output)
result = klass.list_neutron_resources('foo')
result.should eql(['net1', 'net2'])
end
end
describe 'when retrieving attributes for quantum resources' do
describe 'when retrieving attributes for neutron resources' do
it 'should parse single-valued attributes into a key-value pair' do
klass.expects(:auth_quantum).returns('admin_state_up="True"')
result = klass.get_quantum_resource_attrs('foo', 'id')
klass.expects(:auth_neutron).returns('admin_state_up="True"')
result = klass.get_neutron_resource_attrs('foo', 'id')
result.should eql({"admin_state_up" => 'True'})
end
@ -121,8 +121,8 @@ describe Puppet::Provider::Quantum do
subnets="subnet1
subnet2"
EOT
klass.expects(:auth_quantum).returns(output)
result = klass.get_quantum_resource_attrs('foo', 'id')
klass.expects(:auth_neutron).returns(output)
result = klass.get_neutron_resource_attrs('foo', 'id')
result.should eql({"subnets" => ['subnet1', 'subnet2']})
end
@ -135,7 +135,7 @@ subnet2"
end
it 'should handle an empty port list' do
klass.expects(:auth_quantum).with('router-port-list',
klass.expects(:auth_neutron).with('router-port-list',
'--format=csv',
router)
result = klass.list_router_ports(router)
@ -163,7 +163,7 @@ subnet2"
"subnet_id"=>"e4db0abd-276a-4f69-92ea-8b9e4eacfd43",
"id"=>"de0dc526-02b2-467c-9832-2c3dc69ac2b4",
"mac_address"=>"fa:16:3e:f6:b5:72"}]
klass.expects(:auth_quantum).
klass.expects(:auth_neutron).
with('router-port-list', '--format=csv', router).
returns(output)
result = klass.list_router_ports(router)

View File

@ -1,8 +1,8 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/quantum_subnet/quantum'
require 'puppet/provider/neutron_subnet/neutron'
provider_class = Puppet::Type.type(:quantum_subnet).provider(:quantum)
provider_class = Puppet::Type.type(:neutron_subnet).provider(:neutron)
describe provider_class do
@ -25,7 +25,7 @@ describe provider_class do
describe 'when updating a subnet' do
let :resource do
Puppet::Type::Quantum_subnet.new(subnet_attrs)
Puppet::Type::Neutron_subnet.new(subnet_attrs)
end
let :provider do
@ -33,14 +33,14 @@ describe provider_class do
end
it 'should call subnet-update to change gateway_ip' do
provider.expects(:auth_quantum).with('subnet-update',
provider.expects(:auth_neutron).with('subnet-update',
'--gateway-ip=10.0.0.2',
subnet_name)
provider.gateway_ip=('10.0.0.2')
end
it 'should call subnet-update to change enable_dhcp' do
provider.expects(:auth_quantum).with('subnet-update',
provider.expects(:auth_neutron).with('subnet-update',
'--enable-dhcp=True',
subnet_name)
provider.enable_dhcp=('True')