--- # validation_group: validation group to execute # skiplist_validations: comma separated string of the validations to be skipped in a group # skiplist_validations_stage: comma separated string of the validations to be skipped in a group defined for a stage, added to the list. # validation_allowed_groups: list of allowed groups to run # validation_args: string containing extra arguments for the validation command. (defaults to empty string) - block: - name: "Retrieve validations for group {{ validation_group }}" command: "validation list --group {{ validation_group }} -f value -c ID" register: validations_in_group - name: Set fact validations_filtered which removes validations from skiplist set_fact: validations_filtered: "{{ validations_in_group.stdout_lines | difference( skiplist_validations.split(',') + skiplist_validations_stage.split(',') ) }}" - name: "Running validations {{ validations_filtered }}" register: validations_result shell: | set -o pipefail source {{ undercloud_rc }} validation run --validation \ verify-package,\ undercloud-disabled-services,\ openstack-endpoints,\ undercloud-service-status,\ rabbitmq-limits,\ check-rsyslog,\ ntp,\ service-status,\ validate-selinux,\ stonith-exists,\ overcloud-service-status,\ ceph-health,\ ovs-dpdk-pmd-cpus-check,\ check-kernel-version,\ tls-everywhere-post-deployment,\ check-manila-policy-file,\ tripleo-haproxy,\ container-status,\ controller-token,\ controller-ulimits,\ fips-enabled,\ frr-status,\ pacemaker-status,\ healthcheck-service-status,\ image-serve,\ mysql-open-files-limit,\ neutron-sanity-check,\ nfv-ovsdpdk-zero-packet-loss-check,\ nova-event-callback,\ nova-svirt \ --inventory {{ upgrade_validation_inventory }} \ {{ validations_extra_args }} 2>&1 {{ timestamper_cmd }} >> validation-{{ validation_group }}.log when: - "validations_filtered|length > 0" args: executable: /usr/bin/bash - name: Validation group not executed debug: msg: "Validation group {{ validation_group }} is skipped." when: - "validations_filtered|length == 0" rescue: - name: Retrieve the validations results command: validation history list -f json -c UUID -c Status register: validation_history - name: Set fact validation_status with the validations results set_fact: validations_failed: "{{ validation_history.stdout|default('')|from_json|json_query(\"[?Status != 'PASSED'].UUID\") }}" when: validation_history is defined - name: Log all the validations failed shell: | validation show {{ item }} &>> validation-{{ validation_group }}-failed.log loop: "{{ validations_failed }}" when: - "validations_failed|length > 0" - name: Fail if some validation is not PASSED fail: msg: "Validation failed: check the log in validation-{{ validation_group }}-failed.log." when: - "validations_failed|length > 0" - name: Fail if the validations command didn't succeed fail: msg: "Validations failed: check the log in validation-{{ validation_group }}.log." when: - validations_result is not succeeded when: "validation_group in validation_allowed_groups"