From dad9515c35f4a4d2604f470ee13aad05de23114e Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 6 Jul 2017 11:13:22 +0100 Subject: [PATCH] Implement any_errors_fatal for all test playbooks Sometimes a test will result in a failure, but it takes more time than necessary to find the failure due to Ansible continuing to execute on other hosts after removing one from the play execution. This patch ensures that any error will result in an immediate failure so that the fatal error is easier to find. Change-Id: I4e89bfdb1e48d0ac65f9fb8549e55a19ab773f9f --- destroy_containers.yml | 1 + setting-nodepool-variables.yml | 1 + test-install-cinder.yml | 2 ++ test-install-etcd.yml | 1 + test-install-galera.yml | 1 + test-install-glance.yml | 1 + test-install-gnocchi.yml | 1 + test-install-haproxy.yml | 1 + test-install-heat.yml | 1 + test-install-horizon.yml | 1 + test-install-ironic.yml | 1 + test-install-keystone.yml | 3 +++ test-install-memcached.yml | 1 + test-install-neutron.yml | 4 ++++ test-install-nova.yml | 3 +++ test-install-openstack-hosts.yml | 1 + test-install-rabbitmq.yml | 1 + test-install-sahara.yml | 1 + test-install-swift.yml | 1 + test-install-tempest.yml | 1 + test-prepare-containers.yml | 3 ++- test-prepare-keys.yml | 2 ++ test-repo-setup.yml | 1 + test-setup-swifthosts.yml | 1 + 24 files changed, 34 insertions(+), 1 deletion(-) diff --git a/destroy_containers.yml b/destroy_containers.yml index a2a9f26d..caee8a6a 100644 --- a/destroy_containers.yml +++ b/destroy_containers.yml @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + - name: Playbook for destroying test containers hosts: all_containers serial: 1 diff --git a/setting-nodepool-variables.yml b/setting-nodepool-variables.yml index 58fc1d0a..8be57ffb 100644 --- a/setting-nodepool-variables.yml +++ b/setting-nodepool-variables.yml @@ -16,5 +16,6 @@ - name: Setting nodepool variables hosts: all gather_facts: true + any_errors_fatal: true tasks: - include: "common-tasks/test-set-nodepool-vars.yml" diff --git a/test-install-cinder.yml b/test-install-cinder.yml index ca499670..64df56f3 100644 --- a/test-install-cinder.yml +++ b/test-install-cinder.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true pre_tasks: - include: ensure-rabbitmq.yml @@ -43,6 +44,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "os_cinder" vars_files: diff --git a/test-install-etcd.yml b/test-install-etcd.yml index 6aceedca..0e9f6cfd 100644 --- a/test-install-etcd.yml +++ b/test-install-etcd.yml @@ -18,5 +18,6 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "etcd" diff --git a/test-install-galera.yml b/test-install-galera.yml index 191885bb..1626a332 100644 --- a/test-install-galera.yml +++ b/test-install-galera.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "galera_server" vars_files: diff --git a/test-install-glance.yml b/test-install-glance.yml index a6025240..c13e538d 100644 --- a/test-install-glance.yml +++ b/test-install-glance.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true pre_tasks: - include: ensure-rabbitmq.yml vhost_name: "{{ glance_rabbitmq_vhost }}" diff --git a/test-install-gnocchi.yml b/test-install-gnocchi.yml index b179c987..a1ba66f7 100644 --- a/test-install-gnocchi.yml +++ b/test-install-gnocchi.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true pre_tasks: - include: create-grant-db.yml db_name: "{{ gnocchi_database_name }}" diff --git a/test-install-haproxy.yml b/test-install-haproxy.yml index 3c0fe0fc..9cc42a10 100644 --- a/test-install-haproxy.yml +++ b/test-install-haproxy.yml @@ -16,6 +16,7 @@ - name: Install haproxy hosts: localhost become: true + any_errors_fatal: true roles: - role: "haproxy_server" haproxy_service_configs: "{{ haproxy_default_services | default([]) }}" diff --git a/test-install-heat.yml b/test-install-heat.yml index 28f81220..420cf679 100644 --- a/test-install-heat.yml +++ b/test-install-heat.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true pre_tasks: - include: ensure-rabbitmq.yml vhost_name: "{{ heat_rabbitmq_vhost }}" diff --git a/test-install-horizon.yml b/test-install-horizon.yml index 41ae45f1..be4b3dc6 100644 --- a/test-install-horizon.yml +++ b/test-install-horizon.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true pre_tasks: - include: create-grant-db.yml db_name: "{{ horizon_galera_database }}" diff --git a/test-install-ironic.yml b/test-install-ironic.yml index 2925b75f..08097418 100644 --- a/test-install-ironic.yml +++ b/test-install-ironic.yml @@ -18,6 +18,7 @@ remote_user: root become: true gather_facts: true + any_errors_fatal: true pre_tasks: - include: ensure-rabbitmq.yml vhost_name: "{{ ironic_rabbitmq_vhost }}" diff --git a/test-install-keystone.yml b/test-install-keystone.yml index 1469b83b..bd034a05 100644 --- a/test-install-keystone.yml +++ b/test-install-keystone.yml @@ -16,6 +16,7 @@ - name: Prepare MQ/DB services hosts: keystone_all[0] gather_facts: true + any_errors_fatal: true user: root become: true tasks: @@ -39,6 +40,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true pre_tasks: # In order to ensure that any container, software or # config file changes which causes a container/service @@ -68,6 +70,7 @@ user: root become: true gather_facts: false + any_errors_fatal: true tasks: - name: Perform a Keystone DB sync contract command: "/openstack/venvs/keystone-{{ keystone_venv_tag }}/bin/keystone-manage db_sync --contract" diff --git a/test-install-memcached.yml b/test-install-memcached.yml index b5cdbad3..c3fd297b 100644 --- a/test-install-memcached.yml +++ b/test-install-memcached.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "memcached_server" vars_files: diff --git a/test-install-neutron.yml b/test-install-neutron.yml index 03d11be0..87bcafb0 100644 --- a/test-install-neutron.yml +++ b/test-install-neutron.yml @@ -20,6 +20,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true vars: kernel_module_path: apt: "lib/modules" @@ -54,6 +55,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true vars: required_packages: apt: @@ -91,6 +93,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "os_neutron" vars_files: @@ -103,6 +106,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "os_neutron" vars_files: diff --git a/test-install-nova.yml b/test-install-nova.yml index b25581d8..42b689bb 100644 --- a/test-install-nova.yml +++ b/test-install-nova.yml @@ -20,6 +20,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true vars: required_packages: apt: @@ -83,6 +84,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "os_nova" vars_files: @@ -93,6 +95,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "os_nova" vars_files: diff --git a/test-install-openstack-hosts.yml b/test-install-openstack-hosts.yml index e2ecec08..0d8f7750 100644 --- a/test-install-openstack-hosts.yml +++ b/test-install-openstack-hosts.yml @@ -17,6 +17,7 @@ hosts: localhost become: true gather_facts: true + any_errors_fatal: true pre_tasks: - include: "common-tasks/test-force-package-cache-update.yml" roles: diff --git a/test-install-rabbitmq.yml b/test-install-rabbitmq.yml index 7290e8b8..e81c22c8 100644 --- a/test-install-rabbitmq.yml +++ b/test-install-rabbitmq.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "rabbitmq_server" vars_files: diff --git a/test-install-sahara.yml b/test-install-sahara.yml index 5436e330..f2fb6cb4 100644 --- a/test-install-sahara.yml +++ b/test-install-sahara.yml @@ -18,6 +18,7 @@ remote_user: root become: true gather_facts: true + any_errors_fatal: true pre_tasks: - include: ensure-rabbitmq.yml vhost_name: "{{ sahara_rabbitmq_vhost }}" diff --git a/test-install-swift.yml b/test-install-swift.yml index e4ff6e2e..dc43e53b 100644 --- a/test-install-swift.yml +++ b/test-install-swift.yml @@ -20,6 +20,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "{{ swift_rolename | default('os_swift') }}" vars_files: diff --git a/test-install-tempest.yml b/test-install-tempest.yml index d732070a..83cf08c3 100644 --- a/test-install-tempest.yml +++ b/test-install-tempest.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true roles: - role: "{{ tempest_rolename | default('os_tempest') }}" vars_files: diff --git a/test-prepare-containers.yml b/test-prepare-containers.yml index f1e06fa4..5e737524 100644 --- a/test-prepare-containers.yml +++ b/test-prepare-containers.yml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Playbook for creating containers +- name: Gather facts for the LXC hosts hosts: localhost become: true gather_facts: true @@ -26,6 +26,7 @@ serial: 1 become: True gather_facts: False + any_errors_fatal: true roles: - role: "lxc_container_create" post_tasks: diff --git a/test-prepare-keys.yml b/test-prepare-keys.yml index d014455b..7d92a8f7 100644 --- a/test-prepare-keys.yml +++ b/test-prepare-keys.yml @@ -20,6 +20,7 @@ - name: Playbook for establishing ssh keys hosts: localhost gather_facts: false + any_errors_fatal: true connection: local become: true tasks: @@ -68,6 +69,7 @@ hosts: localhost connection: local become: false + any_errors_fatal: true tasks: # Shell used because facts may not be ready yet - name: Get user home directory diff --git a/test-repo-setup.yml b/test-repo-setup.yml index 793ab696..fbdc5ca5 100644 --- a/test-repo-setup.yml +++ b/test-repo-setup.yml @@ -17,6 +17,7 @@ hosts: localhost connection: local gather_facts: false + any_errors_fatal: true tasks: - name: Ensure repo directory exists file: diff --git a/test-setup-swifthosts.yml b/test-setup-swifthosts.yml index 6ad1272f..02c14455 100644 --- a/test-setup-swifthosts.yml +++ b/test-setup-swifthosts.yml @@ -18,6 +18,7 @@ user: root become: true gather_facts: true + any_errors_fatal: true vars_files: - test-vars.yml tasks: