From 8bcb5315a2a45e9ec7b1d07a64efcc7f8faa2278 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 23 Apr 2014 11:26:27 +0200 Subject: [PATCH] Splitting: Compute Controller services Split cloud::compute::controller in * cloud::compute::api * cloud::compute::cert * cloud::compute::conductor * cloud::compute::consoleauth * cloud::compute::consoleproxy * cloud::compute::scheduler Also maintains backward compatibility and informs the end user about the new classes. Bug #346 --- manifests/compute/api.pp | 63 ++++++++++++++++++++++++++++ manifests/compute/cert.pp | 27 ++++++++++++ manifests/compute/conductor.pp | 27 ++++++++++++ manifests/compute/consoleauth.pp | 27 ++++++++++++ manifests/compute/consoleproxy.pp | 38 +++++++++++++++++ manifests/compute/controller.pp | 69 ++++++++----------------------- manifests/compute/scheduler.pp | 27 ++++++++++++ manifests/image/api.pp | 2 +- 8 files changed, 228 insertions(+), 52 deletions(-) create mode 100644 manifests/compute/api.pp create mode 100644 manifests/compute/cert.pp create mode 100644 manifests/compute/conductor.pp create mode 100644 manifests/compute/consoleauth.pp create mode 100644 manifests/compute/consoleproxy.pp create mode 100644 manifests/compute/scheduler.pp diff --git a/manifests/compute/api.pp b/manifests/compute/api.pp new file mode 100644 index 00000000..d653dfd9 --- /dev/null +++ b/manifests/compute/api.pp @@ -0,0 +1,63 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# 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' + } +} diff --git a/manifests/compute/cert.pp b/manifests/compute/cert.pp new file mode 100644 index 00000000..75c37f29 --- /dev/null +++ b/manifests/compute/cert.pp @@ -0,0 +1,27 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# 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, + } + +} diff --git a/manifests/compute/conductor.pp b/manifests/compute/conductor.pp new file mode 100644 index 00000000..75267ea9 --- /dev/null +++ b/manifests/compute/conductor.pp @@ -0,0 +1,27 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# 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, + } + +} diff --git a/manifests/compute/consoleauth.pp b/manifests/compute/consoleauth.pp new file mode 100644 index 00000000..f805247b --- /dev/null +++ b/manifests/compute/consoleauth.pp @@ -0,0 +1,27 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# 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, + } + +} diff --git a/manifests/compute/consoleproxy.pp b/manifests/compute/consoleproxy.pp new file mode 100644 index 00000000..cef616a1 --- /dev/null +++ b/manifests/compute/consoleproxy.pp @@ -0,0 +1,38 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# 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' + } +} diff --git a/manifests/compute/controller.pp b/manifests/compute/controller.pp index ab4b53b9..925a5d08 100644 --- a/manifests/compute/controller.pp +++ b/manifests/compute/controller.pp @@ -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, } } diff --git a/manifests/compute/scheduler.pp b/manifests/compute/scheduler.pp new file mode 100644 index 00000000..a837db8b --- /dev/null +++ b/manifests/compute/scheduler.pp @@ -0,0 +1,27 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# 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, + } + +} diff --git a/manifests/image/api.pp b/manifests/image/api.pp index 37f7ee0f..c8a19f72 100644 --- a/manifests/image/api.pp +++ b/manifests/image/api.pp @@ -159,4 +159,4 @@ class cloud::image::api( ports => $ks_glance_api_internal_port, options => 'check inter 2000 rise 2 fall 5' } -} \ No newline at end of file +}