From dbde87964e1834dafffea6b3b774c72d4eda9b56 Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Tue, 3 Nov 2020 22:39:44 +0100 Subject: [PATCH] Make local molecule testing running. There has been an update in the zuul fact's structure, having now a projects index which contains the src_dir parameter. This update was done in run.yaml, however it was missed to be adapted for the run-local.yml and the pre.yml. This change adds the fact tripleo_validations_project_path in pre.yml and updates the zuul dictionary in run-local.yml. Change-Id: I25ccc7d7a70a64c5abc1a5d621817b2dfad6e38f --- ci/playbooks/pre.yml | 10 +++++++--- ci/playbooks/run-local.yml | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ci/playbooks/pre.yml b/ci/playbooks/pre.yml index 569ff155e..97ab22d78 100644 --- a/ci/playbooks/pre.yml +++ b/ci/playbooks/pre.yml @@ -1,6 +1,10 @@ --- - hosts: all pre_tasks: + - name: Set project path fact + set_fact: + tripleo_validations_project_path: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-validations'].src_dir }}" + - name: Ensure output dirs file: path: "{{ ansible_user_dir }}/zuul-output/logs" @@ -19,13 +23,13 @@ - name: Run bindep shell: |- . {{ ansible_user_dir }}/test-python/bin/activate - {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/scripts/bindep-install + {{ tripleo_validations_project_path }}/scripts/bindep-install become: true changed_when: false - name: Setup test-python pip: - requirements: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/molecule-requirements.txt" + requirements: "{{ tripleo_validations_project_path }}/molecule-requirements.txt" virtualenv: "{{ ansible_user_dir }}/test-python" virtualenv_site_packages: true @@ -33,7 +37,7 @@ - name: Get necessary git repos git: repo: https://opendev.org/openstack/{{ item }} - dest: "{{ ansible_user_dir}}/{{ zuul.project.src_dir }}/roles/roles.galaxy/{{ item }}" + dest: "{{ tripleo_validations_project_path }}/roles/roles.galaxy/{{ item }}" version: master force: true with_items: diff --git a/ci/playbooks/run-local.yml b/ci/playbooks/run-local.yml index cd0f83e27..af5295db3 100644 --- a/ci/playbooks/run-local.yml +++ b/ci/playbooks/run-local.yml @@ -4,8 +4,9 @@ - name: set basic zuul fact set_fact: zuul: - project: - src_dir: "{{ tripleo_src }}" + projects: + "opendev.org/openstack/tripleo-validations": + src_dir: "{{ tripleo_src }}" ansible_connection: ssh - import_playbook: pre.yml