Merge "Add openstack_node_role parameter"
diff --git a/barbican/server/cluster.yml b/barbican/server/cluster.yml
index ed45b47..d8b570c 100644
--- a/barbican/server/cluster.yml
+++ b/barbican/server/cluster.yml
@@ -6,5 +6,6 @@
     cluster_internal_protocol: 'http'
   barbican:
     server:
+      role: ${_param:openstack_node_role}
       identity:
         protocol: ${_param:cluster_internal_protocol}
diff --git a/barbican/server/single.yml b/barbican/server/single.yml
index aab0b18..b115e79 100644
--- a/barbican/server/single.yml
+++ b/barbican/server/single.yml
@@ -5,5 +5,6 @@
     internal_protocol: 'http'
   barbican:
     server:
+      role: ${_param:openstack_node_role}
       identity:
         protocol: ${_param:internal_protocol}
diff --git a/ceilometer/server/cluster.yml b/ceilometer/server/cluster.yml
index f965451..ad804f8 100644
--- a/ceilometer/server/cluster.yml
+++ b/ceilometer/server/cluster.yml
@@ -13,6 +13,7 @@
       cluster: true
       secret: ${_param:ceilometer_secret_key}
       ttl: 86400
+      role: ${_param:openstack_node_role}
       notification:
         workload_partitioning: true
         batch_timeout: 30
diff --git a/ceilometer/server/single.yml b/ceilometer/server/single.yml
index 9758af2..ae642f1 100644
--- a/ceilometer/server/single.yml
+++ b/ceilometer/server/single.yml
@@ -3,6 +3,7 @@
 parameters:
   ceilometer:
     server:
+      role: ${_param:openstack_node_role}
       database:
         influxdb:
           host: ${_param:stacklight_monitor_node01_address}
diff --git a/cinder/control/cluster.yml b/cinder/control/cluster.yml
index 1110c63..b5d6862 100644
--- a/cinder/control/cluster.yml
+++ b/cinder/control/cluster.yml
@@ -25,6 +25,7 @@
       default_volume_type: ""
       backend: {}
       version: ${_param:cinder_version}
+      role: ${_param:openstack_node_role}
       osapi:
         host: ${_param:cluster_local_address}
       database:
diff --git a/cinder/control/single.yml b/cinder/control/single.yml
index d442693..89c5307 100644
--- a/cinder/control/single.yml
+++ b/cinder/control/single.yml
@@ -15,6 +15,7 @@
     controller:
       backend: {}
       default_volume_type: ''
+      role: ${_param:openstack_node_role}
       database:
         host: ${_param:single_address}
       identity:
diff --git a/designate/server/cluster.yml b/designate/server/cluster.yml
index afbb7df..f60f883 100644
--- a/designate/server/cluster.yml
+++ b/designate/server/cluster.yml
@@ -23,6 +23,7 @@
       region: ${_param:openstack_region}
       domain_id: ${_param:designate_domain_id}
       version: ${_param:designate_version}
+      role: ${_param:openstack_node_role}
       admin_api:
         enabled: ${_param:designate_admin_api_enabled}
         enabled_extensions_admin: quotas
diff --git a/designate/server/single.yml b/designate/server/single.yml
index 3fdd448..683180e 100644
--- a/designate/server/single.yml
+++ b/designate/server/single.yml
@@ -17,6 +17,7 @@
       region: ${_param:openstack_region}
       domain_id: ${_param:designate_domain_id}
       version: ${_param:designate_version}
+      role: ${_param:openstack_node_role}
       admin_api:
         enabled: ${_param:designate_admin_api_enabled}
         enabled_extensions_admin: quotas
diff --git a/glance/control/cluster.yml b/glance/control/cluster.yml
index bb87f16..e218835 100644
--- a/glance/control/cluster.yml
+++ b/glance/control/cluster.yml
@@ -15,6 +15,7 @@
       enabled: true
       version: ${_param:glance_version}
       workers: 8
+      role: ${_param:openstack_node_role}
       database:
         engine: mysql
         host: ${_param:openstack_database_address}
