Skip to content

Commit 30bdcdd

Browse files
committed
proxmox profile/role
1 parent 6f29b42 commit 30bdcdd

5 files changed

Lines changed: 67 additions & 3 deletions

File tree

manifests/profile/apt.pp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
release => "${facts['os']['distro']['codename']}-security",
129129
location => ['http://security.debian.org/debian-security'],
130130
;
131-
# remove updates?
132131
'updates' : release => "${facts['os']['distro']['codename']}-updates";
133132
}
134133

@@ -159,8 +158,8 @@
159158
;
160159
'main' : release => $facts['os']['distro']['codename'];
161160
'security' : release => "${facts['os']['distro']['codename']}-security";
162-
# remove updates and backports?
163161
'updates' : release => "${facts['os']['distro']['codename']}-updates";
162+
# remove backports?
164163
'backports': release => "${facts['os']['distro']['codename']}-backports";
165164
}
166165

manifests/profile/proxmox.pp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
class nebula::profile::proxmox (
2+
String $debian_mirror = lookup('nebula::profile::apt::mirror'),
3+
Enum['pve-test', 'pve-no-subscription', 'pve-enterprise'] $pve_repo = 'pve-no-subscription',
4+
Enum['tentacle'] $ceph_release = 'tentacle',
5+
) {
6+
$pve_url_base = $pve_repo ? {
7+
'pve-enterprise' => 'https://enterprise.proxmox.com/debian',
8+
default => 'http://download.proxmox.com/debian'
9+
}
10+
$ceph_location = "${pve_url_base}/ceph-${ceph_release}"
11+
12+
apt::source {
13+
default:
14+
source_format => 'sources',
15+
repos => ['main', 'contrib', 'non-free-firmware'],
16+
keyring => '/usr/share/keyrings/debian-archive-keyring.gpg',
17+
;
18+
'debian':
19+
location => [$debian_mirror],
20+
release => [
21+
$facts['os']['distro']['codename'],
22+
"${facts['os']['distro']['codename']}-updates",
23+
],
24+
;
25+
'debian-security':
26+
location => ['http://security.debian.org/debian-security'],
27+
release => ["${facts['os']['distro']['codename']}-security"],
28+
;
29+
}
30+
31+
apt::source {
32+
default:
33+
source_format => 'sources',
34+
keyring => '/usr/share/keyrings/proxmox-archive-keyring.gpg',
35+
repos => [$pve_repo],
36+
;
37+
'proxmox': location => ["${pve_url_base}/pve"];
38+
'ceph': location => ["${pve_url_base}/ceph-${ceph_release}"];
39+
}
40+
}

manifests/role/proxmox.pp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class nebula::role::proxmox (
2+
) {
3+
include nebula::profile::authorized_keys
4+
include nebula::profile::root
5+
include nebula::profile::vim
6+
include nebula::profile::ntp
7+
include nebula::profile::taghosts::tags
8+
9+
include nebula::profile::proxmox
10+
}

spec/classes/all_roles.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def test_roles(slice_number = 1, slice_count = 1)
7878
end
7979

8080
it { is_expected.to compile_along_with_all_roles(hiera_fixture) }
81-
it { is_expected.to contain_class("nebula::role::minimum") }
8281
end
8382
end
8483
end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
require "spec_helper"
4+
5+
describe "nebula::profile::proxmox" do
6+
on_supported_os(supported_os: Nebula.supported_os).each do |os, os_facts|
7+
context "on #{os}" do
8+
let(:facts) { os_facts }
9+
10+
it { is_expected.to contain_apt__source("proxmox").with_location(["http://download.proxmox.com/debian/pve"]) }
11+
it { is_expected.to contain_apt__source("ceph").with_location(["http://download.proxmox.com/debian/ceph-tentacle"]) }
12+
it { is_expected.to contain_apt__source("debian").with_location(["http://deb.debian.org/debian"]) }
13+
it { is_expected.to contain_apt__source("debian-security").with_location(["http://security.debian.org/debian-security"]) }
14+
end
15+
end
16+
end

0 commit comments

Comments
 (0)