Skip to content

Commit

Permalink
add dedicated debian repo profile
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Aug 30, 2024
1 parent 552bfd3 commit ada7227
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 10 deletions.
11 changes: 11 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,15 @@ Vagrant.configure("2") do |config|
provider.vm.box_url = CENTOS_9_BOX_URL
end
end

config.vm.define "repo-deb" do |override|
override.vm.hostname = "repo-deb"
override.vm.box = "centos/stream9"

override.vm.provider "libvirt" do |libvirt, provider|
libvirt.memory = "2048"
libvirt.machine_virtual_size = 40
provider.vm.box_url = CENTOS_9_BOX_URL
end
end
end
1 change: 1 addition & 0 deletions puppet/data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
stable_release: '3.11'
profiles::web::stable: '%{alias("stable_release")}'
profiles::repo::deb::stable: '%{alias("stable_release")}'

backup_servicename: 'backups.theforeman.org'
backup_username: 'backup-%{facts.networking.hostname}'
Expand Down
2 changes: 2 additions & 0 deletions puppet/data/vagrant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ profiles::jenkins::node::swap_size_mb: 0

profiles::web::https: false

profiles::repo::deb::https: false

redmine::https: false
5 changes: 5 additions & 0 deletions puppet/manifests/site.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@
include profiles::base
include profiles::web
}

node /^repo-deb\d+\.[a-z]+\.theforeman\.org$/ {
include profiles::base
include profiles::repo::deb
}
13 changes: 4 additions & 9 deletions puppet/modules/freight/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# @summary install freight
class freight {
if $facts['os']['family'] == 'Debian' {
apt::source { 'freight':
location => 'http://build.openvpn.net/debian/freight_team',
repos => 'main',
key => {
id => '30EBF4E73CCE63EEE124DD278E6DA8B4E158C569',
source => 'https://swupdate.openvpn.net/repos/repo-public.gpg',
},
before => Package['freight'],
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '9' {
class {'epel':
epel_testing_enabled => true,
before => Package['freight'],
}
}

Expand Down
3 changes: 2 additions & 1 deletion puppet/modules/freight/manifests/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Stdlib::Absolutepath $stagedir,
String $vhost,
Variant[String, Array[String]] $cron_matches,
String[1] $stable,
) {
require freight

Expand Down Expand Up @@ -77,7 +78,7 @@
owner => 'root',
group => 'root',
mode => '0644',
content => epp("${module_name}/${vhost}-HEADER.html.epp", { 'stable' => $profiles::web::stable }),
content => epp("${module_name}/${vhost}-HEADER.html.epp", { 'stable' => $stable }),
}
file { "${webdir}/foreman.asc":
ensure => link,
Expand Down
33 changes: 33 additions & 0 deletions puppet/modules/profiles/manifests/repo/deb.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @summary A profile for the debian repo machines
#
# @param stable
# Latest release that users expect
#
# @param https
# Whether to enable HTTPS. This is typically wanted but can only be enabled
# in a 2 pass setup. First Apache needs to run for Letsencrypt to function.
# Then Letsencrypt can be enabled. Also useful to turn off in test setups.
class profiles::repo::deb (
String[1] $stable,
Boolean $https = true,
) {
class { 'web':
https => $https,
}
contain web

class { 'web::vhost::archivedeb':
stable => $stable,
}
contain web::vhost::archivedeb

class { 'web::vhost::deb':
stable => $stable,
}
contain web::vhost::deb

class { 'web::vhost::stagingdeb':
stable => $stable,
}
contain web::vhost::stagingdeb
}
9 changes: 9 additions & 0 deletions puppet/modules/profiles/manifests/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@
}
contain web

class { 'web::vhost::archivedeb':
stable => $stable,
}
contain web::vhost::archivedeb

class { 'web::vhost::deb':
stable => $stable,
}
contain web::vhost::deb

class { 'web::vhost::debugs':
Expand All @@ -33,6 +39,9 @@

contain web::vhost::downloads

class { 'web::vhost::stagingdeb':
stable => $stable,
}
contain web::vhost::stagingdeb

class { 'web::vhost::web':
Expand Down
2 changes: 2 additions & 0 deletions puppet/modules/web/manifests/vhost/archivedeb.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# @summary Set up the archivedeb vhost
# @api private
class web::vhost::archivedeb(
String[1] $stable,
String $user = 'freightarchive',
Stdlib::Absolutepath $home = "/home/${user}",
) {
Expand All @@ -12,6 +13,7 @@
stagedir => "/var/www/${user}",
vhost => 'archivedeb',
cron_matches => [],
stable => $stable,
}

secure_ssh::rsync::receiver_setup { $user:
Expand Down
2 changes: 2 additions & 0 deletions puppet/modules/web/manifests/vhost/deb.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# @summary Set up the deb vhost
# @api private
class web::vhost::deb (
String[1] $stable,
String $user = 'freight',
Stdlib::Absolutepath $home = "/home/${user}",
) {
Expand All @@ -12,6 +13,7 @@
stagedir => '/var/www/freight',
vhost => 'deb',
cron_matches => ['nightly', 'scratch'],
stable => $stable,
}

# Can't use a standard rsync define here as we need to extend the
Expand Down
2 changes: 2 additions & 0 deletions puppet/modules/web/manifests/vhost/stagingdeb.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# @summary Set up the stagingdeb vhost
# @api private
class web::vhost::stagingdeb(
String[1] $stable,
String $user = 'freightstage',
Stdlib::Absolutepath $home = "/home/${user}",
) {
Expand All @@ -12,6 +13,7 @@
stagedir => "/var/www/${user}",
vhost => 'stagingdeb',
cron_matches => 'all',
stable => $stable,
}

secure_ssh::rsync::receiver_setup { $user:
Expand Down
4 changes: 4 additions & 0 deletions vagrant/manifests/default.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
node /^discourse.*/ {
include profiles::discourse
}

node /^repo-deb.*/ {
include profiles::repo::deb
}

0 comments on commit ada7227

Please sign in to comment.