Switch computes in cicd-k8s deployments from generation to inventory

Auto-registration for k8s compute nodes has been introduced to CC,
but there is no inventory provider to use it for 'auto' registration.

For testing, use custom inventory provider (fuel-devops) and mapping
(environment-templates),

Change-Id: I2665040ae772003e98336697383d355577f16e57
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/cookiecutter-context-k8s-sl.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/cookiecutter-context-k8s-sl.yaml
index f70d915..898017e 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/cookiecutter-context-k8s-sl.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/cookiecutter-context-k8s-sl.yaml
@@ -109,11 +109,6 @@
   internal_proxy_enabled: 'False'
   kqueen_custom_mail_enabled: 'False'
   kqueen_enabled: 'False'
-  kubernetes_compute_count: 2
-  kubernetes_compute_rack01_deploy_subnet: 10.167.5
-  kubernetes_compute_rack01_single_subnet: 10.167.4
-  kubernetes_compute_rack01_tenant_subnet: 10.167.6
-  kubernetes_compute_rack01_hostname: cmp
   kubernetes_control_address: 10.167.4.10
   kubernetes_control_node01_address: 10.167.4.11
   kubernetes_control_node01_deploy_address: 10.167.5.11
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/environment-context-k8s-sl.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/environment-context-k8s-sl.yaml
index 2b89364..0a07a81 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/environment-context-k8s-sl.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/environment-context-k8s-sl.yaml
@@ -109,9 +109,8 @@
         ens4:
           role: single_ctl
 
-    # Generator-based computes. For compatibility only
-    cmp<<count>>:
-      reclass_storage_name: kubernetes_compute_rack01
+    cmp001:
+      reclass_storage_name: kubernetes_compute_node01
       roles:
       - kubernetes_compute
       - linux_system_codename_xenial
@@ -121,6 +120,20 @@
           role: single_dhcp
         ens4:
           role: single_ctl
+          single_address: ${_param:kubernetes_compute_node01_address}
+
+    cmp002:
+      reclass_storage_name: kubernetes_compute_node02
+      roles:
+      - kubernetes_compute
+      - linux_system_codename_xenial
+      - salt_master_host
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+          single_address: ${_param:kubernetes_compute_node02_address}
 
     mon01:
       reclass_storage_name: stacklight_server_node01
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico/cookiecutter-context-k8s.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico/cookiecutter-context-k8s.yaml
index 5eae395..2f0e52e 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico/cookiecutter-context-k8s.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico/cookiecutter-context-k8s.yaml
@@ -109,11 +109,6 @@
   internal_proxy_enabled: 'False'
   kqueen_custom_mail_enabled: 'False'
   kqueen_enabled: 'False'
-  kubernetes_compute_count: 2
-  kubernetes_compute_rack01_deploy_subnet: 10.167.5
-  kubernetes_compute_rack01_single_subnet: 10.167.4
-  kubernetes_compute_rack01_tenant_subnet: 10.167.6
-  kubernetes_compute_rack01_hostname: cmp
   kubernetes_control_address: 10.167.4.10
   kubernetes_control_node01_address: 10.167.4.11
   kubernetes_control_node01_deploy_address: 10.167.5.11
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico/environment-context-k8s.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico/environment-context-k8s.yaml
index 66d7cec..4c01f4f 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico/environment-context-k8s.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico/environment-context-k8s.yaml
@@ -109,9 +109,8 @@
         ens4:
           role: single_ctl
 
-    # Generator-based computes. For compatibility only
-    cmp<<count>>:
-      reclass_storage_name: kubernetes_compute_rack01
+    cmp001:
+      reclass_storage_name: kubernetes_compute_node01
       roles:
       - kubernetes_compute
       - linux_system_codename_xenial
@@ -121,3 +120,17 @@
           role: single_dhcp
         ens4:
           role: single_ctl
