Skip to content

Commit

Permalink
Remove section parameter from yum::config
Browse files Browse the repository at this point in the history
According to the man page for `yum.conf(5)`, `[main]` is the only valid
section for global Yum config options.  All other section names refer to
individual repositories.  This commit removes the `section` parameter in
the `yum::config` defined type, hard-coding it to `main`.
  • Loading branch information
lamawithonel committed Jan 20, 2017
1 parent e0c156b commit 8d4e15e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
define yum::config (
Variant[Boolean, Integer, Enum['absent'], String] $ensure,
String $key = $title,
String $section = 'main'
) {

$_ensure = $ensure ? {
Expand All @@ -37,10 +36,10 @@
default => "set ${key} '${_ensure}'",
}

augeas { "yum.conf_${section}_${key}":
augeas { "yum.conf_${key}":
incl => '/etc/yum.conf',
lens => 'Yum.lns',
context => "/files/etc/yum.conf/${section}/",
context => '/files/etc/yum.conf/main/',
changes => $_changes,
}
}
6 changes: 3 additions & 3 deletions spec/defines/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

it { is_expected.to compile.with_all_deps }
it 'contains an Augeas resource with the correct changes' do
is_expected.to contain_augeas("yum.conf_main_#{title}").with(
is_expected.to contain_augeas("yum.conf_#{title}").with(
changes: "set assumeyes '1'"
)
end
Expand All @@ -24,7 +24,7 @@

it { is_expected.to compile.with_all_deps }
it 'contains an Augeas resource with the correct changes' do
is_expected.to contain_augeas("yum.conf_main_#{title}").with(
is_expected.to contain_augeas("yum.conf_#{title}").with(
changes: "set assumeyes '0'"
)
end
Expand All @@ -36,7 +36,7 @@

it { is_expected.to compile.with_all_deps }
it 'contains an Augeas resource with the correct changes' do
is_expected.to contain_augeas("yum.conf_main_#{title}").with(
is_expected.to contain_augeas("yum.conf_#{title}").with(
changes: "set assumeyes '1, 2'"
)
end
Expand Down

0 comments on commit 8d4e15e

Please sign in to comment.