Browse Source

Merge pull request #7225 from tzumainn/openstack-ansible-abort-on-failure

Automatic merge from submit-queue.

Add any_errors_fatal to openstack playbooks
OpenShift Merge Robot 7 years ago
parent
commit
38a82a0344

+ 10 - 1
playbooks/openstack/README.md

@@ -192,7 +192,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

+ 1 - 0
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

+ 1 - 0
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:

+ 4 - 0
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: retrieve cluster name from the environment if present
@@ -17,6 +18,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.
@@ -33,6 +35,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
@@ -47,6 +50,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