From 1a3037ff639ed7c85c87aa1db3e8c9a5f119a139 Mon Sep 17 00:00:00 2001 From: Jiri Tyr Date: Thu, 9 Nov 2017 15:57:27 +0000 Subject: [PATCH] Making options of type list (fixing #32704) (#32706) --- .../modules/packaging/os/yum_repository.py | 4 ++-- .../tasks/yum_repository_centos.yml | 15 +++++++++------ .../tasks/yum_repository_fedora.yml | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/ansible/modules/packaging/os/yum_repository.py b/lib/ansible/modules/packaging/os/yum_repository.py index e7ab9daab6..f247bec634 100644 --- a/lib/ansible/modules/packaging/os/yum_repository.py +++ b/lib/ansible/modules/packaging/os/yum_repository.py @@ -645,7 +645,7 @@ def main(): description=dict(), enabled=dict(type='bool'), enablegroups=dict(type='bool'), - exclude=dict(), + exclude=dict(type='list'), failovermethod=dict(choices=['roundrobin', 'priority']), file=dict(), gpgcakey=dict(), @@ -653,7 +653,7 @@ def main(): gpgkey=dict(type='list'), http_caching=dict(choices=['all', 'packages', 'none']), include=dict(), - includepkgs=dict(), + includepkgs=dict(type='list'), ip_resolve=dict(choices=['4', '6', 'IPv4', 'IPv6', 'whatever']), keepalive=dict(type='bool'), keepcache=dict(choices=['0', '1']), diff --git a/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml b/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml index 596c3c730d..6a3f25b421 100644 --- a/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml +++ b/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml @@ -89,8 +89,6 @@ async: no enablegroups: no file: epel2 - exclude: - - sl ip_resolve: 4 keepalive: no register: epel_add @@ -106,7 +104,6 @@ - "'async = 0' in repofile" - "'name = New description' in repofile" - "'enablegroups = 0' in repofile" - - "\"exclude = ['sl']\" in repofile" - "'ip_resolve = 4' in repofile" - "'keepalive = 0' in repofile" @@ -118,8 +115,6 @@ async: no enablegroups: no file: epel2 - exclude: - - sl ip_resolve: 4 keepalive: no register: epel_add @@ -147,7 +142,7 @@ assert: that: not epel_add.changed -- name: Test list for baseurl and gpgkey +- name: Test list options yum_repository: name: listtest description: Testing list feature @@ -157,6 +152,12 @@ gpgkey: - gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }} - gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG2-KEY-EPEL-{{ ansible_distribution_major_version }} + exclude: + - aaa + - bbb + includepkgs: + - ccc + - ddd - set_fact: repofile: "{{ lookup('file', '/etc/yum.repos.d/listtest.repo') }}" @@ -168,6 +169,8 @@ - "'download2.fedoraproject.org' in repofile" - "'RPM-GPG-KEY-EPEL' in repofile" - "'RPM-GPG2-KEY-EPEL' in repofile" + - "'aaa bbb' in repofile" + - "'ccc ddd' in repofile" value: - name: Cleanup list test repo diff --git a/test/integration/targets/yum_repository/tasks/yum_repository_fedora.yml b/test/integration/targets/yum_repository/tasks/yum_repository_fedora.yml index 866bc6710b..9269319045 100644 --- a/test/integration/targets/yum_repository/tasks/yum_repository_fedora.yml +++ b/test/integration/targets/yum_repository/tasks/yum_repository_fedora.yml @@ -101,7 +101,7 @@ - "'async = 0' in repofile" - "'name = New description' in repofile" - "'enablegroups = 0' in repofile" - - "\"exclude = ['libbdplus']\" in repofile" + - "'exclude = libbdplus' in repofile" - "'ip_resolve = 4' in repofile" - "'keepalive = 0' in repofile"