Unhardcode hardware nodes for BM-deployments

Move rebooting these nodes from pre-deploy stage to
salt-installing stage

Remove REBOOT_HW_NODES parameter from BM jenkins jobs

Related-Prod:#MOSSUST-110


Change-Id: Ie79d7e21967b90051b29201939ed0165a35d2f13
diff --git a/tcp_tests/templates/bm-cicd-pike-ovs-maas/salt.yaml b/tcp_tests/templates/bm-cicd-pike-ovs-maas/salt.yaml
index a31051f..f0b727e 100644
--- a/tcp_tests/templates/bm-cicd-pike-ovs-maas/salt.yaml
+++ b/tcp_tests/templates/bm-cicd-pike-ovs-maas/salt.yaml
@@ -5,6 +5,7 @@
 {% import 'shared-salt.yaml' as SHARED with context %}
 {% import 'shared-test-tools.yaml' as SHARED_TEST_TOOLS with context %}
 {% import 'shared-workarounds.yaml' as SHARED_WORKAROUNDS with context %}
+{% import 'shared-maas.yaml' as SHARED_MAAS with context %}
 
 - description: Wait for salt-master is ready after configdrive user-data
   cmd: |
@@ -14,6 +15,24 @@
   skip_fail: false
 
 {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
+{{ SHARED_MAAS.REBOOT_HW_NODES('engineer', 'KBwdcRqwed3w2',
+  [
+      "185.8.59.227",
+      "185.8.59.229",
+      "5.43.225.88",
+      "5.43.225.112",
+      "5.43.225.208",
+      "5.43.227.118",
+      "185.8.58.248",
+      "185.8.59.222",
+      "5.43.225.228",
+      "5.43.229.28",
+      "5.43.225.23",
+      "185.8.58.9",
+      "185.8.58.246",
+      "185.8.58.243",
+      "185.8.58.244"
+  ]) }}
 
 {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
 
diff --git a/tcp_tests/templates/bm-cicd-queens-ovs-maas/salt.yaml b/tcp_tests/templates/bm-cicd-queens-ovs-maas/salt.yaml
index 9fc0dfe..f008071 100644
--- a/tcp_tests/templates/bm-cicd-queens-ovs-maas/salt.yaml
+++ b/tcp_tests/templates/bm-cicd-queens-ovs-maas/salt.yaml
@@ -5,6 +5,7 @@
 {% import 'shared-salt.yaml' as SHARED with context %}
 {% import 'shared-test-tools.yaml' as SHARED_TEST_TOOLS with context %}
 {% import 'shared-workarounds.yaml' as SHARED_WORKAROUNDS with context %}
+{% import 'shared-maas.yaml' as SHARED_MAAS with context %}
 
 - description: Wait for salt-master is ready after configdrive user-data
   cmd: |
@@ -14,6 +15,24 @@
   skip_fail: false
 
 {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
+{{ SHARED_MAAS.REBOOT_HW_NODES('engineer', 'KBwdcRqwed3w2',
+  [
+      "185.8.59.227",
+      "185.8.59.229",
+      "5.43.225.88",
+      "5.43.225.112",
+      "5.43.225.208",
+      "5.43.227.118",
+      "185.8.58.248",
+      "185.8.59.222",
+      "5.43.225.228",
+      "5.43.229.28",
+      "5.43.225.23",
+      "185.8.58.9",
+      "185.8.58.246",
+      "185.8.58.243",
+      "185.8.58.244"
+  ]) }}
 
 {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
 
diff --git a/tcp_tests/templates/heat-bm-cicd-pike-contrail-sl/salt.yaml b/tcp_tests/templates/heat-bm-cicd-pike-contrail-sl/salt.yaml
index 46393c3..d069df0 100644
--- a/tcp_tests/templates/heat-bm-cicd-pike-contrail-sl/salt.yaml
+++ b/tcp_tests/templates/heat-bm-cicd-pike-contrail-sl/salt.yaml
@@ -7,6 +7,7 @@
 {% import 'shared-salt.yaml' as SHARED with context %}
 {% import 'shared-test-tools.yaml' as SHARED_TEST_TOOLS with context %}
 {% import 'shared-workarounds.yaml' as SHARED_WORKAROUNDS with context %}
+{% import 'shared-maas.yaml' as SHARED_MAAS with context %}
 
 - description: Wait for salt-master is ready after configdrive user-data
   cmd: |
@@ -16,6 +17,24 @@
   skip_fail: false
 
 {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
+{{ SHARED_MAAS.REBOOT_HW_NODES('engineer', 'KBwdcRqwed3w2',
+  [
+      "185.8.59.227",
+      "185.8.59.229",
+      "5.43.225.88",
+      "5.43.225.112",
+      "5.43.225.208",
+      "5.43.227.118",
+      "185.8.58.248",
+      "185.8.59.222",
+      "5.43.225.228",
+      "5.43.229.28",
+      "5.43.225.23",
+      "185.8.58.9",
+      "185.8.58.246",
+      "185.8.58.243",
+      "185.8.58.244"
+  ]) }}
 
 {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
 
diff --git a/tcp_tests/templates/heat-bm-cicd-queens-contrail-sl/salt.yaml b/tcp_tests/templates/heat-bm-cicd-queens-contrail-sl/salt.yaml
index 8dbf61a..06b692c 100644
--- a/tcp_tests/templates/heat-bm-cicd-queens-contrail-sl/salt.yaml
+++ b/tcp_tests/templates/heat-bm-cicd-queens-contrail-sl/salt.yaml
@@ -7,6 +7,7 @@
 {% import 'shared-salt.yaml' as SHARED with context %}
 {% import 'shared-test-tools.yaml' as SHARED_TEST_TOOLS with context %}
 {% import 'shared-workarounds.yaml' as SHARED_WORKAROUNDS with context %}
+{% import 'shared-maas.yaml' as SHARED_MAAS with context %}
 
 - description: Wait for salt-master is ready after configdrive user-data
   cmd: |
@@ -16,6 +17,24 @@
   skip_fail: false
 
 {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
+{{ SHARED_MAAS.REBOOT_HW_NODES('engineer', 'KBwdcRqwed3w2',
+  [
+      "185.8.59.227",
+      "185.8.59.229",
+      "5.43.225.88",
+      "5.43.225.112",
+      "5.43.225.208",
+      "5.43.227.118",
+      "185.8.58.248",
+      "185.8.59.222",
+      "5.43.225.228",
+      "5.43.229.28",
+      "5.43.225.23",
+      "185.8.58.9",
+      "185.8.58.246",
+      "185.8.58.243",
+      "185.8.58.244"
+  ]) }}
 
 {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
 
diff --git a/tcp_tests/templates/shared-maas.yaml b/tcp_tests/templates/shared-maas.yaml
index 0becf80..2066f4f 100644
--- a/tcp_tests/templates/shared-maas.yaml
+++ b/tcp_tests/templates/shared-maas.yaml
@@ -1,5 +1,23 @@
 {# Collection of common macroses shared across MaaS #}
 
+
+{%- macro REBOOT_HW_NODES(ipmi_user, ipmi_password, ipmi_devices=['']) %}
+
+- description: Reboot hardware computes and set to PXE boot. It needs for clean deployment
+  cmd: |
+    {%- for device in ipmi_devices %}
+      ipmitool -H {{ device }} -U {{ ipmi_user }} -P {{ ipmi_password }} chassis power off
+    {%- endfor %}
+    {%- for device in ipmi_devices %}
+      ipmitool -H {{ device }} -U {{ ipmi_user }} -P {{ ipmi_password }} chassis bootdev pxe
+    {%- endfor %}
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+{%- endmacro %}
+
+
 {%- macro AUTH_IN_MAAS() %}
 
 - description: MaaS auth