Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing default value of gpgcheck #36267

Merged
merged 4 commits into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ansible/modules/packaging/os/yum_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
gpgcheck:
required: false
choices: ['yes', 'no']
default: 'no'
default: null
description:
- Tells yum whether or not it should perform a GPG signature check on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explicitly state that it falls back to yum's default in case of None? This was ambiguous when I read the doc, thus I asked Martin to debug it, which resulted in that PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtyr ^^^

packages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add gpgcheck: no for the assertion below to pass.

gpgcheck: no

- set_fact:
repofile: "{{ lookup('file', '/etc/yum.repos.d/epel.repo') }}"

- name: check for gpgcheck=0
assert:
that:
- "'gpgcheck = 0' in repofile"