matbu 3a5e0de20b Rename local variable component to validation_component for Upstream CI
The usage of the component variable for the local and check jobs is
dangerous since this variable is used by the whole component chain for TripleO.
This review renamed it to validation_component.

Change-Id: Icd8e64282306479a84fc6240142ddcb28ce433e5
2021-05-26 15:03:02 +02:00

55 lines
1.6 KiB
YAML

---
- name: Make sure Validations Log dir exists
become: true
file:
path: "{{ vf_log_dir }}"
state: directory
mode: "0755"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
recurse: true
- name: check if virtualenv is used
register: is_virtualenv
stat:
path: "{{ zuul_work_virtualenv }}"
- name: Set commmand if virtualenv exists
set_fact:
validation_command: "source {{ zuul_work_virtualenv }}/bin/activate; validation"
when: is_virtualenv.stat.exists
- name: Set Validation directory if virtualenv exists
set_fact:
validation_dir: "--validation-dir {{ zuul_work_virtualenv }}/share/ansible/validation-playbooks"
when: is_virtualenv.stat.exists
- name: Set Ansible base directory if virtualenv exists
set_fact:
ansible_dir: "--ansible-base-dir {{ zuul_work_virtualenv }}/share/ansible/"
when: is_virtualenv.stat.exists
- name: Set commmand without virtualenv
set_fact:
validation_command: "validation"
when: not is_virtualenv.stat.exists
- name: Set validation dir without virtualenv
set_fact:
validation_dir: "--validation-dir /usr/share/ansible/validation-playbooks"
when: not is_virtualenv.stat.exists
- include: run.yaml name="{{ item }}"
when:
- run_validation|default(false)|bool
- validation_component | length > 0
with_dict: "{{ validations_list[validation_component] }}"
- include: list.yaml
- include: show.yaml name="{{ item }}"
when:
- run_validation|default(false)|bool
- validation_component | length > 0
with_dict: "{{ validations_list[validation_component] }}"