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

Revert #258, which added purge_unmanaged_repos #287

Merged
merged 1 commit into from
Dec 9, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@
# @param utils_package_name
# Name of the utils package, e.g. 'yum-utils', or 'dnf-utils'.
#
# @param purge_unmanaged_repos
# Should repos not managed by puppet be removed?
#
# @param repodir
# Where are repos stored on this system?
#
# @example Enable management of the default repos for a supported OS:
# ---
# yum::manage_os_default_repos: true
Expand Down Expand Up @@ -111,27 +105,13 @@
Array[String] $repo_exclusions = [],
Hash[String, Hash[String, String]] $gpgkeys = {},
String $utils_package_name = 'yum-utils',
Boolean $purge_unmanaged_repos = false,
Stdlib::Unixpath $repodir = '/etc/yum.repos.d',
) {
$module_metadata = load_module_metadata($module_name)
$supported_operatingsystems = $module_metadata['operatingsystem_support']
$supported_os_names = $supported_operatingsystems.map |$os| {
$os['operatingsystem']
}

if $purge_unmanaged_repos {
file { $repodir:
ensure => 'directory',
owner => 'root',
group => 'root',
mode => '0644',
recurse => true,
recurselimit => 1,
purge => true,
}
}

unless member($supported_os_names, $facts['os']['name']) {
fail("${facts['os']['name']} not supported")
}
Expand Down
3 changes: 1 addition & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,9 @@
end

context 'to an array of all supported repos' do
let(:params) { { managed_repos: supported_repos, purge_unmanaged_repos: true } }
let(:params) { { managed_repos: supported_repos } }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_file('/etc/yum.repos.d').with_purge(true) }
it { is_expected.to have_yumrepo_resource_count(supported_repos.count) }

it_behaves_like 'a catalog containing repos', supported_repos
Expand Down