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

add dedicated debian repo profile #2108

Merged
merged 4 commits into from
Sep 12, 2024
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
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/nodes/repo-deb01.osuosl.theforeman.org.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
profiles::repo::deb::https: false
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: 3 additions & 10 deletions puppet/modules/freight/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# @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' {
include epel
Class['Epel'] -> Package['freight']
}

package { 'freight':
Expand Down
12 changes: 10 additions & 2 deletions puppet/modules/freight/manifests/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@
},
]

# locations doesn't autorequire the headers module
include apache::mod::headers
# vhosts don't autorequire the expires module
# https://github.com/puppetlabs/puppetlabs-apache/pull/2559
# limit to not EL7 as there we use apache::default_mods
if $facts['os']['family'] != 'RedHat' or $facts['os']['release']['major'] != '7' {
include apache::mod::expires
}
Comment on lines +61 to +66
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we move that to

apache::default_mods:
- status

include apache::mod::alias
include apache::mod::autoindex
include apache::mod::dir
include apache::mod::mime
Comment on lines +67 to +70
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if any of these should (or should not) go to our definition of apache::default_mods


web::vhost { $vhost:
docroot => $webdir,
Expand Down
27 changes: 27 additions & 0 deletions puppet/modules/profiles/manifests/repo/deb.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# @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

contain web::vhost::archivedeb

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

contain web::vhost::stagingdeb
}
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
}