From f2effcda59655318457a4098e253204a437e56f1 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Fri, 11 Mar 2016 14:23:24 -0500 Subject: [PATCH] Role should fail immediately when its preconditions are not met While we were failing before, that failure occurs mid-way through the execution of the role. If we are going to fail, let's fail as fast as possible. Change-Id: I97bf2934042fc7ebe7f688f1f21a3cc4360ff61d --- tasks/galera_install.yml | 7 ------- tasks/main.yml | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tasks/galera_install.yml b/tasks/galera_install.yml index f607d1d5..82234a12 100644 --- a/tasks/galera_install.yml +++ b/tasks/galera_install.yml @@ -13,13 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Fail if the galera root password is not provided - fail: - msg: | - Please set the galera_root_password variable prior to applying the - galera role. - when: (galera_root_password is undefined) or (galera_root_password is none) - - name: Preseed galera password(s) debconf: name: "{{ item.name }}" diff --git a/tasks/main.yml b/tasks/main.yml index 40129194..8c4da000 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,6 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Fail if the galera root password is not provided + fail: + msg: | + Please set the galera_root_password variable prior to applying the + galera role. + when: (galera_root_password is undefined) or (galera_root_password is none) + - include: galera_upgrade_check.yml - include: galera_cluster_state.yml - include: galera_pre_install.yml