diff --git a/glance/control/single.yml b/glance/control/single.yml
index 5580b66..63e1b48 100644
--- a/glance/control/single.yml
+++ b/glance/control/single.yml
@@ -9,6 +9,7 @@
           version: latest
   glance:
     server:
+      role: ${_param:openstack_node_role}
       database:
         host: ${_param:single_address}
       identity:
diff --git a/gnocchi/server/cluster.yml b/gnocchi/server/cluster.yml
index 990fda2..ede63c5 100644
--- a/gnocchi/server/cluster.yml
+++ b/gnocchi/server/cluster.yml
@@ -12,6 +12,7 @@
   gnocchi:
     server:
       enable_proxy_headers_parsing: true
+      role: ${_param:openstack_node_role}
       metricd:
         metric_processing_delay: 15
         metric_reporting_delay: 30
diff --git a/gnocchi/server/single.yml b/gnocchi/server/single.yml
index d82dfee..11ddf39 100644
--- a/gnocchi/server/single.yml
+++ b/gnocchi/server/single.yml
@@ -3,6 +3,7 @@
 parameters:
   gnocchi:
     server:
+      role: ${_param:openstack_node_role}
       identity:
         region: ${_param:openstack_region}
       metricd:
diff --git a/heat/server/cluster.yml b/heat/server/cluster.yml
index 5829aee..eee2b63 100644
--- a/heat/server/cluster.yml
+++ b/heat/server/cluster.yml
@@ -22,6 +22,7 @@
       enabled: true
       region: ${_param:openstack_region}
       version: ${_param:heat_version}
+      role: ${_param:openstack_node_role}
       bind:
         api_cfn:
           address: ${_param:cluster_local_address}
diff --git a/heat/server/single.yml b/heat/server/single.yml
index 0c83206..e686050 100644
--- a/heat/server/single.yml
+++ b/heat/server/single.yml
@@ -9,6 +9,7 @@
           version: latest
   heat:
     server:
+      role: ${_param:openstack_node_role}
       region: ${_param:openstack_region}
       stack_domain_admin:
         name: heat_domain_admin
diff --git a/ironic/api/cluster.yml b/ironic/api/cluster.yml
index 5522f3f..b0bb69f 100644
--- a/ironic/api/cluster.yml
+++ b/ironic/api/cluster.yml
@@ -11,5 +11,6 @@
     api:
       enabled: true
       version: ${_param:ironic_version}
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:cluster_baremetal_local_address}
diff --git a/ironic/api/single.yml b/ironic/api/single.yml
index ed73e90..51c3f9c 100644
--- a/ironic/api/single.yml
+++ b/ironic/api/single.yml
@@ -9,5 +9,6 @@
           version: latest
   ironic:
     api:
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:single_address}
diff --git a/keystone/server/cluster.yml b/keystone/server/cluster.yml
index 0ae502b..7e6980b 100644
--- a/keystone/server/cluster.yml
+++ b/keystone/server/cluster.yml
@@ -6,6 +6,7 @@
 parameters:
   _param:
     keystone_tokens_expiration: 3600
+    openstack_node_role: primary
   linux:
     system:
       package:
@@ -25,6 +26,7 @@
       admin_name: admin
       admin_password: ${_param:keystone_admin_password}
       admin_email: ${_param:admin_email}
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:cluster_local_address}
         private_address: ${_param:cluster_vip_address}
diff --git a/keystone/server/single.yml b/keystone/server/single.yml
index 16c26ca..2b1e89e 100644
--- a/keystone/server/single.yml
+++ b/keystone/server/single.yml
@@ -8,6 +8,7 @@
     mysql_admin_password: password
     mysql_keystone_password: password
     keystone_tokens_expiration: 3600
+    openstack_node_role: primary
   linux:
     system:
       package:
@@ -24,6 +25,7 @@
       admin_name: admin
       admin_password: ${_param:keystone_admin_password}
       admin_email: ${_param:admin_email}
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:single_address}
         private_address: ${_param:single_address}
