#126 move enable copr to pkg roles
Merged 6 years ago by astepano. Opened 6 years ago by bgoncalv.
bgoncalv/standard-test-roles issue99  into  master

@@ -3,8 +3,10 @@ 

  - delegate_to: "{{ test_runner_inventory_name }}"

    block:

    - name: Add restraint repo for restraint-rhts using DNF

-     shell: dnf copr enable -y bpeck/restraint

-     ignore_errors: True

+     block:

+       - package: dnf-plugins-core state=present

+       - shell: dnf copr enable -y bpeck/restraint

+         ignore_errors: True

      when: "hostvars[test_runner_inventory_name]['is_dnf_os'] | bool"

  

    - name: Add restraint repo for restraint-rhts using YUM

@@ -2,7 +2,7 @@ 

    # Note, this method cannot install -debuginfo packages.

    package: name={{item}} state=present

    with_items:

-     - "{{ pkgs_ordinary_req }}"

+     - "{{ pkgs_ordinary_req|d|list }}"

  

  - name: Install the common requirements on target

    package: name={{item}} state=present
@@ -20,6 +20,13 @@ 

      shell: |

          debuginfo-install --assumeyes {{item}}

      with_items:

-         - "{{ pkgs_debuginfo_req }}"

-   when:

-     - pkgs_debuginfo_req

+         - "{{ pkgs_debuginfo_req|d|list }}"

+ 

+ - block:

+   - package: name=dnf-plugins-core state=present

+   - shell: dnf copr enable -y {{item}}

+     with_items:

+         - "{{copr_repos}}"

+     name: Enable copr repos using DNF

+     ignore_errors: True

+   when: copr_repos is defined

@@ -2,7 +2,7 @@ 

    # Note, this method cannot install -debuginfo packages.

    package: name={{item}} state=present

    with_items:

-     - "{{ pkgs_ordinary_req }}"

+     - "{{ pkgs_ordinary_req|d|list }}"

  

  - name: Install the common requirements on target

    package: name={{item}} state=present
@@ -18,6 +18,13 @@ 

      shell: |

          debuginfo-install --assumeyes {{item}}

      with_items:

-         - "{{ pkgs_debuginfo_req }}"

-   when:

-     - pkgs_debuginfo_req

+         - "{{ pkgs_debuginfo_req|d|list }}"

+ 

+ - block:

+   - package: name=yum-plugin-copr state=present

+   - shell: yum copr -y {{item}}

+     with_items:

+         - "{{copr_repos}}"

+     name: Enable copr repos using YUM

+     ignore_errors: True

+   when: copr_repos is defined

1 new commit added

6 years ago

please use: - "{{ pkgs_ordinary_req|d|list }}" and remove 'when'

Same here:
"{{ pkgs_debuginfo_req|d|list }}"

rebased onto 1f2f29d968a0dd9366d46e55a526ce6e9b857f70

6 years ago

Thanks for the tips, I've updated also pkgs-yum.yml.

Please reformat with:

pkg_mgr: "{{
             'rpm-ostree' if
                  hostvars[test_runner_inventory_name]['ansible_pkg_mgr'] == 'unknown'
                  and
                  is_atomic
              else hostvars[test_runner_inventory_name]['ansible_pkg_mgr']
        }}"

Let's keep this code as it is for now.
test - runner is a some vague area. Let's send this change as independent PR, after down changes are merged.

rebased onto 96edb5ca4f1d5ce36df67b02c39a33165a83e04b

6 years ago

rebased onto 3dad9ff

6 years ago

Commit 80f3935 fixes this pull-request

Pull-Request has been merged by astepano

6 years ago

Pull-Request has been merged by astepano

6 years ago