From 000387ac238dc8d9cdbbfc565702903c2c3736c6 Mon Sep 17 00:00:00 2001 From: Jiri Tyr Date: Tue, 20 Feb 2018 12:47:12 +0000 Subject: [PATCH] Fix default value of gpgcheck in doc (PR #36267) --- .../modules/packaging/os/yum_repository.py | 2 +- .../tasks/yum_repository_centos.yml | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/yum_repository.py b/lib/ansible/modules/packaging/os/yum_repository.py index 0baf6bfb09..1b1bef96ed 100644 --- a/lib/ansible/modules/packaging/os/yum_repository.py +++ b/lib/ansible/modules/packaging/os/yum_repository.py @@ -124,7 +124,7 @@ options: gpgcheck: required: false choices: ['yes', 'no'] - default: 'no' + default: null description: - Tells yum whether or not it should perform a GPG signature check on packages. 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 6a3f25b421..2495e1e281 100644 --- a/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml +++ b/test/integration/targets/yum_repository/tasks/yum_repository_centos.yml @@ -177,3 +177,24 @@ yum_repository: name: listtest state: absent + +- name: disable epel (clean up) + yum_repository: + name: epel + state: absent + +- name: add epel + yum_repository: + name: epel + description: EPEL yum repo + baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/ + state: present + gpgcheck: no + +- set_fact: + repofile: "{{ lookup('file', '/etc/yum.repos.d/epel.repo') }}" + +- name: check for gpgcheck=0 + assert: + that: + - "'gpgcheck = 0' in repofile"