From fd5ecc071d88ed6d610f7842e00f3e8826f80ca7 Mon Sep 17 00:00:00 2001 From: Tzu-Mainn Chen Date: Tue, 20 Feb 2018 21:42:41 +0100 Subject: [PATCH 1/3] add any_errors_fatal to openstack playbooks --- playbooks/openstack/openshift-cluster/prerequisites.yml | 1 + playbooks/openstack/openshift-cluster/provision.yml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/playbooks/openstack/openshift-cluster/prerequisites.yml b/playbooks/openstack/openshift-cluster/prerequisites.yml index 8bb70050150..1b924585416 100644 --- a/playbooks/openstack/openshift-cluster/prerequisites.yml +++ b/playbooks/openstack/openshift-cluster/prerequisites.yml @@ -1,5 +1,6 @@ --- - hosts: localhost + any_errors_fatal: true tasks: - name: Check dependencies and OpenStack prerequisites import_role: diff --git a/playbooks/openstack/openshift-cluster/provision.yml b/playbooks/openstack/openshift-cluster/provision.yml index 3a8449ca7b1..89b8dd97266 100644 --- a/playbooks/openstack/openshift-cluster/provision.yml +++ b/playbooks/openstack/openshift-cluster/provision.yml @@ -1,5 +1,6 @@ --- - name: Create the OpenStack resources for cluster installation + any_errors_fatal: true hosts: localhost tasks: - name: provision cluster @@ -14,6 +15,7 @@ - name: Wait for the nodes and gather their facts + any_errors_fatal: true hosts: oo_all_hosts become: yes # NOTE: The nodes may not be up yet, don't gather facts here. @@ -30,6 +32,7 @@ # TODO(shadower): consider splitting this up so people can stop here # and configure their DNS if they have to. - name: Populate the DNS entries + any_errors_fatal: true hosts: localhost tasks: - name: Populate DNS entries @@ -44,6 +47,7 @@ - import_playbook: ../../init/basic_facts.yml - name: Optionally subscribe the RHEL nodes + any_errors_fatal: true hosts: oo_all_hosts become: yes gather_facts: yes From 712cb5031ce9247597c392393f7347e2884c4d3c Mon Sep 17 00:00:00 2001 From: Tzu-Mainn Chen Date: Mon, 26 Feb 2018 18:01:56 +0100 Subject: [PATCH 2/3] add any_errors_fatal to openstack install playbook --- playbooks/openstack/openshift-cluster/install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/openstack/openshift-cluster/install.yml b/playbooks/openstack/openshift-cluster/install.yml index 69ab98cd2d6..63181c7d617 100644 --- a/playbooks/openstack/openshift-cluster/install.yml +++ b/playbooks/openstack/openshift-cluster/install.yml @@ -11,6 +11,7 @@ - import_playbook: ../../prerequisites.yml - name: Prepare the Nodes in the cluster for installation + any_errors_fatal: true hosts: oo_all_hosts become: yes gather_facts: yes From bb20e098192fe40e328be16a6deb1f512331e964 Mon Sep 17 00:00:00 2001 From: Tzu-Mainn Chen Date: Wed, 28 Feb 2018 06:28:26 +0100 Subject: [PATCH 3/3] added note about any_errors_fatal for ansible.cfg --- playbooks/openstack/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/playbooks/openstack/README.md b/playbooks/openstack/README.md index 842bb34dea7..69ccc37ccd8 100644 --- a/playbooks/openstack/README.md +++ b/playbooks/openstack/README.md @@ -180,7 +180,16 @@ copy it to the directory you're going to run `ansible-playbook` from. $ cp openshift-ansible/ansible.cfg ansible.cfg ``` -Then run the provision + install playbook -- this will create the OpenStack +We recommend adding an additional option: + +```cfg +any_errors_fatal = true +``` + +This will abort the Ansible playbook execution as soon as any error is +encountered. + +Now, run the provision + install playbook -- this will create the OpenStack resources: ```bash