From 8600a80930b53bae358658b51dbf4cce1628685f Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Tue, 24 May 2016 13:12:02 -0700 Subject: [PATCH] Skip unavailable hosts when distributing keys The 'Create authorized keys file from host vars' task assumes that every host within the nova_compute group is available. If any host within that group is offline, excluded through a limit, or has otherwise failed an earlier task, it will lead to this task failing for every host. Add a when clause checking for the existence of the nova_pubkey hostvar so that the task and remainder of the role can continue when a nova_compute host is unavailable. Related-Bug: 1531783 Change-Id: Idec01d13c35632204a2ae0f0a848a0ccc5b34d73 --- tasks/nova_compute_key_distribute.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/nova_compute_key_distribute.yml b/tasks/nova_compute_key_distribute.yml index 7dfc8d43..1d390169 100644 --- a/tasks/nova_compute_key_distribute.yml +++ b/tasks/nova_compute_key_distribute.yml @@ -18,6 +18,7 @@ user: "{{ nova_system_user_name }}" key: "{{ hostvars[item]['nova_pubkey'] | b64decode }}" with_items: groups['nova_compute'] + when: hostvars[item]['nova_pubkey'] is defined tags: - nova-key - nova-key-distribute