Merge "Normalize how we run validations"

This commit is contained in:
Zuul 2020-05-14 19:14:46 +00:00 committed by Gerrit Code Review
commit e7de741702
6 changed files with 51 additions and 28 deletions

View File

@ -21,7 +21,6 @@
gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}" gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}"
any_errors_fatal: true any_errors_fatal: true
vars: vars:
run_validations: false
concurrency: 20 concurrency: 20
max_retries: 2 max_retries: 2
node_timeout: 1200 node_timeout: 1200

View File

@ -21,7 +21,6 @@
gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}" gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}"
any_errors_fatal: true any_errors_fatal: true
vars: vars:
run_validations: false
concurrency: 20 concurrency: 20
max_retries: 2 max_retries: 2
node_timeout: 1200 node_timeout: 1200

View File

@ -34,13 +34,6 @@
- node_uuids is undefined - node_uuids is undefined
tasks: tasks:
# Pre-cleaning validation
- name: Run Validations
command: >-
openstack --os-cloud undercloud tripleo validator run --group "pre-clean"
when:
- run_validations | bool
- name: Set node_uuids_clean fact - name: Set node_uuids_clean fact
set_fact: set_fact:
node_uuids_clean: "{{ node_uuids }}" node_uuids_clean: "{{ node_uuids }}"

View File

@ -57,11 +57,33 @@
}}" }}"
# Pre-introspection validation # Pre-introspection validation
- name: Run Validations - name: Validations block
command: >
openstack tripleo validator run --group "pre-introspection"
when: when:
- run_validations | bool - run_validations | bool
block:
- name: Check if validation enabled
set_fact:
validations_enabled: "{{ lookup('hiera', 'tripleo_validations_enabled') }}"
run_once: true
become: true
# Pre-introspection validation
# NOTE(cloudnull): The stackrc file is sourced because validations are not
# 100% compatible with clouds.yaml at this time.
- name: Run Validations
shell: |-
source "{{ ansible_home }}/stackrc"
openstack --os-cloud undercloud tripleo validator run --group "pre-introspection"
when:
- validations_enabled | bool
- name: Fail if validations are disabled
fail:
msg: >-
Run validations were enabled but via hiera information disabled.
Check the configuration and try again.
when:
- not (validations_enabled | bool)
# Introspect nodes # Introspect nodes
- name: Start baremetal introspection - name: Start baremetal introspection

View File

@ -21,7 +21,6 @@
gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}" gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}"
any_errors_fatal: true any_errors_fatal: true
vars: vars:
run_validations: false
concurrency: 20 concurrency: 20
max_retries: 2 max_retries: 2
node_timeout: 1200 node_timeout: 1200

View File

@ -35,22 +35,33 @@
- (tripleo_target_host is defined) | ternary('ssh', 'local') == 'local' - (tripleo_target_host is defined) | ternary('ssh', 'local') == 'local'
tasks: tasks:
- name: Check if validation enabled - name: Validations block
command: >
hiera tripleo_validations_enabled
register: validations_enabled
become: true
- name: Run Validations
# 1. tripleo-validations does not work with clouds.yaml
# 2. Ignore errors as certain validations in 'pre-deployment'
# group i.e tls-everywhere-pre-deployment.yaml would fail.
shell: |
source "{{ ansible_home }}/stackrc"
openstack tripleo validator run --group "pre-deployment"
when: when:
- validations_enabled.stdout | bool - run_validations | bool
ignore_errors: true block:
- name: Check if validation enabled
set_fact:
validations_enabled: "{{ lookup('hiera', 'tripleo_validations_enabled') }}"
run_once: true
become: true
# Pre-deployment validation
# NOTE(cloudnull): The stackrc file is sourced because validations are not
# 100% compatible with clouds.yaml at this time.
- name: Run Validations
shell: |-
source "{{ ansible_home }}/stackrc"
openstack --os-cloud undercloud tripleo validator run --group "pre-deployment"
when:
- validations_enabled | bool
- name: Fail if validations are disabled
fail:
msg: >-
Run validations were enabled but via hiera information disabled.
Check the configuration and try again.
when:
- not (validations_enabled | bool)
- name: Prepare Container images and update plan - name: Prepare Container images and update plan
tripleo_image_params_prepare: tripleo_image_params_prepare: