feat: split reposync into two roles (#307)
- reposync and packagerepo web service - change backing datastore to be cephfs /shared/app/packagerepo Reviewed-on: https://git.query.consul/unkinben/puppet-prod/pulls/307
This commit was merged in pull request #307.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# setup the autosyncer
|
||||
class profiles::reposync::autosyncer (
|
||||
Stdlib::Absolutepath $basepath = '/data/repos',
|
||||
Stdlib::Absolutepath $basepath = '/shared/apps/packagerepo',
|
||||
) {
|
||||
|
||||
# Ensure the autosyncer script is present and executable
|
||||
|
||||
@@ -8,7 +8,7 @@ define profiles::reposync::repos (
|
||||
String $arch = 'x86_64',
|
||||
String $repo_owner = 'root',
|
||||
String $repo_group = 'root',
|
||||
Stdlib::Absolutepath $basepath = '/data/repos',
|
||||
Stdlib::Absolutepath $basepath = '/shared/apps/packagerepo',
|
||||
Optional[Stdlib::HTTPUrl] $baseurl = undef,
|
||||
Optional[Stdlib::HTTPUrl] $mirrorlist = undef,
|
||||
){
|
||||
|
||||
@@ -3,7 +3,6 @@ class profiles::reposync::syncer {
|
||||
|
||||
include profiles::reposync::autosyncer
|
||||
include profiles::reposync::autopromoter
|
||||
include profiles::reposync::webserver
|
||||
|
||||
# Ensure the reposync config path exists
|
||||
file { '/etc/reposync':
|
||||
|
||||
@@ -92,6 +92,10 @@ class profiles::reposync::webserver (
|
||||
proxy_cache_max_size => '30000m',
|
||||
proxy_cache_inactive => '60d',
|
||||
proxy_temp_path => "${cache_root}/tmp",
|
||||
require => [
|
||||
Mkdir::P[$cache_root],
|
||||
Mkdir::P[$www_root]
|
||||
]
|
||||
}
|
||||
|
||||
# create the nginx vhost with the merged parameters
|
||||
@@ -131,15 +135,6 @@ class profiles::reposync::webserver (
|
||||
}
|
||||
}
|
||||
|
||||
# export cnames for webserver
|
||||
profiles::dns::record { "${::facts['networking']['fqdn']}_repos.main.unkin.net_CNAME":
|
||||
value => $::facts['networking']['hostname'],
|
||||
type => 'CNAME',
|
||||
record => 'repos.main.unkin.net.',
|
||||
zone => $::facts['networking']['domain'],
|
||||
order => 10,
|
||||
}
|
||||
|
||||
if $::facts['os']['selinux']['config_mode'] == 'enforcing' {
|
||||
|
||||
# set httpd_sys_content_t to all files under the www_root
|
||||
|
||||
@@ -29,6 +29,9 @@ download_gpg_key() {
|
||||
curl -s --create-dirs -o "${basepath}/live/${reponame}/${filename}" "$gpgkeyurl" || {
|
||||
echo "Failed to download GPG key from $gpgkeyurl"
|
||||
}
|
||||
|
||||
# import the gpg key
|
||||
rpm --import "${basepath}/live/${reponame}/${filename}" || echo "Failed to import gpg key ${basepath}/live/${reponame}/${filename}"
|
||||
}
|
||||
|
||||
# Function to perform rsync with hard links
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# a role to deploy the webserver for packagerepo
|
||||
class roles::infra::reposync::repo {
|
||||
if $facts['firstrun'] {
|
||||
include profiles::defaults
|
||||
include profiles::firstrun::init
|
||||
}else{
|
||||
include profiles::defaults
|
||||
include profiles::base
|
||||
include profiles::base::datavol
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# a role to deploy a packagerepo
|
||||
# a role to deploy the syncer/promoter for packagerepo
|
||||
class roles::infra::reposync::syncer {
|
||||
if $facts['firstrun'] {
|
||||
include profiles::defaults
|
||||
|
||||
Reference in New Issue
Block a user