From 5cf1410618e04b1b534571fd51cd39a8133b33b3 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Wed, 24 Jul 2019 14:21:38 +0000 Subject: [PATCH] Fix devstack/packstack job permission denied issue The review fixes permission denied issues while either tempest.conf is copied to /opt/stack/tempest location or a tempest plugins are installed there. Change-Id: I16bbc2faccb31af04867757aa4357d55ee4de572 --- .zuul.yaml | 2 +- roles/generate-tempestconf-file/tasks/main.yaml | 1 + roles/install-plugins/tasks/main.yaml | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index 1c2070e0..579d5b59 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -120,7 +120,7 @@ user: admin cloud_user: devstack-admin plugins_paths: - - "~/{{ zuul.projects['opendev.org/openstack/heat-tempest-plugin'].src_dir }}" + - "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/heat-tempest-plugin'].src_dir }}" tempest_concurrency: 2 - job: diff --git a/roles/generate-tempestconf-file/tasks/main.yaml b/roles/generate-tempestconf-file/tasks/main.yaml index 8030dfa7..397223f6 100644 --- a/roles/generate-tempestconf-file/tasks/main.yaml +++ b/roles/generate-tempestconf-file/tasks/main.yaml @@ -55,6 +55,7 @@ # tempest role which will run tests has tempest in {{ devstack_base_dir }} # location, therefore the file is copied there - name: Copy tempest.conf to the tempest directory + become: yes shell: | set -x cp {{ tempestconf_src_relative_path }}/etc/tempest.conf {{ devstack_base_dir }}/tempest/etc/tempest.conf diff --git a/roles/install-plugins/tasks/main.yaml b/roles/install-plugins/tasks/main.yaml index 638bd865..cf35cf1c 100644 --- a/roles/install-plugins/tasks/main.yaml +++ b/roles/install-plugins/tasks/main.yaml @@ -1,9 +1,11 @@ - name: Prepare tempest venv + become: yes command: tox -r --notest -efull args: chdir: "{{devstack_base_dir}}/tempest" - name: Install plugins + become: yes command: tox -evenv-tempest -- pip install {{ item }} with_items: "{{ plugins_paths }}" args: @@ -11,6 +13,7 @@ when: plugins_paths is defined - name: List installed tempest plugins + become: yes command: tox -evenv-tempest -- tempest list-plugins args: chdir: "{{devstack_base_dir}}/tempest"