puppet-prod/site/profiles/manifests/reposync/syncer.pp
Ben Vincent 71c316e7ae feat: cleanup reposync conf files
- add feature to /etc/reposync/conf.d to ensure the subfiles are cleaned
  up when they are not defined
2024-02-10 15:37:24 +11:00

34 lines
826 B
Puppet

# setup a reposync syncer
class profiles::reposync::syncer {
include profiles::packages::reposync
include profiles::reposync::autosyncer
include profiles::reposync::autopromoter
include profiles::reposync::webserver
# Ensure the reposync config path exists
file { '/etc/reposync':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
file { '/etc/reposync/conf.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
purge => true,
recurse => true,
force => true,
}
# get a list of repos as a hash, and iterate through them
$repos = lookup('profiles::reposync::repos_list', {})
$repos.each | String $name, Hash $repo_hash | {
profiles::reposync::repos { $name:
* => $repo_hash,
}
}
}