Add possibility to override `role` via underlay.hot
Add possibility to use different roles for nodes from MultipleInstance.
Add possibility to use several roles for one node (for the future)

Change-Id: I7e4e67dace4dc6e2fb3426cad8ddaac9cb5fb00b
diff --git a/tcp_tests/templates/_heat_environments/fragments/Compute.yaml b/tcp_tests/templates/_heat_environments/fragments/Compute.yaml
index ce89cdb..c3eb6ab 100644
--- a/tcp_tests/templates/_heat_environments/fragments/Compute.yaml
+++ b/tcp_tests/templates/_heat_environments/fragments/Compute.yaml
@@ -25,6 +25,9 @@
     type: string
   env_name:
     type: string
+  role:
+    type: comma_delimited_list
+    default: [salt_minion]
 
 resources:
   instance_port01:
@@ -85,8 +88,7 @@
             $node_domain: { get_param: instance_domain }
             $config_host: { get_param: instance_config_host }
       metadata:
-        roles:
-        - salt_minion
+        roles: { get_param: role }
 
 outputs:
   instance_address:
diff --git a/tcp_tests/templates/_heat_environments/fragments/FoundationNode.yaml b/tcp_tests/templates/_heat_environments/fragments/FoundationNode.yaml
index 91f058a..6923881 100644
--- a/tcp_tests/templates/_heat_environments/fragments/FoundationNode.yaml
+++ b/tcp_tests/templates/_heat_environments/fragments/FoundationNode.yaml
@@ -25,6 +25,9 @@
     type: string
   mcp_version:
     type: string
+  role:
+    type: comma_delimited_list
+    default: [foundation_jenkins_slave]
 
 resources:
   instance_port01:
@@ -78,8 +81,7 @@
             $node_domain: { get_param: instance_domain }
             $config_host: { get_param: instance_config_host }
       metadata:
-        roles:
-        - foundation_jenkins_slave
+        roles: { get_param: role }
 
   floating_ip:
     depends_on: [instance_instance]
diff --git a/tcp_tests/templates/_heat_environments/fragments/Instance.yaml b/tcp_tests/templates/_heat_environments/fragments/Instance.yaml
index b0c0e63..499628f 100644
--- a/tcp_tests/templates/_heat_environments/fragments/Instance.yaml
+++ b/tcp_tests/templates/_heat_environments/fragments/Instance.yaml
@@ -25,6 +25,9 @@
     type: string
   env_name:
     type: string
+  role:
+    type: comma_delimited_list
+    default: [salt_minion]
 
 resources:
   instance_port01:
@@ -79,8 +82,7 @@
             $node_domain: { get_param: instance_domain }
             $config_host: { get_param: instance_config_host }
       metadata:
-        roles:
-        - salt_minion
+        roles: { get_param: role }
 
 outputs:
   instance_address:
diff --git a/tcp_tests/templates/_heat_environments/fragments/MasterNode.yaml b/tcp_tests/templates/_heat_environments/fragments/MasterNode.yaml
index 885cace..b85b368 100644
--- a/tcp_tests/templates/_heat_environments/fragments/MasterNode.yaml
+++ b/tcp_tests/templates/_heat_environments/fragments/MasterNode.yaml
@@ -23,6 +23,9 @@
     type: string
   env_name:
     type: string
+  role:
+    type: comma_delimited_list
+    default: [salt_master]
 
 resources:
   instance_port01:
@@ -77,8 +80,7 @@
         image: { list_join: ['', [ 'cfg01.', { get_param: env_name }, '-config-drive.iso' ]] }
         volume_size: 1
       metadata:
-        roles:
-        - salt_master
+        roles: { get_param: role }
 
   floating_ip:
     depends_on: [instance_instance]
diff --git a/tcp_tests/templates/_heat_environments/fragments/MultipleInstance.yaml b/tcp_tests/templates/_heat_environments/fragments/MultipleInstance.yaml
index 986b855..1eb4dc3 100644
--- a/tcp_tests/templates/_heat_environments/fragments/MultipleInstance.yaml
+++ b/tcp_tests/templates/_heat_environments/fragments/MultipleInstance.yaml
@@ -25,6 +25,15 @@
     type: string
   instance03_control_net_static_ip:
     type: string
+  instance01_role:
+    type: comma_delimited_list
+    default: [salt_minion]
+  instance02_role:
+    type: comma_delimited_list
+    default: [salt_minion]
+  instance03_role:
+    type: comma_delimited_list
+    default: [salt_minion]
   underlay_userdata:
     type: string
   mcp_version:
@@ -42,6 +51,7 @@
       network: { get_param: network }
       control_net_static_ip: {get_param: instance01_control_net_static_ip }
       instance_name: { get_param: instance01_name }
+      role: { get_param: instance01_role }
       instance_domain: { get_param: instance_domain }
       instance_flavor: { get_param: instance_flavor }
       instance_config_host: { get_param: instance_config_host }
@@ -56,6 +66,7 @@
       network: { get_param: network }
       control_net_static_ip: {get_param: instance02_control_net_static_ip }
       instance_name: { get_param: instance02_name }
+      role: { get_param: instance02_role }
       instance_domain: { get_param: instance_domain }
       instance_flavor: { get_param: instance_flavor }
       instance_config_host: { get_param: instance_config_host }
@@ -70,6 +81,7 @@
       network: { get_param: network }
       control_net_static_ip: {get_param: instance03_control_net_static_ip }
       instance_name: { get_param: instance03_name }
+      role: { get_param: instance03_role }
       instance_domain: { get_param: instance_domain }
       instance_flavor: { get_param: instance_flavor }
       instance_config_host: { get_param: instance_config_host }
diff --git a/tcp_tests/templates/heat-cicd-k8s-contrail41-sl/underlay.hot b/tcp_tests/templates/heat-cicd-k8s-contrail41-sl/underlay.hot
index 4f550a7..ab909a5 100644
--- a/tcp_tests/templates/heat-cicd-k8s-contrail41-sl/underlay.hot
+++ b/tcp_tests/templates/heat-cicd-k8s-contrail41-sl/underlay.hot
@@ -87,6 +87,7 @@
       instance01_name: ctl01
       instance02_name: ctl02
       instance03_name: ctl03
+      instance01_role: k8s_controller
       instance_flavor: {get_param: ctl_flavor}
       network: { get_attr: [networks, network] }
       underlay_userdata: { get_file: ./underlay-userdata.yaml }