#84 Fix for Atomic Host installing packages.
Merged 6 years ago by astepano. Opened 6 years ago by astepano.
astepano/standard-test-roles atomic_pkgs  into  master

@@ -27,6 +27,20 @@ 

          regex_replace('-debuginfo')

        }}

  

+ - name: Target OS identification

+   block:

+     - name: Test if system is Atomic Host

+       lineinfile:

+         name: /etc/os-release

+         regexp: .*Atomic Host.*

+         state: absent

+       check_mode: yes

+       changed_when: False

+       register: os_release_atomic

+     - name: Set Ansible fact 'is_atomic_host'

+       set_fact:

+         is_atomic_host: "{{ os_release_atomic.found > 0 }}"

+ 

  - block:

    - name: Gather facts

      setup:
@@ -87,21 +101,20 @@ 

    when: ansible_pkg_mgr != 'unknown'

  

  - block:

-   - name: Check packages required by the test (atomic)

-     shell: rpm -q {{ required_packages|join(" ") }}

+   - name: Check presence of required packages for Atomic Host

+     shell: rpm -q {{ pkgs_ordinary_req|join(" ") }}

      register: package_check

-     changed_when: no

-     failed_when: no

+     changed_when: False

+     failed_when: False

      args: { warn: no }

- 

-   - name: Install packages required by the test (atomic)

+   - name: Install required packages at Atomic Host

      shell:

-       rpm-ostree install {{ required_packages|join(" ") }}

+       rpm-ostree install {{ pkgs_ordinary_req|join(" ") }}

        && rpm-ostree ex livefs

      when: package_check.rc != 0

- 

-   tags: atomic

-   when: required_packages.0 is defined

+   when:

+     - is_atomic_host

+     - pkgs_ordinary_req

  

  - name: Define remote_artifacts if it is not already defined

    set_fact:

Code for installing packages for Atomic Host incorrect uses 'tags' word.

Signed-off-by: Andrei Stepanov astepano@redhat.com

Pull-Request has been merged by astepano

6 years ago
Metadata