#342 standard-test-source: install rpm-build only as root
Merged 4 years ago by astepano. Opened 4 years ago by mvadkert.

@@ -34,6 +34,21 @@ 

      retries: 5

      delay: 10

      until: result is succeeded

+     when: ansible_user_id == 'root'

+ 

+   - block:

+     - name: Check if required packages are installed on the system

+       command: rpm -q {{ item }}

+       ignore_errors: True

+       register: rpm_result

+       with_items:

+         - rpm-build

+ 

+     - fail:

+         msg: "Some of the required packages were not found on the localhost: {{ rpm_result.results[0].stdout }}"

+       when: rpm_result.failed == true

+ 

+     when: ansible_user_id != 'root'

  

    - name: Get the specfile package name

      shell: rpm -q --specfile --queryformat="%{NAME}\n" {{pkgdir}}/*.spec | head -n1

Without this patch, people running STR against a remote machine
without root cannot use this role ...

NOTE: This patch is an exception to STI by the OSCI team. All fixes
like this need to be approved for inclusion, as they are not compliant
to STI.

Signed-off-by: Miroslav Vadkerti mvadkert@redhat.com

Metadata Update from @mvadkert:
- Request assigned

4 years ago

rebased onto 559d7ca

4 years ago

Commit d870768 fixes this pull-request

Pull-Request has been merged by astepano

4 years ago

Pull-Request has been merged by astepano

4 years ago