diff --git a/manila/control/cluster.yml b/manila/control/cluster.yml
index ff6ca10..7ea128b 100644
--- a/manila/control/cluster.yml
+++ b/manila/control/cluster.yml
@@ -10,6 +10,7 @@
     api:
       enabled: true
       version: ${_param:openstack_version}
+      role: ${_param:openstack_node_role}
     scheduler:
       enabled: true
       version: ${_param:openstack_version}
diff --git a/manila/control/single.yml b/manila/control/single.yml
index 3e14e96..262a158 100644
--- a/manila/control/single.yml
+++ b/manila/control/single.yml
@@ -9,6 +9,7 @@
     api:
       enabled: true
       version: ${_param:openstack_version}
+      role: ${_param:openstack_node_role}
     scheduler:
       enabled: true
       version: ${_param:openstack_version}
diff --git a/murano/server/cluster.yml b/murano/server/cluster.yml
index d698e7c..6c45f6d 100644
--- a/murano/server/cluster.yml
+++ b/murano/server/cluster.yml
@@ -8,6 +8,7 @@
     server:
       enabled: true
       version: ${_param:murano_version}
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:single_address}
         port: 8082
diff --git a/murano/server/single.yml b/murano/server/single.yml
index c3da9f8..938263d 100644
--- a/murano/server/single.yml
+++ b/murano/server/single.yml
@@ -6,6 +6,7 @@
     server:
       enabled: true
       version: ${_param:murano_version}
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:single_address}
         port: 8082
diff --git a/neutron/control/cluster.yml b/neutron/control/cluster.yml
index 166de3a..703f196 100644
--- a/neutron/control/cluster.yml
+++ b/neutron/control/cluster.yml
@@ -37,6 +37,7 @@
             params: check inter 10s fastinter 2s downinter 3s rise 3 fall 3
   neutron:
     server:
+      role: ${_param:openstack_node_role}
       plugin: contrail
     identity:
       protocol: ${_param:cluster_internal_protocol}
diff --git a/neutron/control/single.yml b/neutron/control/single.yml
index 067b4df..6196c0a 100644
--- a/neutron/control/single.yml
+++ b/neutron/control/single.yml
@@ -12,6 +12,7 @@
           version: latest
   neutron:
     server:
+      role: ${_param:openstack_node_role}
       database:
         host: ${_param:single_address}
       identity:
diff --git a/nova/control/cluster.yml b/nova/control/cluster.yml
index be5f775..90a2bae 100644
--- a/nova/control/cluster.yml
+++ b/nova/control/cluster.yml
@@ -30,6 +30,7 @@
       ram_allocation_ratio: ${_param:nova_ram_allocation_ratio}
       disk_allocation_ratio: ${_param:nova_disk_allocation_ratio}
       workers: 8
+      role: ${_param:openstack_node_role}
       bind:
         private_address: ${_param:cluster_local_address}
         public_address: ${_param:cluster_vip_address}
diff --git a/nova/control/single.yml b/nova/control/single.yml
index 07a3b01..4e3799b 100644
--- a/nova/control/single.yml
+++ b/nova/control/single.yml
@@ -11,6 +11,7 @@
           version: latest
   nova:
     controller:
+      role: ${_param:openstack_node_role}
       database:
         host: ${_param:single_address}
       identity:
diff --git a/octavia/api/cluster.yml b/octavia/api/cluster.yml
index 958f3d4..9e5d0c9 100644
--- a/octavia/api/cluster.yml
+++ b/octavia/api/cluster.yml
@@ -7,6 +7,7 @@
   octavia:
     api:
       enabled: true
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:cluster_local_address}
       database:
diff --git a/octavia/api/single.yml b/octavia/api/single.yml
index a9d30a5..ff76e76 100644
--- a/octavia/api/single.yml
+++ b/octavia/api/single.yml
@@ -6,6 +6,7 @@
   octavia:
     api:
       enabled: true
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:single_address}
       database:
