Merge pull request #439 from enovance/enhancement/346/emilien-2

Split OpenStack services in subclasses
This commit is contained in:
Yanis Guenane
2014-04-24 11:06:38 -04:00
19 changed files with 847 additions and 251 deletions

63
manifests/compute/api.pp Normal file
View File

@@ -0,0 +1,63 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Compute API node
#
class cloud::compute::api(
$ks_keystone_internal_host = '127.0.0.1',
$ks_nova_password = 'novapassword',
$neutron_metadata_proxy_shared_secret = 'metadatapassword',
$api_eth = '127.0.0.1',
$ks_nova_public_port = '8774',
$ks_ec2_public_port = '8773',
$ks_metadata_public_port = '8775'
){
include 'cloud::compute'
class { 'nova::api':
enabled => true,
auth_host => $ks_keystone_internal_host,
admin_password => $ks_nova_password,
api_bind_address => $api_eth,
metadata_listen => $api_eth,
neutron_metadata_proxy_shared_secret => $neutron_metadata_proxy_shared_secret,
}
@@haproxy::balancermember{"${::fqdn}-compute_api_ec2":
listening_service => 'ec2_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_ec2_public_port,
options => 'check inter 2000 rise 2 fall 5'
}
@@haproxy::balancermember{"${::fqdn}-compute_api_nova":
listening_service => 'nova_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_nova_public_port,
options => 'check inter 2000 rise 2 fall 5'
}
@@haproxy::balancermember{"${::fqdn}-compute_api_metadata":
listening_service => 'metadata_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_metadata_public_port,
options => 'check inter 2000 rise 2 fall 5'
}
}

27
manifests/compute/cert.pp Normal file
View File

@@ -0,0 +1,27 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Compute Certificate node
#
class cloud::compute::cert {
include 'cloud::compute'
class { 'nova::cert':
enabled => true,
}
}

View File

@@ -0,0 +1,27 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Compute Conductor node
#
class cloud::compute::conductor {
include 'cloud::compute'
class { 'nova::conductor':
enabled => true,
}
}

View File

@@ -0,0 +1,27 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Compute Authenfication Console node
#
class cloud::compute::consoleauth {
include 'cloud::compute'
class { 'nova::consoleauth':
enabled => true,
}
}

View File

@@ -0,0 +1,38 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Compute Proxy Console node
#
class cloud::compute::consoleproxy(
$api_eth = '127.0.0.1',
$spice_port = '6082'
){
include 'cloud::compute'
class { 'nova::spicehtml5proxy':
enabled => true,
host => $api_eth
}
@@haproxy::balancermember{"${::fqdn}-compute_spice":
listening_service => 'spice_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $spice_port,
options => 'check inter 2000 rise 2 fall 5'
}
}

View File

