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

explains what happens when gpgcheck is not set in yum #45796

Merged
merged 2 commits into from
Sep 20, 2018

Conversation

acozine
Copy link
Contributor

@acozine acozine commented Sep 18, 2018

SUMMARY

Related to #39485.
Related to #36267.

We've gone back and forth a few times on how to describe the way the gpgcheck parameter works. It has no default value, but functionally it defaults to the setting in /etc/yum.conf, which defaults to no. This PR is an attempt to clarify how the gpgcheck parameter interacts with the settings on the target machine.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

docs.ansible.com

ANSIBLE VERSION

2.8

@acozine acozine added the docs This issue/PR relates to or includes documentation. label Sep 18, 2018
@acozine acozine added this to To do in OLD Ansible Documentation via automation Sep 18, 2018
@acozine
Copy link
Contributor Author

acozine commented Sep 18, 2018

@mkrizek @webknjaz @jtyr @dagwieers would this meet everyone's needs?

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 18, 2018
@@ -108,6 +108,8 @@
description:
- Tells yum whether or not it should perform a GPG signature check on
packages.
- No default setting. If the value is not set, falls back on the global
default setting in C(/etc/yum.conf).
Copy link
Contributor

Choose a reason for hiding this comment

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

The module documentation is using defaults as described in the yum.conf man page. For gpgcheck option it's this:

gpgcheck Either `1' or `0'. This tells yum whether or not it should perform a GPG signature check on
packages.  When  this  is  set  in the [main] section it sets the default for all repositories.  The
default is `0'.

That means that the module should have defaults: 'no'. Then any additional text is not required as it's logical that the defaults can be overridden from the global config file (/etc/yum.conf).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disagree. This documentation covers the Ansible module, which does not have a default setting. In the absence of a setting in the Ansible task, the default system setting gets applied. That default is no. However, I take your point about /etc/yum.confand will update the suggested change.

Copy link
Contributor

Choose a reason for hiding this comment

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

@acozine Agreed, the default means that if you do not specify it, what will happen. And in this case, if you don't specify it, it leaves this part of the configuration as-is. No change.

In the near future we will show the argument_spec in the module documentation, so it becomes more important to have the argument_spec very clear (or clarify using documentation).

Copy link
Contributor

@dagwieers dagwieers Sep 20, 2018

Choose a reason for hiding this comment

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

In fact the user may want to do any of four things:

  • Add specifically gpgcheck=yes
  • Add specifically gpgcheck=no
  • Remove gpgcheck from the config
  • Leave the gpgcheck untouched (keep as-is)

At the moment we only cover 3 options (no, yes, null).

Copy link
Contributor

@jtyr jtyr Sep 20, 2018

Choose a reason for hiding this comment

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

The option should have default: 'no' as that's whats in the yum.conf documentation. Most of the options in the module are in the same situation - default set in the DOCUMENTATION but no default set in the argument_spec. gpgcheck should be no exception.

Copy link
Contributor

Choose a reason for hiding this comment

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

More logical would be to add a note into the DOCUMENTATION explaining the relation between the defaults in the DOCUMENTATION and defaults set by YUM.

Copy link
Contributor

@jtyr jtyr Sep 20, 2018

Choose a reason for hiding this comment

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

@dagwieers This module cannot Leave the gpgcheck untouched (keep as-is). This module enforces an explicit value into the repo file. If the option is not specified, the option is not set at all and then whatever system default is applied instead.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Sep 19, 2018
@webknjaz webknjaz merged commit 34b8cbd into ansible:devel Sep 20, 2018
@acozine acozine moved this from To do to Backport to 2.7 in OLD Ansible Documentation Sep 20, 2018
@acozine acozine deleted the gpgcheck_fix branch September 24, 2018 22:02
acozine added a commit to acozine/ansible that referenced this pull request Nov 5, 2018
@acozine acozine mentioned this pull request Nov 5, 2018
abadger pushed a commit that referenced this pull request Nov 5, 2018
@acozine acozine moved this from Backport to 2.7 to Done in OLD Ansible Documentation Nov 6, 2018
@dagwieers dagwieers added the packaging Packaging category label Mar 3, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. packaging Packaging category small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants