From 5e8212150545fb3e8ff64565fc7c6cc795090d51 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 14 Dec 2017 16:06:09 +0000 Subject: [PATCH] Don't fail if compute node is powered off in compute-node-discovery.yml Some BMCs aren't idempotent, and cause ipmitool to fail if the requested power state is already set. --- ansible/compute-node-discovery.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/compute-node-discovery.yml b/ansible/compute-node-discovery.yml index 93cf7548f..b163b86ef 100644 --- a/ansible/compute-node-discovery.yml +++ b/ansible/compute-node-discovery.yml @@ -22,6 +22,10 @@ - name: Ensure baremetal compute nodes are powered off command: ipmitool -U {{ ipmi_username }} -P {{ ipmi_password }} -H {{ ipmi_address }} -I lanplus chassis power off delegate_to: "{{ controller_host }}" + failed_when: + - result | failed + # Some BMCs complain if the node is already powered off. + - "'Command not supported in present state' not in result.stderr" vars: # NOTE: Without this, the controller's ansible_host variable will not # be respected when using delegate_to.