Add Rabbit IPv6 only support
authorMartin Mágr <mmagr@redhat.com>
Mon, 18 Jan 2016 13:57:43 +0000 (14:57 +0100)
committerEmilien Macchi <emilien@redhat.com>
Wed, 9 Mar 2016 04:36:01 +0000 (04:36 +0000)
Adds Rabbit environment variable required for IPv6 only support

Change-Id: Iec209ca83a5b0708ac828c4afaf9d2222e597f24

environments/network-isolation-v6.yaml
overcloud.yaml
puppet/controller.yaml
puppet/manifests/overcloud_controller.pp
puppet/manifests/overcloud_controller_pacemaker.pp

index d1d0818..4c07174 100644 (file)
@@ -49,3 +49,5 @@ parameter_defaults:
   MongoDbIPv6: True
   # Enable various IPv6 features in Nova.
   NovaIPv6: True
+  # Enable IPv6 environment for RabbitMQ.
+  RabbitIPv6: true
index 343b1bc..4dae673 100644 (file)
@@ -303,6 +303,10 @@ parameters:
     default: 16384
     description: Configures RabbitMQ FD limit
     type: string
+  RabbitIPv6:
+    default: false
+    description: Enable IPv6 in RabbitMQ
+    type: boolean
   SnmpdReadonlyUserName:
     default: ro_snmp_user
     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
@@ -983,6 +987,7 @@ resources:
           RabbitClientUseSSL: {get_param: RabbitClientUseSSL}
           RabbitClientPort: {get_param: RabbitClientPort}
           RabbitFDLimit: {get_param: RabbitFDLimit}
+          RabbitIPv6: {get_param: RabbitIPv6}
           SaharaPassword: {get_param: SaharaPassword}
           SnmpdReadonlyUserName: {get_param: SnmpdReadonlyUserName}
           SnmpdReadonlyUserPassword: {get_param: SnmpdReadonlyUserPassword}
index c97012d..1d506a7 100644 (file)
@@ -617,6 +617,10 @@ parameters:
     default: 16384
     description: Configures RabbitMQ FD limit
     type: string
+  RabbitIPv6:
+    default: false
+    description: Enable IPv6 in RabbitMQ
+    type: boolean
   RedisVirtualIP:
     type: string
     default: ''  # Has to be here because of the ignored empty value bug
@@ -1185,6 +1189,7 @@ resources:
         rabbit_cookie: {get_param: RabbitCookie}
         rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
         rabbit_client_port: {get_param: RabbitClientPort}
+        rabbit_ipv6: {get_param: RabbitIPv6}
         mongodb_no_journal: {get_param: MongoDbNoJournal}
         mongodb_ipv6: {get_param: MongoDbIPv6}
         # We need to force this into quotes or hiera will return integer causing
@@ -1603,6 +1608,7 @@ resources:
                 rabbitmq::file_limit: {get_input: rabbit_fd_limit}
                 rabbitmq::default_user: {get_input: rabbit_username}
                 rabbitmq::default_pass: {get_input: rabbit_password}
+                rabbit_ipv6: {get_input: rabbit_ipv6}
                 # Redis
                 redis::bind: {get_input: redis_network}
                 redis_vip: {get_input: redis_vip}
index 0d6a238..b8600cf 100644 (file)
@@ -117,13 +117,23 @@ if hiera('step') >= 2 {
 
   $rabbit_nodes = hiera('rabbit_node_ips')
   if count($rabbit_nodes) > 1 {
+
+    $rabbit_ipv6 = str2bool(hiera('rabbit_ipv6', false))
+    if $rabbit_ipv6 {
+      $rabbit_env = merge(hiera('rabbitmq_environment'), {
+        'RABBITMQ_SERVER_START_ARGS' => '"-proto_dist inet6_tcp"'
+      })
+    } else {
+      $rabbit_env = hiera('rabbitmq_environment')
+    }
+
     class { '::rabbitmq':
       config_cluster          => true,
       cluster_nodes           => $rabbit_nodes,
       tcp_keepalive           => false,
       config_kernel_variables => hiera('rabbitmq_kernel_variables'),
       config_variables        => hiera('rabbitmq_config_variables'),
-      environment_variables   => hiera('rabbitmq_environment'),
+      environment_variables   => $rabbit_env,
     }
     rabbitmq_policy { 'ha-all@/':
       pattern    => '^(?!amq\.).*',
index 2bb081a..ba8c449 100644 (file)
@@ -100,12 +100,21 @@ if hiera('step') >= 1 {
   # avoid races where non-master nodes attempt to start without
   # config (eg. binding on 0.0.0.0)
   # The module ignores erlang_cookie if cluster_config is false
+  $rabbit_ipv6 = str2bool(hiera('rabbit_ipv6', false))
+  if $rabbit_ipv6 {
+      $rabbit_env = merge(hiera('rabbitmq_environment'), {
+        'RABBITMQ_SERVER_START_ARGS' => '"-proto_dist inet6_tcp"'
+      })
+  } else {
+    $rabbit_env = hiera('rabbitmq_environment')
+  }
+
   class { '::rabbitmq':
     service_manage          => false,
     tcp_keepalive           => false,
     config_kernel_variables => hiera('rabbitmq_kernel_variables'),
     config_variables        => hiera('rabbitmq_config_variables'),
-    environment_variables   => hiera('rabbitmq_environment'),
+    environment_variables   => $rabbit_env,
   } ->
   file { '/var/lib/rabbitmq/.erlang.cookie':
     ensure  => file,