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

Set repo priority to 'undef' #17

Merged
merged 1 commit into from
Jun 17, 2015
Merged

Set repo priority to 'undef' #17

merged 1 commit into from
Jun 17, 2015

Conversation

chuman
Copy link
Contributor

@chuman chuman commented Jun 17, 2015

This should be set to undef for:
if $priority { ... }
to be ignored in repo/yum.pp

This should be set to undef for:
  if $priority { ... }
to be ignored in repo/yum.pp
@skpy
Copy link
Contributor

skpy commented Jun 17, 2015

The yumrepo priority parameter accepts absent as a valid value, which will ensure that no priority line is present in the generated repo file.

Locally, I've added the following line to the yum repo spec test:

should_not create_package('yum-plugin-priorities')

And rake spec runs the tests successfully. This indicates to me that Puppet is handling absent similar to undef.

However, I've also run puppet apply with the following trivial manifest:

$foo = absent
if $foo {
  notice("FOO IS TRUE")
}

and received the following output:

Notice: Scope(Class[main]): FOO IS TRUE
Notice: Compiled catalog for vagrant-smerrill.dev in environment production in 0.02 seconds
Notice: Finished catalog run in 0.05 seconds

So Puppet appears to be treating the bare word absent as boolean true within the conditional evaluation.

TL;DR: absent may well be installing the yum-plugins-priorities package even though no priority line will be defined within the generated repo file. It's not clear to me why the spec test claim it's not being installed; but this PR is a better solution all around.

Thanks!

skpy added a commit that referenced this pull request Jun 17, 2015
Set repo priority to 'undef'
@skpy skpy merged commit 7a9438b into voxpupuli:master Jun 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants