Initial commit
[ta/infra-ansible.git] / roles / initial_poweroff_hosts / tasks / poweroff_real_nodes.yml
diff --git a/roles/initial_poweroff_hosts/tasks/poweroff_real_nodes.yml b/roles/initial_poweroff_hosts/tasks/poweroff_real_nodes.yml
new file mode 100644 (file)
index 0000000..6a188f4
--- /dev/null
@@ -0,0 +1,24 @@
+---
+
+# Copyright 2019 Nokia
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+- name: Ensure all the nodes in the deployment are powered-off.
+  command: "/usr/bin/ipmitool -I lanplus -H {{item.value['hwmgmt']['address']}} -U {{item.value['hwmgmt']['user']}} -P {{item.value['hwmgmt']['password']}} chassis power off"
+  with_dict: "{{nodes_to_power_off}}"
+  no_log: True
+  when:
+    - installation_phase == "bootstrapping-started"
+  ignore_errors: yes
+