Merge "Remove CI roles from validations-libs"

This commit is contained in:
Zuul 2020-10-21 12:52:53 +00:00 committed by Gerrit Code Review
commit c727b7c2ac
8 changed files with 3 additions and 110 deletions

View File

@ -1,9 +1,8 @@
- hosts: all
- hosts: tempest
vars:
tox_envlist: functional
roles:
- fetch-subunit-output
- fetch-devstack-log-dir
- fetch-output
- fetch-validations
- fetch-python-sdist-output

View File

@ -11,4 +11,5 @@
- role: ensure-if-python
vars:
zuul_work_dir: "src/opendev.org/openstack/validations-common"
- role: validations
- role: "src/opendev.org/openstack/validations-common/roles/validations"
- role: "src/opendev.org/openstack/validations-common/roles/fetch_validations"

View File

@ -1,3 +0,0 @@
src_dir: "{{ zuul.project.src_dir }}"
output_dir: "{{ ansible_user_dir }}"
log_path: "{{ zuul.executor.log_root }}"

View File

@ -1,24 +0,0 @@
- name: Ensure local output dirs
delegate_to: localhost
file:
path: "{{ vf_output_dir }}"
state: directory
with_items:
- "{{ log_path }}/validations-logs"
- "{{ zuul.executor.work_root }}/artifacts"
loop_control:
loop_var: vf_output_dir
- name: Collect logs and artifacts
synchronize:
dest: "{{ vf_output.dest }}/"
mode: pull
src: "{{ output_dir }}/{{ vf_output.src }}/"
verify_host: true
owner: false
group: false
loop:
- dest: "{{ log_path }}/validations-logs"
src: "logs"
loop_control:
loop_var: vf_output

View File

@ -1,23 +0,0 @@
log_dir: "{{ ansible_user_dir }}/logs"
zuul_work_virtualenv: "{{ ansible_user_dir }}/.venv"
ansible_dir: "{{ zuul_work_virtualenv }}/share/ansible"
validation_dir: "{{ zuul_work_virtualenv }}/share/ansible/validation-playbooks"
vf_log_dir: "/var/log/validations"
val_exec: "source {{ zuul_work_virtualenv }}/bin/activate; validation.py"
command:
- { output: "{{ log_dir }}/run.log", command: "{{ val_exec }} run --validation check-ftype,512e \
--validation-dir {{ validation_dir }} \
--ansible-base-dir {{ ansible_dir }} \
--output-log {{ log_dir }}/run.log" }
- { output: "{{ log_dir }}/run-group.log", command: "{{ val_exec }} run --group prep \
--validation-dir {{ validation_dir }} \
--ansible-base-dir {{ ansible_dir }} \
--output-log {{ log_dir }}/run-group.log" }
- { output: "{{ log_dir }}/list.log", command: "{{ val_exec }} list \
--validation-dir {{ validation_dir }} \
--ansible-base-dir {{ ansible_dir }} \
--output-log {{ log_dir }}/list.log" }
- { output: "{{ log_dir }}/show.log", command: "{{ val_exec }} show \
--validation-dir {{ validation_dir }} \
--ansible-base-dir {{ ansible_dir }} \
--output-log {{ log_dir }}/show.log" }

View File

@ -1,29 +0,0 @@
- name: Make sure Validations Log dir exists
become: yes
file:
path: "{{ vf_log_dir }}"
state: directory
mode: "0755"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
recurse: yes
# @matbu: TODO make the /var/log/validations as a parameter
# We should be able to write validation logs outside of the /var/log path
# This statement will have to be remove then.
- name: Create Validations log symlink
file:
src: "{{ vf_log_dir }}"
dest: "{{ log_dir }}"
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
state: link
# @matbu: TODO make ansible-runner depends on Ansible
- name: Install Ansible
pip:
name: ansible
virtualenv: "{{ zuul_work_virtualenv }}"
- include: validations.yaml validation_command="{{ item.command }}" val_output="{{ item.output }}"
loop: "{{command}}"

View File

@ -1,25 +0,0 @@
- name: Execute validation commands
shell:
cmd: "{{ validation_command }}"
executable: /bin/bash
- name: Get run results
register: result
shell:
cmd: "cat {{ val_output }}"
executable: /bin/bash
- name: Get json data
set_fact:
jsondata: "{{ result.stdout | from_json }}"
- name: Get Validations Status
set_fact:
status: "{{ jsondata | json_query(jsonres) }}"
vars:
jsonres: 'results[*].Status'
- fail:
msg: "Validation failed: some of the validations has failed."
when: item != "PASSED"
loop: "{{ status }}"

View File

@ -21,9 +21,6 @@ classifier =
[files]
packages = validations_libs
data_files =
share/ansible/roles = roles/*
[compile_catalog]
directory = validations-libs/locale
domain = validations-lib