@@ -27,61 +27,28 @@ class cloud::compute::controller(
$ks_metadata_public_port = 8775
){
warning('This class is deprecated. You should use cloud::compute::api,scheduler,conductor,consoleauth,consoleproxy,cert classes')
include 'cloud::compute'
class { [
'nova::scheduler',
'nova::cert',
'nova::consoleauth',
'nova::conductor'
]:
enabled => true,
class { 'cloud::compute::cert': }
class { 'cloud::compute::conductor': }
class { 'cloud::compute::consoleauth': }
class { 'cloud::compute::scheduler': }
class { 'cloud::compute::api':
ks_keystone_internal_host => $ks_keystone_internal_host,
ks_nova_password => $ks_nova_password,
api_eth => $api_eth,
neutron_metadata_proxy_shared_secret => $neutron_metadata_proxy_shared_secret,
ks_nova_public_port => $ks_nova_public_port,
ks_ec2_public_port => $ks_ec2_public_port,
ks_metadata_public_port => $ks_metadata_public_port,
}
class { 'nova::api':
enabled => true,
auth_host => $ks_keystone_internal_host,
admin_password => $ks_nova_password,
api_bind_address => $api_eth,
metadata_listen => $api_eth,
neutron_metadata_proxy_shared_secret => $neutron_metadata_proxy_shared_secret,
}
class { 'nova::spicehtml5proxy':
enabled => true,
host => $api_eth
}
@@haproxy::balancermember{"${::fqdn}-compute_api_ec2":
listening_service => 'ec2_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_ec2_public_port,
options => 'check inter 2000 rise 2 fall 5'
}
@@haproxy::balancermember{"${::fqdn}-compute_api_nova":
listening_service => 'nova_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_nova_public_port,
options => 'check inter 2000 rise 2 fall 5'
}
@@haproxy::balancermember{"${::fqdn}-compute_api_metadata":
listening_service => 'metadata_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_metadata_public_port,
options => 'check inter 2000 rise 2 fall 5'
}
@@haproxy::balancermember{"${::fqdn}-compute_spice":
listening_service => 'spice_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $spice_port,
options => 'check inter 2000 rise 2 fall 5'
class { 'cloud::compute::consoleproxy':
api_eth => $api_eth,
spice_port => $spice_port,
}
}

View File

@@ -0,0 +1,27 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Compute Scheduler node
#
class cloud::compute::scheduler {
include 'cloud::compute'
class { 'nova::scheduler':
enabled => true,
}
}

View File

@@ -16,6 +16,7 @@
# == Class: cloud::image
#
# Install Image Server (Glance)
# This class is deprecated for cloud::image::api and cloud::image::registry
#
# === Parameters:
#
@@ -89,113 +90,38 @@ class cloud::image(
$use_syslog = true
) {
# Disable twice logging if syslog is enabled
if $use_syslog {
$log_dir = false
$log_file_api = false
$log_file_registry = false
} else {
$log_dir = '/var/log/glance'
$log_file_api = '/var/log/glance/api.log'
$log_file_registry = '/var/log/glance/registry.log'
warning('This class is deprecated. You should use cloud::image::api and cloud::image::registry.')
# Maintain backward compatibility with H.1.2.0
class { 'cloud::image::api':
glance_db_host => $glance_db_host,
glance_db_user => $glance_db_user,
glance_db_password => $glance_db_password,
openstack_vip => $openstack_vip,
ks_glance_registry_internal_port => $ks_glance_registry_internal_port,
verbose => $verbose,
debug => $debug,
ks_keystone_internal_host => $ks_keystone_internal_host,
ks_glance_password => $ks_glance_password,
log_facility => $log_facility,
api_eth => $api_eth,
ks_glance_api_internal_port => $ks_glance_api_internal_port,
use_syslog => $use_syslog,
glance_rbd_pool => $glance_rbd_pool,
glance_rbd_user => $glance_rbd_user,
}
$encoded_glance_user = uriescape($glance_db_user)
$encoded_glance_password = uriescape($glance_db_password)
class { 'glance::api':
sql_connection => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
registry_host => $openstack_vip,
registry_port => $ks_glance_registry_internal_port,
verbose => $verbose,
debug => $debug,
auth_host => $ks_keystone_internal_host,
keystone_password => $ks_glance_password,
keystone_tenant => 'services',
keystone_user => 'glance',
show_image_direct_url => true,
log_dir => $log_dir,
log_file => $log_file_api,
log_facility => $log_facility,
bind_host => $api_eth,
bind_port => $ks_glance_api_internal_port,
use_syslog => $use_syslog,
}
class { 'glance::registry':
sql_connection => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
verbose => $verbose,
debug => $debug,
auth_host => $ks_keystone_internal_host,
keystone_password => $ks_glance_password,
keystone_tenant => 'services',
keystone_user => 'glance',
bind_host => $api_eth,
log_dir => $log_dir,
log_file => $log_file_registry,
bind_port => $ks_glance_registry_internal_port,
use_syslog => $use_syslog,
log_facility => $log_facility,
}
# TODO(EmilienM) Disabled for now
# Follow-up: https://github.com/enovance/puppet-openstack-cloud/issues/160
#
# class { 'glance::notify::rabbitmq':
# rabbit_password => $rabbit_password,
# rabbit_userid => 'glance',
# rabbit_host => $rabbit_host,
# }
glance_api_config {
# TODO(EmilienM) Will be deprecated in Icehouse for notification_driver.
'DEFAULT/notifier_strategy': value => 'noop';
}
class { 'glance::backend::rbd':
rbd_store_user => $glance_rbd_user,
rbd_store_pool => $glance_rbd_pool
}
Ceph::Key <<| title == $glance_rbd_user |>>
file { '/etc/ceph/ceph.client.glance.keyring':
owner => 'glance',
group => 'glance',
mode => '0400',
require => Ceph::Key[$glance_rbd_user]
}
Concat::Fragment <<| title == 'ceph-client-os' |>>
class { 'glance::cache::cleaner': }
class { 'glance::cache::pruner': }
# Note(EmilienM):
# We check if DB tables are created, if not we populate Glance DB.
# It's a hack to fit with our setup where we run MySQL/Galera
# TODO(Gonéri)
# We have to do this only on the primary node of the galera cluster to avoid race condition
# https://github.com/enovance/puppet-openstack-cloud/issues/156
exec {'glance_db_sync':
command => 'glance-manage db_sync',
user => 'glance',
path => '/usr/bin',
unless => "/usr/bin/mysql glance -h ${glance_db_host} -u ${encoded_glance_user} -p${encoded_glance_password} -e \"show tables\" | /bin/grep Tables"
}
# TODO(EmilienM) For later, I'll also add internal network support in HAproxy for all OpenStack API, to optimize North / South network traffic
@@haproxy::balancermember{"${::fqdn}-glance_api":
listening_service => 'glance_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_glance_api_internal_port,
options => 'check inter 2000 rise 2 fall 5'
}
@@haproxy::balancermember{"${::fqdn}-glance_registry":
listening_service => 'glance_registry_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_glance_registry_internal_port,
options => 'check inter 2000 rise 2 fall 5'
class { 'cloud::image::registry':
glance_db_host => $glance_db_host,
glance_db_user => $glance_db_user,
glance_db_password => $glance_db_password,
verbose => $verbose,
debug => $debug,
ks_keystone_internal_host => $ks_keystone_internal_host,
ks_glance_password => $ks_glance_password,
api_eth => $api_eth,
ks_glance_registry_internal_port => $ks_glance_registry_internal_port,
use_syslog => $use_syslog,
log_facility => $log_facility,
}
}

162
manifests/image/api.pp Normal file
View File

@@ -0,0 +1,162 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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: cloud::image::api
#
# Install API Image Server (Glance API)
#
# === Parameters:
#
# [*glance_db_host*]
# (optional) Hostname or IP address to connect to glance database
# Defaults to '127.0.0.1'
#
# [*glance_db_user*]
# (optional) Username to connect to glance database
# Defaults to 'glance'
#
# [*glance_db_password*]
# (optional) Password to connect to glance database
# Defaults to 'glancepassword'
#
# [*ks_keystone_internal_host*]
# (optional) Internal Hostname or IP to connect to Keystone API
# Defaults to '127.0.0.1'
#
# [*ks_glance_api_internal_port*]
# (optional) TCP port to connect to Glance API from internal network
# Defaults to '9292'
#
# [*ks_glance_registry_internal_port*]
# (optional) TCP port to connect to Glance Registry from internal network
# Defaults to '9191'
#
# [*ks_glance_password*]
# (optional) Password used by Glance to connect to Keystone API
# Defaults to 'glancepassword'
#
# [*rabbit_host*]
# (optional) IP or Hostname of one RabbitMQ server.
# Defaults to '127.0.0.1'
#
# [*rabbit_password*]
# (optional) Password to connect to glance queue.
# Defaults to 'rabbitpassword'
#
# [*api_eth*]
# (optional) Which interface we bind the Glance API server.
# Defaults to '127.0.0.1'
#
# [*use_syslog*]
# (optional) Use syslog for logging
# Defaults to true
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines
# Defaults to 'LOG_LOCAL0'
#
class cloud::image::api(
$glance_db_host = '127.0.0.1',
$glance_db_user = 'glance',
$glance_db_password = 'glancepassword',
$ks_keystone_internal_host = '127.0.0.1',
$ks_glance_internal_host = '127.0.0.1',
$ks_glance_api_internal_port = '9292',
$ks_glance_registry_internal_port = '9191',
$ks_glance_password = 'glancepassword',
$rabbit_password = 'rabbit_password',
$rabbit_host = '127.0.0.1',
$api_eth = '127.0.0.1',
$openstack_vip = '127.0.0.1',
$glance_rbd_pool = 'images',
$glance_rbd_user = 'glance',
$verbose = true,
$debug = true,
$log_facility = 'LOG_LOCAL0',
$use_syslog = true
) {
# Disable twice logging if syslog is enabled
if $use_syslog {
$log_dir = false
$log_file_api = false
$log_file_registry = false
} else {
$log_dir = '/var/log/glance'
$log_file_api = '/var/log/glance/api.log'
$log_file_registry = '/var/log/glance/registry.log'
}
$encoded_glance_user = uriescape($glance_db_user)
$encoded_glance_password = uriescape($glance_db_password)
class { 'glance::api':
sql_connection => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
registry_host => $openstack_vip,
registry_port => $ks_glance_registry_internal_port,
verbose => $verbose,
debug => $debug,
auth_host => $ks_keystone_internal_host,
keystone_password => $ks_glance_password,
keystone_tenant => 'services',
keystone_user => 'glance',
show_image_direct_url => true,
log_dir => $log_dir,
log_file => $log_file_api,
log_facility => $log_facility,
bind_host => $api_eth,
bind_port => $ks_glance_api_internal_port,
use_syslog => $use_syslog,
}
# TODO(EmilienM) Disabled for now
# Follow-up: https://github.com/enovance/puppet-openstack-cloud/issues/160
#
# class { 'glance::notify::rabbitmq':
# rabbit_password => $rabbit_password,
# rabbit_userid => 'glance',
# rabbit_host => $rabbit_host,
# }
glance_api_config {
# TODO(EmilienM) Will be deprecated in Icehouse for notification_driver.
'DEFAULT/notifier_strategy': value => 'noop';
}
class { 'glance::backend::rbd':
rbd_store_user => $glance_rbd_user,
rbd_store_pool => $glance_rbd_pool
}
Ceph::Key <<| title == $glance_rbd_user |>>
file { '/etc/ceph/ceph.client.glance.keyring':
owner => 'glance',
group => 'glance',
mode => '0400',
require => Ceph::Key[$glance_rbd_user]
}
Concat::Fragment <<| title == 'ceph-client-os' |>>
class { 'glance::cache::cleaner': }
class { 'glance::cache::pruner': }
@@haproxy::balancermember{"${::fqdn}-glance_api":
listening_service => 'glance_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_glance_api_internal_port,
options => 'check inter 2000 rise 2 fall 5'
}
}

118
manifests/image/registry.pp Normal file
View File

@@ -0,0 +1,118 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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: cloud::image::registry
#
# Install Registry Image Server (Glance Registry)
#
# === Parameters:
#
# [*glance_db_host*]
# (optional) Hostname or IP address to connect to glance database
# Defaults to '127.0.0.1'
#
# [*glance_db_user*]
# (optional) Username to connect to glance database
# Defaults to 'glance'
#
# [*glance_db_password*]
# (optional) Password to connect to glance database
# Defaults to 'glancepassword'
#
# [*ks_keystone_internal_host*]
# (optional) Internal Hostname or IP to connect to Keystone API
# Defaults to '127.0.0.1'
#
# [*ks_glance_registry_internal_port*]
# (optional) TCP port to connect to Glance Registry from internal network
# Defaults to '9191'
#
# [*ks_glance_password*]
# (optional) Password used by Glance to connect to Keystone API
# Defaults to 'glancepassword'
#
# [*api_eth*]
# (optional) Which interface we bind the Glance API server.
# Defaults to '127.0.0.1'
#
# [*use_syslog*]
# (optional) Use syslog for logging
# Defaults to true
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines
# Defaults to 'LOG_LOCAL0'
#
class cloud::image::registry(
$glance_db_host = '127.0.0.1',
$glance_db_user = 'glance',
$glance_db_password = 'glancepassword',
$ks_keystone_internal_host = '127.0.0.1',
$ks_glance_internal_host = '127.0.0.1',
$ks_glance_registry_internal_port = '9191',
$ks_glance_password = 'glancepassword',
$api_eth = '127.0.0.1',
$verbose = true,
$debug = true,
$log_facility = 'LOG_LOCAL0',
$use_syslog = true
) {
# Disable twice logging if syslog is enabled
if $use_syslog {
$log_dir = false
$log_file_api = false
$log_file_registry = false
} else {
$log_dir = '/var/log/glance'
$log_file_api = '/var/log/glance/api.log'
$log_file_registry = '/var/log/glance/registry.log'
}
$encoded_glance_user = uriescape($glance_db_user)
$encoded_glance_password = uriescape($glance_db_password)
class { 'glance::registry':
sql_connection => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance",
verbose => $verbose,
debug => $debug,
auth_host => $ks_keystone_internal_host,
keystone_password => $ks_glance_password,
keystone_tenant => 'services',
keystone_user => 'glance',
bind_host => $api_eth,
log_dir => $log_dir,
log_file => $log_file_registry,
bind_port => $ks_glance_registry_internal_port,
use_syslog => $use_syslog,
log_facility => $log_facility,
}
exec {'glance_db_sync':
command => 'glance-manage db_sync',
user => 'glance',
path => '/usr/bin',
unless => "/usr/bin/mysql glance -h ${glance_db_host} -u ${encoded_glance_user} -p${encoded_glance_password} -e \"show tables\" | /bin/grep Tables"
}
@@haproxy::balancermember{"${::fqdn}-glance_registry":
listening_service => 'glance_registry_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_glance_registry_internal_port,
options => 'check inter 2000 rise 2 fall 5'
}
}

View File

@@ -0,0 +1,26 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Telemetry Alarm Evaluator nodes
#
class cloud::telemetry::alarmevaluator(
){
include 'cloud::telemetry'
class { 'ceilometer::alarm::evaluator': }
}

View File

@@ -0,0 +1,26 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Telemetry Alarm Notifier nodes
#
class cloud::telemetry::alarmnotifier(
){
include 'cloud::telemetry'
class { 'ceilometer::alarm::notifier': }
}

View File

@@ -0,0 +1,66 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Telemetry API nodes
#
class cloud::telemetry::api(
$ks_keystone_internal_host = '127.0.0.1',
$ks_keystone_internal_proto = 'http',
$ks_ceilometer_internal_port = '8777',
$ks_ceilometer_password = 'ceilometerpassword',
$api_eth = '127.0.0.1',
$mongo_nodes = ['127.0.0.1:27017'],
){
include 'cloud::telemetry'
$s_mongo_nodes = join($mongo_nodes, ',')
$db_conn = "mongodb://${s_mongo_nodes}/ceilometer?replicaSet=ceilometer"
class { 'ceilometer::db':
database_connection => $db_conn,
sync_db => true,
require => Anchor['mongodb setup done'],
}
class { 'ceilometer::api':
keystone_password => $ks_ceilometer_password,
keystone_host => $ks_keystone_internal_host,
keystone_protocol => $ks_keystone_internal_proto,
host => $api_eth
}
# Configure TTL for samples
# Purge datas older than one month
# Run the script once a day but with a random time to avoid
# issues with MongoDB access
class { 'ceilometer::expirer':
time_to_live => '2592000',
minute => '0',
hour => '0',
}
Cron <<| title == 'ceilometer-expirer' |>> { command => "sleep $((\$RANDOM % 86400)) && ${::ceilometer::params::expirer_command}" }
@@haproxy::balancermember{"${::fqdn}-ceilometer_api":
listening_service => 'ceilometer_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_ceilometer_internal_port,
options => 'check inter 2000 rise 2 fall 5'
}
}

View File

@@ -0,0 +1,26 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Telemetry Collector nodes
#
class cloud::telemetry::collector(
){
include 'cloud::telemetry'
class { 'ceilometer::collector': }
}

View File

@@ -19,59 +19,24 @@
class cloud::telemetry::server(
$ks_keystone_internal_host = '127.0.0.1',
$ks_keystone_internal_proto = 'http',
$ks_ceilometer_internal_port = '5000',
$ks_ceilometer_internal_port = '8777',
$ks_ceilometer_password = 'ceilometerpassword',
$api_eth = '127.0.0.1',
$mongo_nodes = ['127.0.0.1:27017'],
){
include 'cloud::telemetry'
warning('This class is deprecated. You should use cloud::telemetry::api,collector,alarmnotifier,alarmevaluator.')
$s_mongo_nodes = join($mongo_nodes, ',')
$db_conn = "mongodb://${s_mongo_nodes}/ceilometer?replicaSet=ceilometer"
# Install MongoDB database
class { 'ceilometer::db':
database_connection => $db_conn,
sync_db => true,
require => Anchor['mongodb setup done'],
}
# Install Ceilometer-collector
class { 'ceilometer::collector': }
# Install Ceilometer-evaluator
class { 'ceilometer::alarm::evaluator': }
# Install Ceilometer-notifier
class { 'ceilometer::alarm::notifier': }
# Install Ceilometer-API
class { 'ceilometer::api':
keystone_password => $ks_ceilometer_password,
keystone_host => $ks_keystone_internal_host,
keystone_protocol => $ks_keystone_internal_proto,
host => $api_eth
}
# Configure TTL for samples
# Purge datas older than one month
# Run the script once a day but with a random time to avoid
# issues with MongoDB access
class { 'ceilometer::expirer':
time_to_live => '2592000',
minute => '0',
hour => '0',
}
Cron <<| title == 'ceilometer-expirer' |>> { command => "sleep $((\$RANDOM % 86400)) && ${::ceilometer::params::expirer_command}" }
@@haproxy::balancermember{"${::fqdn}-ceilometer_api":
listening_service => 'ceilometer_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_ceilometer_internal_port,
options => 'check inter 2000 rise 2 fall 5'
class { 'cloud::telemetry::api':
ks_keystone_internal_host => $ks_keystone_internal_host,
ks_keystone_internal_proto => $ks_keystone_internal_proto,
ks_ceilometer_internal_port => $ks_ceilometer_internal_port,
ks_ceilometer_password => $ks_ceilometer_password,
api_eth => $api_eth,
mongo_nodes => $mongo_nodes,
}
class { 'cloud::telemetry::alarmevaluator': }
class { 'cloud::telemetry::alarmnotifier': }
class { 'cloud::telemetry::collector': }
}

63
manifests/volume/api.pp Normal file
View File

@@ -0,0 +1,63 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Volume API node
#
class cloud::volume::api(
$ks_cinder_internal_port = 8776,
$ks_cinder_password = 'cinderpassword',
$ks_keystone_internal_host = '127.0.0.1',
$ks_glance_internal_host = '127.0.0.1',
$ks_glance_api_internal_port = 9292,
$api_eth = '127.0.0.1',
$default_volume_type = undef,
# Maintain backward compatibility for multi-backend
$volume_multi_backend = false
) {
include 'cloud::volume'
if ! $volume_multi_backend {
$default_volume_type_real = undef
} else {
if ! $default_volume_type {
fail('when using multi-backend, you should define a default_volume_type value in cloud::volume::controller')
} else {
$default_volume_type_real = $default_volume_type
}
}
class { 'cinder::api':
keystone_password => $ks_cinder_password,
keystone_auth_host => $ks_keystone_internal_host,
bind_host => $api_eth,
default_volume_type => $default_volume_type_real
}
class { 'cinder::glance':
glance_api_servers => "${ks_glance_internal_host}:${ks_glance_api_internal_port}",
glance_request_timeout => '10'
}
@@haproxy::balancermember{"${::fqdn}-cinder_api":
listening_service => 'cinder_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_cinder_internal_port,
options => 'check inter 2000 rise 2 fall 5'
}
}

View File

@@ -0,0 +1,34 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Volume Backup node
#
class cloud::volume::backup(
$backup_ceph_pool = 'backup',
$backup_ceph_user = 'cinder'
) {
include 'cloud::volume'
class { 'cinder::backup': }
# TODO(EmilienM) Disabled for now: http://git.io/kfTmcA
# class { 'cinder::backup::ceph':
# backup_ceph_user => $backup_ceph_user,
# backup_ceph_pool => $backup_ceph_pool
# }
}

View File

@@ -23,59 +23,31 @@ class cloud::volume::controller(
$ks_glance_internal_host = '127.0.0.1',
$ks_glance_api_internal_port = 9292,
$api_eth = '127.0.0.1',
# Maintain backward compatibility for multi-backend
$volume_multi_backend = false,
$default_volume_type = undef,
# TODO(EmilienM) Disabled for now: http://git.io/kfTmcA
# $backup_ceph_pool = 'backup',
# $backup_ceph_user = 'cinder'
# Maintain backward compatibility for multi-backend
$volume_multi_backend = false
) {
warning('This class is deprecated. You should use cloud::volume::api,backup,scheduler.')
include 'cloud::volume'
if ! $volume_multi_backend {
$scheduler_driver_real = false
$default_volume_type_real = undef
} else {
$scheduler_driver_real = 'cinder.scheduler.filter_scheduler.FilterScheduler'
if ! $default_volume_type {
fail('when using multi-backend, you should define a default_volume_type value in cloud::volume::controller')
} else {
$default_volume_type_real = $default_volume_type
}
# Maintain backward compatibility
class { 'cloud::volume::api':
ks_cinder_internal_port => $ks_cinder_internal_port,
ks_cinder_password => $ks_cinder_password,
ks_keystone_internal_host => $ks_keystone_internal_host,
ks_glance_internal_host => $ks_glance_internal_host,
ks_glance_api_internal_port => $ks_glance_api_internal_port,
api_eth => $api_eth,
default_volume_type => $default_volume_type,
# Maintain backward compatibility for multi-backend
volume_multi_backend => $volume_multi_backend
}
class { 'cloud::volume::scheduler':
volume_multi_backend => $volume_multi_backend
}
class { 'cinder::scheduler':
scheduler_driver => $scheduler_driver_real
}
class { 'cinder::api':
keystone_password => $ks_cinder_password,
keystone_auth_host => $ks_keystone_internal_host,
bind_host => $api_eth,
default_volume_type => $default_volume_type_real
}
class { 'cinder::backup': }
# TODO(EmilienM) Disabled for now: http://git.io/kfTmcA
# class { 'cinder::backup::ceph':
# backup_ceph_user => $backup_ceph_user,
# backup_ceph_pool => $backup_ceph_pool
# }
class { 'cinder::glance':
glance_api_servers => "${ks_glance_internal_host}:${ks_glance_api_internal_port}",
glance_request_timeout => '10'
}
@@haproxy::balancermember{"${::fqdn}-cinder_api":
listening_service => 'cinder_api_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $ks_cinder_internal_port,
options => 'check inter 2000 rise 2 fall 5'
}
class { 'cloud::volume::backup': }
}

View File

@@ -0,0 +1,36 @@
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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.
#
# Volume Scheduler node
#
class cloud::volume::scheduler(
# Maintain backward compatibility for multi-backend
$volume_multi_backend = false
) {
include 'cloud::volume'
if ! $volume_multi_backend {
$scheduler_driver_real = false
} else {
$scheduler_driver_real = 'cinder.scheduler.filter_scheduler.FilterScheduler'
}
class { 'cinder::scheduler':
scheduler_driver => $scheduler_driver_real
}
}