Centralize setting internal_protocol

Internal Openstack APIs may be encrypted with https. This patch
centralize setting internal API protocol among services by
setting one of depending if cluster or single models are used:
  cluster_internal_protocol: 'https'
  internal_protocol: 'https'

Change-Id: I2baff79cd5851678559d7de47460fdd2031f70ee
diff --git a/nova/compute/cluster.yml b/nova/compute/cluster.yml
index 5d0e6a1..f32fffd 100644
--- a/nova/compute/cluster.yml
+++ b/nova/compute/cluster.yml
@@ -35,6 +35,7 @@
       7xDyBz85icFU0rceYQetwFH2p5tRL0GcUQhJmJFgIL0OXdCQvRNJrT3iS00N1aUo
       SG9MrLHCd5l60aCUQg0UA5ed7Hd6SA314k+HwxJno9/wJ+voBeacMg==
       -----END RSA PRIVATE KEY-----
+    cluster_internal_protocol: 'http'
   openssh:
     client:
       enabled: True
@@ -68,6 +69,7 @@
         user: nova
         password: ${_param:keystone_nova_password}
         tenant: service
+        protocol: ${_param:cluster_internal_protocol}
       message_queue:
         engine: rabbitmq
         port: 5672
@@ -82,6 +84,7 @@
         engine: glance
         host: ${_param:cluster_vip_address}
         port: 9292
+        protocol: ${_param:cluster_internal_protocol}
       network:
         engine: neutron
         region: ${_param:openstack_region}
@@ -90,6 +93,7 @@
         user: neutron
         tenant: service
         password: ${_param:keystone_neutron_password}
+        protocol: ${_param:cluster_internal_protocol}
       user:
         public_key: ${_param:nova_compute_ssh_public}
         private_key: ${_param:nova_compute_ssh_private}
diff --git a/nova/compute/single.yml b/nova/compute/single.yml
index b915145..483a1d3 100644
--- a/nova/compute/single.yml
+++ b/nova/compute/single.yml
@@ -35,6 +35,7 @@
       7xDyBz85icFU0rceYQetwFH2p5tRL0GcUQhJmJFgIL0OXdCQvRNJrT3iS00N1aUo
       SG9MrLHCd5l60aCUQg0UA5ed7Hd6SA314k+HwxJno9/wJ+voBeacMg==
       -----END RSA PRIVATE KEY-----
+    cluster_internal_protocol: 'http'
   openssh:
     client:
       enabled: True
@@ -66,6 +67,7 @@
         user: nova
         password: ${_param:keystone_nova_password}
         tenant: service
+        protocol: ${_param:cluster_internal_protocol}
       message_queue:
         engine: rabbitmq
         host: ${_param:control_address}
@@ -77,10 +79,12 @@
         engine: glance
         host: ${_param:control_address}
         port: 9292
+        protocol: ${_param:cluster_internal_protocol}
       network:
         engine: neutron
         host: ${_param:control_address}
         port: 9696
+        protocol: ${_param:cluster_internal_protocol}
       cache:
         engine: memcached
         members:
diff --git a/nova/compute_ironic/cluster.yml b/nova/compute_ironic/cluster.yml
index 2526373..885a869 100644
--- a/nova/compute_ironic/cluster.yml
+++ b/nova/compute_ironic/cluster.yml
@@ -1,6 +1,8 @@
 classes:
 - service.nova.compute.ironic
 parameters:
+  _param:
+    cluster_internal_protocol: 'http'
   nova:
     compute:
       version: ${_param:nova_version}
@@ -23,6 +25,7 @@
         user: nova
         password: ${_param:keystone_nova_password}
         tenant: service
+        protocol: ${_param:cluster_internal_protocol}
       message_queue:
         engine: rabbitmq
         port: 5672
@@ -41,6 +44,9 @@
         user: neutron
         tenant: service
         password: ${_param:keystone_neutron_password}
+        protocol: ${_param:cluster_internal_protocol}
+      glance:
+        protocol: ${_param:cluster_internal_protocol}
       ironic:
         region: ${_param:openstack_region}
         host: ${_param:ironic_service_host}
@@ -51,3 +57,4 @@
         auth_type: password
         project_domain_name: Default
         user_domain_name: Default
+        protocol: ${_param:cluster_internal_protocol}
diff --git a/nova/compute_ironic/single.yml b/nova/compute_ironic/single.yml
index 5c19023..69025d3 100644
--- a/nova/compute_ironic/single.yml
+++ b/nova/compute_ironic/single.yml
@@ -1,6 +1,8 @@
 classes:
 - service.nova.compute.ironic
 parameters:
+  _param:
+    cluster_internal_protocol: 'http'
   nova:
     compute:
       version: ${_param:nova_version}
@@ -23,6 +25,7 @@
         user: nova
         password: ${_param:keystone_nova_password}
         tenant: service
+        protocol: ${_param:cluster_internal_protocol}
       message_queue:
         engine: rabbitmq
         port: 5672
@@ -38,6 +41,9 @@
         user: neutron
         tenant: service
         password: ${_param:keystone_neutron_password}
+        protocol: ${_param:cluster_internal_protocol}
+      glance:
+        protocol: ${_param:cluster_internal_protocol}
       ironic:
         region: ${_param:openstack_region}
         host: ${_param:control_address}
@@ -45,3 +51,4 @@
         user: ironic
         tenant: service
         password: ${_param:keystone_ironic_password}
+        protocol: ${_param:cluster_internal_protocol}
diff --git a/nova/control/cluster.yml b/nova/control/cluster.yml
index f583156..be5f775 100644
--- a/nova/control/cluster.yml
+++ b/nova/control/cluster.yml
@@ -11,6 +11,7 @@
     nova_ram_allocation_ratio: 1.5
     nova_disk_allocation_ratio: 1.0
     metadata_password: metadataPass
+    cluster_internal_protocol: 'http'
   linux:
     system:
       package:
@@ -50,6 +51,7 @@
         user: nova
         password: ${_param:keystone_nova_password}
         tenant: service
+        protocol: ${_param:cluster_internal_protocol}
       message_queue:
         engine: rabbitmq
         port: 5672
@@ -63,6 +65,7 @@
       glance:
         host: ${_param:cluster_vip_address}
         port: 9292
+        protocol: ${_param:cluster_internal_protocol}
       network:
         engine: neutron
         region: ${_param:openstack_region}
@@ -72,5 +75,6 @@
         port: 9696
         mtu: 1500
         tenant: service
+        protocol: ${_param:cluster_internal_protocol}
       metadata:
         password: ${_param:metadata_password}
diff --git a/nova/control/single.yml b/nova/control/single.yml
index c2aef10..ca21d05 100644
--- a/nova/control/single.yml
+++ b/nova/control/single.yml
@@ -1,6 +1,8 @@
 classes:
 - service.nova.control.single
 parameters:
+  _param:
+    cluster_internal_protocol: 'http'
   linux:
     system:
       package:
@@ -11,3 +13,9 @@
     controller:
       database:
         host: ${_param:single_address}
+      identity:
+        protocol: ${_param:cluster_internal_protocol}
+      network:
+        protocol: ${_param:cluster_internal_protocol}
+      glance:
+        protocol: ${_param:cluster_internal_protocol}