From aa8215c5eeef4edcba4b1b0fa464d84dcc8a1553 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Wed, 22 Feb 2017 11:02:18 +0000
Subject: [PATCH] ironic_pxe bootstrap should run on all hosts

Most bootstrap actions use the run_once flag to run on a single host
as they typically involve service-global operations such as database
syncs. The ironic_pxe container bootstrap is different, as it copies
pxelinux files into the ironic_pxe Docker volume. This should be done
on all hosts but currently is only done on one host.

This change performs the ironic_pxe bootstrap on all hosts in the
ironic-pxe group.

Change-Id: Iffd34e6ff26a0ba5140e5d477418cc8aebcdac62
Closes-Bug: #1667153
---
 ansible/roles/ironic/tasks/bootstrap.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ansible/roles/ironic/tasks/bootstrap.yml b/ansible/roles/ironic/tasks/bootstrap.yml
index 208cb681d6..3a456b0c0b 100644
--- a/ansible/roles/ironic/tasks/bootstrap.yml
+++ b/ansible/roles/ironic/tasks/bootstrap.yml
@@ -60,5 +60,4 @@
       - "{{ node_config_directory }}/ironic-pxe/:{{ container_config_directory }}/:ro"
       - "/etc/localtime:/etc/localtime:ro"
       - "ironic_pxe:/tftpboot/"
-  run_once: True
-  delegate_to: "{{ groups['ironic-pxe'][0] }}"
+  when: "{{ inventory_hostname in groups['ironic-pxe'] }}"