diff --git a/reclass/storage/system/openstack_baremetal_cluster.yml b/reclass/storage/system/openstack_baremetal_cluster.yml
index 71f6034..ff6592f 100644
--- a/reclass/storage/system/openstack_baremetal_cluster.yml
+++ b/reclass/storage/system/openstack_baremetal_cluster.yml
@@ -21,6 +21,7 @@
             single_address: ${_param:openstack_baremetal_node01_address}
             keepalived_vip_priority: 101
             baremetal_address: ${_param:openstack_baremetal_node01_baremetal_address}
+            openstack_node_role: primary
         openstack_baremetal_node02:
           name: ${_param:openstack_baremetal_node02_hostname}
           domain: ${_param:cluster_domain}
@@ -32,6 +33,7 @@
             single_address: ${_param:openstack_baremetal_node02_address}
             keepalived_vip_priority: 102
             baremetal_address: ${_param:openstack_baremetal_node02_baremetal_address}
+            openstack_node_role: secondary
         openstack_baremetal_node03:
           name: ${_param:openstack_baremetal_node03_hostname}
           domain: ${_param:cluster_domain}
@@ -43,5 +45,6 @@
             single_address: ${_param:openstack_baremetal_node03_address}
             keepalived_vip_priority: 103
             baremetal_address: ${_param:openstack_baremetal_node03_baremetal_address}
+            openstack_node_role: secondary
 
 
diff --git a/reclass/storage/system/openstack_baremetal_single.yml b/reclass/storage/system/openstack_baremetal_single.yml
index 3b279b0..36e89d3 100644
--- a/reclass/storage/system/openstack_baremetal_single.yml
+++ b/reclass/storage/system/openstack_baremetal_single.yml
@@ -14,3 +14,4 @@
             linux_system_codename: ${_param:linux_system_codename}
             single_address: ${_param:openstack_baremetal_node01_address}
             baremetal_address: ${_param:openstack_baremetal_node01_baremetal_address}
+            openstack_node_role: primary
diff --git a/reclass/storage/system/openstack_control_cluster.yml b/reclass/storage/system/openstack_control_cluster.yml
index 300a04c..e05b3e9 100644
--- a/reclass/storage/system/openstack_control_cluster.yml
+++ b/reclass/storage/system/openstack_control_cluster.yml
@@ -19,6 +19,7 @@
             keepalived_vip_priority: 103
             opencontrail_database_id: 1
             rabbitmq_cluster_role: master
+            openstack_node_role: primary
         openstack_control_node02:
           name: ${_param:openstack_control_node02_hostname}
           domain: ${_param:cluster_domain}
@@ -31,6 +32,7 @@
             keepalived_vip_priority: 102
             opencontrail_database_id: 2
             rabbitmq_cluster_role: slave
+            openstack_node_role: secondary
         openstack_control_node03:
           name: ${_param:openstack_control_node03_hostname}
           domain: ${_param:cluster_domain}
@@ -43,3 +45,4 @@
             keepalived_vip_priority: 101
             opencontrail_database_id: 3
             rabbitmq_cluster_role: slave
+            openstack_node_role: secondary
diff --git a/reclass/storage/system/openstack_control_large.yml b/reclass/storage/system/openstack_control_large.yml
index 842e133..4ad2e90 100644
--- a/reclass/storage/system/openstack_control_large.yml
+++ b/reclass/storage/system/openstack_control_large.yml
@@ -19,6 +19,7 @@
             linux_system_codename: ${_param:openstack_control_system_codename}
             single_address: ${_param:openstack_control_node01_address}
             keepalived_vip_priority: 105
+            openstack_node_role: primary
         openstack_control_node02:
           name: ${_param:openstack_control_node02_hostname}
           domain: ${_param:cluster_domain}
@@ -29,6 +30,7 @@
             linux_system_codename: ${_param:openstack_control_system_codename}
             single_address: ${_param:openstack_control_node02_address}
             keepalived_vip_priority: 104
+            openstack_node_role: secondary
         openstack_control_node03:
           name: ${_param:openstack_control_node03_hostname}
           domain: ${_param:cluster_domain}
@@ -39,6 +41,7 @@
             linux_system_codename: ${_param:openstack_control_system_codename}
             single_address: ${_param:openstack_control_node03_address}
             keepalived_vip_priority: 103