+          single_address: ${_param:kubernetes_compute_node01_address}
+
+    cmp002:
+      reclass_storage_name: kubernetes_compute_node02
+      roles:
+      - kubernetes_compute
+      - linux_system_codename_xenial
+      - salt_master_host
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+          single_address: ${_param:kubernetes_compute_node02_address}
diff --git a/tcp_tests/templates/cookied-cicd-k8s-genie/cookiecutter-context-k8s-genie.yaml b/tcp_tests/templates/cookied-cicd-k8s-genie/cookiecutter-context-k8s-genie.yaml
index 27eb637..48e91fd 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-genie/cookiecutter-context-k8s-genie.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-genie/cookiecutter-context-k8s-genie.yaml
@@ -109,11 +109,6 @@
   internal_proxy_enabled: 'False'
   kqueen_custom_mail_enabled: 'False'
   kqueen_enabled: 'False'
-  kubernetes_compute_count: 2
-  kubernetes_compute_rack01_deploy_subnet: 10.167.5
-  kubernetes_compute_rack01_single_subnet: 10.167.4
-  kubernetes_compute_rack01_tenant_subnet: 10.167.6
-  kubernetes_compute_rack01_hostname: cmp
   kubernetes_control_address: 10.167.4.10
   kubernetes_control_node01_address: 10.167.4.11
   kubernetes_control_node01_deploy_address: 10.167.5.11
diff --git a/tcp_tests/templates/cookied-cicd-k8s-genie/environment-context-k8s-genie.yaml b/tcp_tests/templates/cookied-cicd-k8s-genie/environment-context-k8s-genie.yaml
index 66d7cec..4c01f4f 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-genie/environment-context-k8s-genie.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-genie/environment-context-k8s-genie.yaml
@@ -109,9 +109,8 @@
         ens4:
           role: single_ctl
 
-    # Generator-based computes. For compatibility only
-    cmp<<count>>:
-      reclass_storage_name: kubernetes_compute_rack01
+    cmp001:
+      reclass_storage_name: kubernetes_compute_node01
       roles:
       - kubernetes_compute
       - linux_system_codename_xenial
@@ -121,3 +120,17 @@
           role: single_dhcp
         ens4:
           role: single_ctl
+          single_address: ${_param:kubernetes_compute_node01_address}
+
+    cmp002:
+      reclass_storage_name: kubernetes_compute_node02
+      roles:
+      - kubernetes_compute
+      - linux_system_codename_xenial
+      - salt_master_host
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+          single_address: ${_param:kubernetes_compute_node02_address}
diff --git a/tcp_tests/templates/cookied-model-generator/salt_cookied-cicd-k8s-genie.yaml b/tcp_tests/templates/cookied-model-generator/salt_cookied-cicd-k8s-genie.yaml
index eb9a3dc..130d95a 100644
--- a/tcp_tests/templates/cookied-model-generator/salt_cookied-cicd-k8s-genie.yaml
+++ b/tcp_tests/templates/cookied-model-generator/salt_cookied-cicd-k8s-genie.yaml
@@ -18,16 +18,16 @@
 
 {{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
 
-#- description: "Workaround for computes"
-#  cmd: |
-#    set -e;
-#    . /root/venv-reclass-tools/bin/activate;
-#    # Workaround for compute nodes. Auto-registration for compute nodes cannot be used without external address inventory
-#    reclass-tools add-key parameters._param.kubernetes_compute_node01_address {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.101 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/kubernetes/init.yml;
-#    reclass-tools add-key parameters._param.kubernetes_compute_node02_address {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.102 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/kubernetes/init.yml;
-#
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 5}
-#  skip_fail: false
+- description: "Workaround for computes"
+  cmd: |
+    set -e;
+    . /root/venv-reclass-tools/bin/activate;
+    # Workaround for compute nodes. Auto-registration for compute nodes cannot be used without external address inventory
+    reclass-tools add-key parameters._param.kubernetes_compute_node01_address {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.101 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/kubernetes/init.yml;
+    reclass-tools add-key parameters._param.kubernetes_compute_node02_address {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.102 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/kubernetes/init.yml;
+
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
 
 {{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }}