From fe4c5f69a460e2b329d537a137e9eca33f9fd748 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Mar 04 2022 11:02:04 +0000 Subject: Remove ansible_user_dir usage from simple-srpm-build role --- diff --git a/roles/simple-srpm-build/tasks/main.yaml b/roles/simple-srpm-build/tasks/main.yaml index ade3f64..cf669de 100644 --- a/roles/simple-srpm-build/tasks/main.yaml +++ b/roles/simple-srpm-build/tasks/main.yaml @@ -1,6 +1,7 @@ --- - set_fact: zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" + rpmbuild_dir: "{{ ansible_env.HOME }}/rpmbuild" - file: path: "{{ zuul_output_dir }}/logs/repo" @@ -14,7 +15,7 @@ - name: Clean previous rpmbuild directories file: - path: "{{ ansible_user_dir }}/rpmbuild/{{ item }}" + path: "{{ rpmbuild_dir }}/{{ item }}" state: absent loop: - SOURCES @@ -22,20 +23,20 @@ - name: Create rpmbuild directories file: - path: "{{ ansible_user_dir }}/rpmbuild/{{ item }}" + path: "{{ rpmbuild_dir }}/{{ item }}" state: directory loop: - SOURCES - SRPMS - name: Copy local HEAD source to rpmbuild SOURCES directory - shell: cp *HEAD.tgz {{ ansible_user_dir }}/rpmbuild/SOURCES + shell: cp *HEAD.tgz {{ rpmbuild_dir }}/SOURCES when: "{{ build_from_source | default(false) }}" args: chdir: "{{ zuul.project.src_dir }}" - name: Retrieve sources - shell: spectool -g -C {{ ansible_user_dir }}/rpmbuild/SOURCES *.spec + shell: spectool -g -C {{ rpmbuild_dir }}/SOURCES *.spec args: chdir: "{{ zuul.project.src_dir }}" @@ -45,12 +46,12 @@ chdir: "{{ zuul.project.src_dir }}" - name: Get SRPM path - command: ls {{ ansible_user_dir }}/rpmbuild/SRPMS/ + command: ls {{ rpmbuild_dir }}/SRPMS/ register: result - name: Set SRPM path fact set_fact: - srpm: "{{ ansible_user_dir }}/rpmbuild/SRPMS/{{ result.stdout }}" + srpm: "{{ rpmbuild_dir }}/SRPMS/{{ result.stdout }}" - name: Copy SRPM in zuul output directory command: cp {{ srpm }} {{ zuul_output_dir }}/logs/repo