Delete MidoNet deprecated classes and their tests
MidoNet no longer uses the API component. It has been renamed/refactored to "cluster" as it can be seen on the docs at https://blog.midonet.org/introducing-midonet-cluster-services/ Also there is no need to have a Cassandra and Zookeeper dedicated classes, as we leverage this through the use of the midonet_openstack puppet module. Change-Id: I2f17aeeac2d1b121be0d445ff555320d5af5d270 Partial-Bug: #1647302
This commit is contained in:
parent
2ca3cb03ad
commit
6b081ab4d1
@ -1,122 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015 Midokura SARL
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# == Class: tripleo::network::midonet::api
|
||||
#
|
||||
# Configure the MidoNet API
|
||||
#
|
||||
# == Parameters:
|
||||
#
|
||||
# [*zookeeper_servers*]
|
||||
# (required) List IPs of the zookeeper server cluster. Zookeeper is the
|
||||
# backend database where MidoNet stores the virtual network topology.
|
||||
# Array of strings value.
|
||||
#
|
||||
# [*vip*]
|
||||
# (required) Public Virtual IP where the API will be exposed.
|
||||
# String (IPv4) value.
|
||||
#
|
||||
# [*keystone_ip*]
|
||||
# (required) MidoNet API is registered as an OpenStack service. Provide the
|
||||
# keystone ip address.
|
||||
# String (IPv4) value.
|
||||
#
|
||||
# [*keystone_admin_token*]
|
||||
# (required) MidoNet API is registered as an OpenStack service. It needs the
|
||||
# keystone admin token to perform some admin calls.
|
||||
# String value.
|
||||
#
|
||||
# [*bind_address*]
|
||||
# (required) MidoNet API uses a Tomcat instance to offer the REST service. The
|
||||
# ip address where to bind the tomcat service.
|
||||
# String (IPv4) value.
|
||||
#
|
||||
# [*admin_password*]
|
||||
# (required) OpenStack admin user password.
|
||||
# String value.
|
||||
#
|
||||
# [*keystone_port*]
|
||||
# (optional) MidoNet API is registered as an OpenStack service. Provide
|
||||
# the keystone port.
|
||||
# Defaults to 35357
|
||||
#
|
||||
# [*keystone_tenant_name*]
|
||||
# (optional) Tenant of the keystone service.
|
||||
# Defaults to 'admin'
|
||||
#
|
||||
# [*admin_user_name*]
|
||||
# (optional) OpenStack admin user name.
|
||||
# Defaults to 'admin'
|
||||
#
|
||||
# [*admin_tenant_name*]
|
||||
# (optional). OpenStack admin tenant name.
|
||||
# Defaults to 'admin'
|
||||
#
|
||||
|
||||
class tripleo::network::midonet::api(
|
||||
$zookeeper_servers,
|
||||
$vip,
|
||||
$keystone_ip,
|
||||
$keystone_admin_token,
|
||||
$bind_address,
|
||||
$admin_password,
|
||||
$keystone_port = 35357,
|
||||
$keystone_tenant_name = 'admin',
|
||||
$admin_user_name = 'admin',
|
||||
$admin_tenant_name = 'admin'
|
||||
)
|
||||
{
|
||||
|
||||
# TODO: Remove this comment once we can guarantee that all the distros
|
||||
# deploying TripleO use Puppet > 3.7 because of this bug:
|
||||
# https://tickets.puppetlabs.com/browse/PUP-1299
|
||||
|
||||
# validate_array($zookeeper_servers)
|
||||
validate_ip_address($vip)
|
||||
validate_ip_address($keystone_ip)
|
||||
validate_ip_address($bind_address)
|
||||
|
||||
# Run Tomcat and MidoNet API
|
||||
class {'::tomcat':
|
||||
install_from_source => false
|
||||
} ->
|
||||
|
||||
package {'midonet-api':
|
||||
ensure => present
|
||||
} ->
|
||||
|
||||
class {'::midonet::midonet_api::run':
|
||||
zk_servers => list_to_zookeeper_hash($zookeeper_servers),
|
||||
keystone_auth => true,
|
||||
tomcat_package => 'tomcat',
|
||||
vtep => false,
|
||||
api_ip => $vip,
|
||||
api_port => '8081',
|
||||
keystone_host => $keystone_ip,
|
||||
keystone_port => $keystone_port,
|
||||
keystone_admin_token => $keystone_admin_token,
|
||||
keystone_tenant_name => $keystone_tenant_name,
|
||||
catalina_base => '/usr/share/tomcat',
|
||||
bind_address => $bind_address
|
||||
}
|
||||
|
||||
# Configure the CLI
|
||||
class {'::midonet::midonet_cli':
|
||||
api_endpoint => "http://${vip}:8081/midonet-api",
|
||||
username => $admin_user_name,
|
||||
password => $admin_password,
|
||||
tenant_name => $admin_tenant_name
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015 Midokura SARL
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# Unit tests for the cassandra service
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'tripleo::cluster::cassandra' do
|
||||
|
||||
shared_examples_for 'tripleo::cluster::cassandra' do
|
||||
|
||||
let :params do
|
||||
{
|
||||
:cassandra_servers => ['192.168.2.2', '192.168.2.3'],
|
||||
:cassandra_ip => '192.168.2.2'
|
||||
}
|
||||
end
|
||||
|
||||
it 'should configure cassandra' do
|
||||
is_expected.to contain_class('cassandra').with(
|
||||
:seeds => ['192.168.2.2', '192.168.2.3'],
|
||||
:listen_address => '192.168.2.2',
|
||||
:storage_port => 7000,
|
||||
:ssl_storage_port => 7001,
|
||||
:native_transport_port => 9042,
|
||||
:rpc_port => 9160
|
||||
)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let(:facts) do
|
||||
facts.merge({})
|
||||
end
|
||||
|
||||
it_behaves_like 'tripleo::cluster::cassandra'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -1,86 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015 Midokura SARL
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# Unit tests for the zookeeper service
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'tripleo::cluster::zookeeper' do
|
||||
|
||||
shared_examples_for 'tripleo::cluster::zookeeper' do
|
||||
let :params do
|
||||
{
|
||||
:zookeeper_server_ips => ['23.43.2.34', '23.43.2.35', '24.43.2.36'],
|
||||
:zookeeper_hostnames => ['host1.midonet', 'host2.midonet', 'host3.midonet']
|
||||
}
|
||||
end
|
||||
|
||||
context 'on host1' do
|
||||
before :each do
|
||||
facts.merge!({ :hostname => 'host1.midonet'})
|
||||
params.merge!({ :zookeeper_client_ip => '23.43.2.34' })
|
||||
end
|
||||
|
||||
it 'should call zookeeper using id==1' do
|
||||
is_expected.to contain_class('zookeeper').with(
|
||||
:servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'],
|
||||
:client_ip => '23.43.2.34',
|
||||
:id => 1
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'on host2' do
|
||||
before :each do
|
||||
facts.merge!({ :hostname => 'host2.midonet'})
|
||||
params.merge!({ :zookeeper_client_ip => '23.43.2.35' })
|
||||
end
|
||||
|
||||
it 'should call zookeeper using id==1' do
|
||||
is_expected.to contain_class('zookeeper').with(
|
||||
:servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'],
|
||||
:client_ip => '23.43.2.35',
|
||||
:id => 2
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'on host3' do
|
||||
before :each do
|
||||
facts.merge!({ :hostname => 'host3.midonet'})
|
||||
params.merge!({ :zookeeper_client_ip => '23.43.2.36' })
|
||||
end
|
||||
|
||||
it 'should call zookeeper using id==1' do
|
||||
is_expected.to contain_class('zookeeper').with(
|
||||
:servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'],
|
||||
:client_ip => '23.43.2.36',
|
||||
:id => 3
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let(:facts) do
|
||||
facts.merge({})
|
||||
end
|
||||
|
||||
it_behaves_like 'tripleo::cluster::zookeeper'
|
||||
end
|
||||
end
|
||||
end
|
@ -1,76 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015 Midokura SARL
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# Unit tests for the midonet api
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'tripleo::network::midonet::api' do
|
||||
|
||||
shared_examples_for 'tripleo::midonet::api' do
|
||||
|
||||
let :params do
|
||||
{
|
||||
:zookeeper_servers => ['192.168.2.1', '192.168.2.2'],
|
||||
:vip => '192.23.0.2',
|
||||
:keystone_ip => '192.23.0.2',
|
||||
:keystone_admin_token => 'admin_token',
|
||||
:admin_password => 'admin_password',
|
||||
:bind_address => '192.23.0.65'
|
||||
}
|
||||
end
|
||||
|
||||
it 'should call api configuration' do
|
||||
is_expected.to contain_class('midonet::midonet_api::run').with(
|
||||
:zk_servers => [{'ip' => '192.168.2.1', 'port' => 2181},
|
||||
{'ip' => '192.168.2.2', 'port' => 2181}],
|
||||
:keystone_auth => true,
|
||||
:tomcat_package => 'tomcat',
|
||||
:vtep => false,
|
||||
:api_ip => '192.23.0.2',
|
||||
:api_port => '8081',
|
||||
:keystone_host => '192.23.0.2',
|
||||
:keystone_port => 35357,
|
||||
:keystone_admin_token => 'admin_token',
|
||||
:keystone_tenant_name => 'admin',
|
||||
:catalina_base => '/usr/share/tomcat',
|
||||
:bind_address => '192.23.0.65'
|
||||
)
|
||||
end
|
||||
|
||||
it 'should install the cli' do
|
||||
is_expected.to contain_class('midonet::midonet_cli').with(
|
||||
:api_endpoint => 'http://192.23.0.2:8081/midonet-api',
|
||||
:username => 'admin',
|
||||
:password => 'admin_password',
|
||||
:tenant_name => 'admin'
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let(:facts) do
|
||||
facts.merge({
|
||||
:augeasversion => '1.0.0'
|
||||
})
|
||||
end
|
||||
|
||||
it_behaves_like 'tripleo::midonet::api'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user