Skip to content

Commit ada7227

Browse files
committed
add dedicated debian repo profile
1 parent 552bfd3 commit ada7227

File tree

12 files changed

+77
-10
lines changed

12 files changed

+77
-10
lines changed

Vagrantfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,15 @@ Vagrant.configure("2") do |config|
123123
provider.vm.box_url = CENTOS_9_BOX_URL
124124
end
125125
end
126+
127+
config.vm.define "repo-deb" do |override|
128+
override.vm.hostname = "repo-deb"
129+
override.vm.box = "centos/stream9"
130+
131+
override.vm.provider "libvirt" do |libvirt, provider|
132+
libvirt.memory = "2048"
133+
libvirt.machine_virtual_size = 40
134+
provider.vm.box_url = CENTOS_9_BOX_URL
135+
end
136+
end
126137
end

puppet/data/common.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
stable_release: '3.11'
33
profiles::web::stable: '%{alias("stable_release")}'
4+
profiles::repo::deb::stable: '%{alias("stable_release")}'
45

56
backup_servicename: 'backups.theforeman.org'
67
backup_username: 'backup-%{facts.networking.hostname}'

puppet/data/vagrant.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ profiles::jenkins::node::swap_size_mb: 0
2222

2323
profiles::web::https: false
2424

25+
profiles::repo::deb::https: false
26+
2527
redmine::https: false

puppet/manifests/site.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@
4141
include profiles::base
4242
include profiles::web
4343
}
44+
45+
node /^repo-deb\d+\.[a-z]+\.theforeman\.org$/ {
46+
include profiles::base
47+
include profiles::repo::deb
48+
}

puppet/modules/freight/manifests/init.pp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# @summary install freight
22
class freight {
3-
if $facts['os']['family'] == 'Debian' {
4-
apt::source { 'freight':
5-
location => 'http://build.openvpn.net/debian/freight_team',
6-
repos => 'main',
7-
key => {
8-
id => '30EBF4E73CCE63EEE124DD278E6DA8B4E158C569',
9-
source => 'https://swupdate.openvpn.net/repos/repo-public.gpg',
10-
},
11-
before => Package['freight'],
3+
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '9' {
4+
class {'epel':
5+
epel_testing_enabled => true,
6+
before => Package['freight'],
127
}
138
}
149

puppet/modules/freight/manifests/user.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Stdlib::Absolutepath $stagedir,
66
String $vhost,
77
Variant[String, Array[String]] $cron_matches,
8+
String[1] $stable,
89
) {
910
require freight
1011

@@ -77,7 +78,7 @@
7778
owner => 'root',
7879
group => 'root',
7980
mode => '0644',
80-
content => epp("${module_name}/${vhost}-HEADER.html.epp", { 'stable' => $profiles::web::stable }),
81+
content => epp("${module_name}/${vhost}-HEADER.html.epp", { 'stable' => $stable }),
8182
}
8283
file { "${webdir}/foreman.asc":
8384
ensure => link,
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# @summary A profile for the debian repo machines
2+
#
3+
# @param stable
4+
# Latest release that users expect
5+
#
6+
# @param https
7+
# Whether to enable HTTPS. This is typically wanted but can only be enabled
8+
# in a 2 pass setup. First Apache needs to run for Letsencrypt to function.
9+
# Then Letsencrypt can be enabled. Also useful to turn off in test setups.
10+
class profiles::repo::deb (
11+
String[1] $stable,
12+
Boolean $https = true,
13+
) {
14+
class { 'web':
15+
https => $https,
16+
}
17+
contain web
18+
19+
class { 'web::vhost::archivedeb':
20+
stable => $stable,
21+
}
22+
contain web::vhost::archivedeb
23+
24+
class { 'web::vhost::deb':
25+
stable => $stable,
26+
}
27+
contain web::vhost::deb
28+
29+
class { 'web::vhost::stagingdeb':
30+
stable => $stable,
31+
}
32+
contain web::vhost::stagingdeb
33+
}

puppet/modules/profiles/manifests/web.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222
}
2323
contain web
2424

25+
class { 'web::vhost::archivedeb':
26+
stable => $stable,
27+
}
2528
contain web::vhost::archivedeb
2629

30+
class { 'web::vhost::deb':
31+
stable => $stable,
32+
}
2733
contain web::vhost::deb
2834

2935
class { 'web::vhost::debugs':
@@ -33,6 +39,9 @@
3339

3440
contain web::vhost::downloads
3541

42+
class { 'web::vhost::stagingdeb':
43+
stable => $stable,
44+
}
3645
contain web::vhost::stagingdeb
3746

3847
class { 'web::vhost::web':

puppet/modules/web/manifests/vhost/archivedeb.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# @summary Set up the archivedeb vhost
22
# @api private
33
class web::vhost::archivedeb(
4+
String[1] $stable,
45
String $user = 'freightarchive',
56
Stdlib::Absolutepath $home = "/home/${user}",
67
) {
@@ -12,6 +13,7 @@
1213
stagedir => "/var/www/${user}",
1314
vhost => 'archivedeb',
1415
cron_matches => [],
16+
stable => $stable,
1517
}
1618

1719
secure_ssh::rsync::receiver_setup { $user:

puppet/modules/web/manifests/vhost/deb.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# @summary Set up the deb vhost
22
# @api private
33
class web::vhost::deb (
4+
String[1] $stable,
45
String $user = 'freight',
56
Stdlib::Absolutepath $home = "/home/${user}",
67
) {
@@ -12,6 +13,7 @@
1213
stagedir => '/var/www/freight',
1314
vhost => 'deb',
1415
cron_matches => ['nightly', 'scratch'],
16+
stable => $stable,
1517
}
1618

1719
# Can't use a standard rsync define here as we need to extend the

0 commit comments

Comments
 (0)