+            openstack_node_role: secondary
         openstack_control_node04:
           name: ${_param:openstack_control_node04_hostname}
           domain: ${_param:cluster_domain}
@@ -49,6 +52,7 @@
             linux_system_codename: ${_param:openstack_control_system_codename}
             single_address: ${_param:openstack_control_node04_address}
             keepalived_vip_priority: 102
+            openstack_node_role: secondary
         openstack_control_node05:
           name: ${_param:openstack_control_node05_hostname}
           domain: ${_param:cluster_domain}
@@ -59,3 +63,4 @@
             linux_system_codename: ${_param:openstack_control_system_codename}
             single_address: ${_param:openstack_control_node05_address}
             keepalived_vip_priority: 101
+            openstack_node_role: secondary
diff --git a/reclass/storage/system/openstack_control_single.yml b/reclass/storage/system/openstack_control_single.yml
index e7329da..fe5c870 100644
--- a/reclass/storage/system/openstack_control_single.yml
+++ b/reclass/storage/system/openstack_control_single.yml
@@ -14,3 +14,4 @@
             salt_master_host: ${_param:reclass_config_master}
             linux_system_codename: ${_param:openstack_control_system_codename}
             single_address: ${_param:openstack_control_node01_address}
+            openstack_node_role: primary
diff --git a/reclass/storage/system/openstack_control_upgrade_single.yml b/reclass/storage/system/openstack_control_upgrade_single.yml
index e387062..b00cc81 100644
--- a/reclass/storage/system/openstack_control_upgrade_single.yml
+++ b/reclass/storage/system/openstack_control_upgrade_single.yml
@@ -14,3 +14,4 @@
             salt_master_host: ${_param:reclass_config_master}
             linux_system_codename: ${_param:openstack_upgrade_system_codename}
             single_address: ${_param:openstack_upgrade_node01_address}
+            openstack_node_role: primary
diff --git a/reclass/storage/system/openstack_telemetry_cluster.yml b/reclass/storage/system/openstack_telemetry_cluster.yml
index 9dc6457..c33a8db 100644
--- a/reclass/storage/system/openstack_telemetry_cluster.yml
+++ b/reclass/storage/system/openstack_telemetry_cluster.yml
@@ -17,6 +17,7 @@
             linux_system_codename: ${_param:openstack_telemetry_system_codename}
             single_address: ${_param:openstack_telemetry_node01_address}
             keepalived_vip_priority: 103
+            openstack_node_role: primary
         openstack_telemetry_node02:
           name: ${_param:openstack_telemetry_node02_hostname}
           domain: ${_param:cluster_domain}
@@ -27,6 +28,7 @@
             linux_system_codename: ${_param:openstack_telemetry_system_codename}
             single_address: ${_param:openstack_telemetry_node02_address}
             keepalived_vip_priority: 102
+            openstack_node_role: secondary
         openstack_telemetry_node03:
           name: ${_param:openstack_telemetry_node03_hostname}
           domain: ${_param:cluster_domain}
@@ -37,3 +39,4 @@
             linux_system_codename: ${_param:openstack_telemetry_system_codename}
             single_address: ${_param:openstack_telemetry_node03_address}
             keepalived_vip_priority: 101
+            openstack_node_role: secondary
diff --git a/sahara/server/cluster.yml b/sahara/server/cluster.yml
index cdb7b04..b01ab3d 100644
--- a/sahara/server/cluster.yml
+++ b/sahara/server/cluster.yml
@@ -9,6 +9,7 @@
       enabled: true
       version: ${_param:sahara_version}
       notification: false
+      role: ${_param:openstack_node_role}
       bind:
         address: ${_param:single_address}
         port: 8386
diff --git a/sahara/server/single.yml b/sahara/server/single.yml
index 01e7b38..fcb26c9 100644
--- a/sahara/server/single.yml
+++ b/sahara/server/single.yml
@@ -5,6 +5,7 @@
     server:
       enabled: true
       version: ${_param:sahara_version}
+      role: ${_param:openstack_node_role}
       bind:
         host: ${_param:single_address}
         port: 8386