From a0c3df6eaeb359d3086bd09bad6dc0281534b604 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 1 Mar 2016 14:24:51 -0500 Subject: [PATCH] scenario002: deploy RabbitMQ with IPv6 binding * Configure RabbitMQ to bind on IPv6 (scenario002 only). * Configure OpenStack service to connect with an IPv6 on RabbitMQ (scenario002 only). Change-Id: I0e4ab4b03d7b1c7bb47c55a751bc04f29292a621 --- README.md | 1 + fixtures/scenario002.pp | 3 ++- manifests/cinder.pp | 2 +- manifests/config.pp | 18 +++++++++++++++++- manifests/glance.pp | 2 +- manifests/ironic.pp | 2 +- manifests/neutron.pp | 2 +- manifests/nova.pp | 2 +- manifests/rabbitmq.pp | 20 +++++++++++--------- 9 files changed, 36 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 44f418a02..f92f85e5c 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ scenario](#All-In-One). | - | scenario001 | scenario002 | scenario003 | scenario-aio | |:----------:|:-----------:|:-----------:|:-----------:|:-------------: | ssl | no | yes | no | no | +| ipv6 | no | yes | no | no | | keystone | X | X | X | X | | glance | rbd | swift | file | file | | nova | rbd | X | X | X | diff --git a/fixtures/scenario002.pp b/fixtures/scenario002.pp index d98ee5d86..8999b67e3 100644 --- a/fixtures/scenario002.pp +++ b/fixtures/scenario002.pp @@ -16,7 +16,8 @@ include ::openstack_integration class { '::openstack_integration::config': - ssl => true, + ssl => true, + ipv6 => true, } include ::openstack_integration::cacert include ::openstack_integration::rabbitmq diff --git a/manifests/cinder.pp b/manifests/cinder.pp index 345152ab8..68e7508ff 100644 --- a/manifests/cinder.pp +++ b/manifests/cinder.pp @@ -33,7 +33,7 @@ class openstack_integration::cinder ( } class { '::cinder': database_connection => 'mysql+pymysql://cinder:cinder@127.0.0.1/cinder?charset=utf8', - rabbit_host => '127.0.0.1', + rabbit_host => $::openstack_integration::config::rabbit_host, rabbit_port => $::openstack_integration::config::rabbit_port, rabbit_userid => 'cinder', rabbit_password => 'an_even_bigger_secret', diff --git a/manifests/config.pp b/manifests/config.pp index 114568ffb..16c85d69d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -4,8 +4,13 @@ # (optional) Boolean to enable or not SSL. # Defaults to false. # +# [*ipv6*] +# (optional) Boolean to enable or not IPv6. +# Defaults to false. +# class openstack_integration::config ( - $ssl = false, + $ssl = false, + $ipv6 = false, ) { if $ssl { @@ -14,4 +19,15 @@ class openstack_integration::config ( $rabbit_port = '5672' } + if $ipv6 { + $rabbit_host = '[::1]' + $rabbit_env = { + 'RABBITMQ_NODE_IP_ADDRESS' => '::1', + 'RABBITMQ_SERVER_START_ARGS' => '"-proto_dist inet6_tcp"', + } + } else { + $rabbit_host = '127.0.0.1' + $rabbit_env = {} + } + } diff --git a/manifests/glance.pp b/manifests/glance.pp index 28f83985a..465b914c9 100644 --- a/manifests/glance.pp +++ b/manifests/glance.pp @@ -80,7 +80,7 @@ class openstack_integration::glance ( class { '::glance::notify::rabbitmq': rabbit_userid => 'glance', rabbit_password => 'an_even_bigger_secret', - rabbit_host => '127.0.0.1', + rabbit_host => $::openstack_integration::config::rabbit_host, rabbit_port => $::openstack_integration::config::rabbit_port, notification_driver => 'messagingv2', rabbit_use_ssl => $::openstack_integration::config::ssl, diff --git a/manifests/ironic.pp b/manifests/ironic.pp index 731bf8a07..4fcfa2390 100644 --- a/manifests/ironic.pp +++ b/manifests/ironic.pp @@ -19,7 +19,7 @@ class openstack_integration::ironic { class { '::ironic': rabbit_userid => 'ironic', rabbit_password => 'an_even_bigger_secret', - rabbit_host => '127.0.0.1', + rabbit_host => $::openstack_integration::config::rabbit_host, rabbit_port => $::openstack_integration::config::rabbit_port, rabbit_use_ssl => $::openstack_integration::config::ssl, database_connection => 'mysql+pymysql://ironic:ironic@127.0.0.1/ironic?charset=utf8', diff --git a/manifests/neutron.pp b/manifests/neutron.pp index 9358c6a37..cbde0f187 100644 --- a/manifests/neutron.pp +++ b/manifests/neutron.pp @@ -25,7 +25,7 @@ class openstack_integration::neutron { class { '::neutron': rabbit_user => 'neutron', rabbit_password => 'an_even_bigger_secret', - rabbit_host => '127.0.0.1', + rabbit_host => $::openstack_integration::config::rabbit_host, rabbit_port => $::openstack_integration::config::rabbit_port, rabbit_use_ssl => $::openstack_integration::config::ssl, allow_overlapping_ips => true, diff --git a/manifests/nova.pp b/manifests/nova.pp index da7e2878e..7c00de35f 100644 --- a/manifests/nova.pp +++ b/manifests/nova.pp @@ -37,7 +37,7 @@ class openstack_integration::nova ( class { '::nova': database_connection => 'mysql+pymysql://nova:nova@127.0.0.1/nova?charset=utf8', api_database_connection => 'mysql+pymysql://nova_api:nova@127.0.0.1/nova_api?charset=utf8', - rabbit_host => '127.0.0.1', + rabbit_host => $::openstack_integration::config::rabbit_host, rabbit_port => $::openstack_integration::config::rabbit_port, rabbit_userid => 'nova', rabbit_password => 'an_even_bigger_secret', diff --git a/manifests/rabbitmq.pp b/manifests/rabbitmq.pp index d12b33d1c..d13817c9d 100644 --- a/manifests/rabbitmq.pp +++ b/manifests/rabbitmq.pp @@ -29,18 +29,20 @@ class openstack_integration::rabbitmq { notify => Service['rabbitmq-server'], } class { '::rabbitmq': - delete_guest_user => true, - package_provider => $package_provider, - ssl => true, - ssl_only => true, - ssl_cacert => $::openstack_integration::params::cacert_path, - ssl_cert => $::openstack_integration::params::cert_path, - ssl_key => "/etc/rabbitmq/ssl/private/${::fqdn}.pem", + delete_guest_user => true, + package_provider => $package_provider, + ssl => true, + ssl_only => true, + ssl_cacert => $::openstack_integration::params::cacert_path, + ssl_cert => $::openstack_integration::params::cert_path, + ssl_key => "/etc/rabbitmq/ssl/private/${::fqdn}.pem", + environment_variables => $::openstack_integration::config::rabbit_env, } } else { class { '::rabbitmq': - delete_guest_user => true, - package_provider => $package_provider, + delete_guest_user => true, + package_provider => $package_provider, + environment_variables => $::openstack_integration::config::rabbit_env, } } rabbitmq_vhost { '/':