Integration tests: prevent loop squashing ()

1. the feature will be deprecated in 2.11
2. these modules support passing lists
3. loop squashing does not work with collections
This commit is contained in:
Martin Krizek 2019-10-23 21:02:25 +02:00 committed by GitHub
parent d620a209a5
commit 18b9ce8b82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 35 deletions
test/integration/targets

View file

@ -283,11 +283,12 @@
- name: Clean up
apt:
name: "{{ item }}"
name: "{{ pkgs }}"
state: absent
with_items:
- libcaca-dev
- libslang2-dev
vars:
pkgs:
- libcaca-dev
- libslang2-dev
# https://github.com/ansible/ansible/issues/38995
- name: build-dep for a package

View file

@ -197,9 +197,7 @@
- name: install non-existent rpm
dnf:
name: "{{ item }}"
with_items:
- does-not-exist
name: does-not-exist
register: non_existent_rpm
ignore_errors: True

View file

@ -80,16 +80,8 @@
- name: now put it back in case someone wanted it (like us!)
pip:
name: "{{ item }}"
name: "{{ pip_test_packages }}"
state: present
with_items: "{{ pip_test_packages }}"
register: squash_param
- name: check that list has been condensed
assert:
that:
- squash_param.results|length == 1
- squash_param.results[0].name|sort == pip_test_packages|sort
# Test virtualenv installations

View file

@ -385,11 +385,12 @@
- name: install dinginessentail both archs
yum:
name: "{{ item }}"
name: "{{ pkgs }}"
state: present
with_items:
- "{{ repodir }}/dinginessentail-1.1-1.x86_64.rpm"
- "{{ repodir_i686 }}/dinginessentail-1.1-1.i686.rpm"
vars:
pkgs:
- "{{ repodir }}/dinginessentail-1.1-1.x86_64.rpm"
- "{{ repodir_i686 }}/dinginessentail-1.1-1.i686.rpm"
- name: try to install lower version of dinginessentail from rpm file, without allow_downgrade, just one arch
yum:
@ -424,11 +425,12 @@
- name: install dinginessentail both archs
yum:
name: "{{ item }}"
name: "{{ pkgs }}"
state: present
with_items:
- "{{ repodir }}/dinginessentail-1.0-1.x86_64.rpm"
- "{{ repodir_i686 }}/dinginessentail-1.0-1.i686.rpm"
vars:
pkgs:
- "{{ repodir }}/dinginessentail-1.0-1.x86_64.rpm"
- "{{ repodir_i686 }}/dinginessentail-1.0-1.i686.rpm"
- name: Update both arch in one task using rpm files
yum:

View file

@ -301,9 +301,8 @@
yum: name=sos,bc state=removed
- name: install non-existent rpm
yum: name="{{ item }}"
with_items:
- does-not-exist
yum:
name: does-not-exist
register: non_existent_rpm
ignore_errors: True

View file

@ -1,19 +1,21 @@
- name: install a group to test and yum-utils
yum:
name: "{{ item }}"
name: "{{ pkgs }}"
state: present
with_items:
- "@Custom Group"
- yum-utils
vars:
pkgs:
- "@Custom Group"
- yum-utils
when: ansible_pkg_mgr == "yum"
- name: install a group to test and dnf-utils
yum:
name: "{{ item }}"
name: "{{ pkgs }}"
state: present
with_items:
- "@Custom Group"
- dnf-utils
vars:
pkgs:
- "@Custom Group"
- dnf-utils
when: ansible_pkg_mgr == "dnf"
- name: check mode remove the group