Skip to content

Commit 36ac7b9

Browse files
committed
Fixes #38993: add OpenVox repository
Add OpenVox repository when relevant parameters are in use.
1 parent 2b0353f commit 36ac7b9

File tree

10 files changed

+91
-2
lines changed

10 files changed

+91
-2
lines changed

app/views/unattended/provisioning_templates/cloud_init/cloud_init_default.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ runcmd:
7777
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
7878
<%= indent(2) { snippet 'puppetlabs_repo' } %>
7979
<% end -%>
80+
<% if host_param_true?('enable-openvox8') || host_param_true?('enable-openvox7') -%>
81+
<%= indent(2) { snippet 'voxpupuli_repo' } %>
82+
<% end -%>
8083
<%= indent(2) { snippet 'puppet_setup' } %>
8184
<% end -%>
8285
phone_home:

app/views/unattended/provisioning_templates/finish/kickstart_default_finish.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ chmod +x /root/remote_execution_pull_setup.sh
8181
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
8282
<%= snippet 'puppetlabs_repo' %>
8383
<% end -%>
84+
<% if host_param_true?('enable-openvox8') || host_param_true?('enable-openvox7') -%>
85+
<%= snippet 'voxpupuli_repo' %>
86+
<% end -%>
8487
<%= snippet 'puppet_setup' %>
8588
<% end -%>
8689

app/views/unattended/provisioning_templates/finish/preseed_default_finish.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e
7575
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
7676
<%= snippet 'puppetlabs_repo' %>
7777
<% end -%>
78+
<% if host_param_true?('enable-openvox8') || host_param_true?('enable-openvox7') -%>
79+
<%= snippet 'voxpupuli_repo' %>
80+
<% end -%>
7881
<%= snippet 'puppet_setup' %>
7982
<% end -%>
8083
<% if salt_enabled -%>

app/views/unattended/provisioning_templates/host_init_config/host_init_config_default.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ apt-get -y update
5252
<%= snippet 'puppet_setup' %>
5353
<% end -%>
5454

55+
<% if !host_param_true?('skip-openvox-setup') && (host_puppet_server.present? || host_param_true?('force-openvox')) -%>
56+
<%= snippet 'voxpupuli_repo' %>
57+
<%= snippet 'puppet_setup' %>
58+
<% end -%>
59+
5560
<% if host_param_true?('host_registration_remote_execution') -%>
5661
<%= snippet 'remote_execution_ssh_keys' %>
5762
<% end -%>

app/views/unattended/provisioning_templates/provision/kickstart_default.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ chmod +x /root/remote_execution_pull_setup.sh
288288
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo')|| host_param_true?('enable-puppetlabs-puppet5-repo') -%>
289289
<%= snippet 'puppetlabs_repo' %>
290290
<% end -%>
291+
<% if host_param_true?('enable-openvox8') || host_param_true?('enable-openvox7') -%>
292+
<%= snippet 'voxpupuli_repo' %>
293+
<% end -%>
291294
<%= snippet 'puppet_setup' %>
292295
<% end -%>
293296

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<%#
2+
kind: snippet
3+
name: voxpupuli_repo
4+
model: ProvisioningTemplate
5+
snippet: true
6+
description: |
7+
Fetches the package that deploys the VoxPupuli repository that can be
8+
used to install OpenVox from. It only performs the installation in case
9+
one of the enable-openvox* parameter is set to true.
10+
It is modeled after puppetlabs_repo snippet.
11+
-%>
12+
<%
13+
http_proxy = host_param('http-proxy') ? " --httpproxy #{host_param('http-proxy')}" : nil
14+
http_port = host_param('http-proxy-port') ? " --httpport #{host_param('http-proxy-port')}" : nil
15+
proxy_uri = host_param('http-proxy') ? "http://#{host_param('http-proxy')}:#{host_param('http-proxy-port')}" : nil
16+
proxy_string = proxy_uri ? " -e https_proxy=#{proxy_uri}/" : ''
17+
proxy_string_bits = proxy_uri ? " -ProxyUsage Override -ProxyList #{proxy_uri}" : ''
18+
os_family = @host.operatingsystem.family
19+
os_major = @host.operatingsystem.major.to_i
20+
os_name = @host.operatingsystem.name
21+
22+
if os_family == 'Redhat'
23+
repo_host = 'yum.voxpupuli.org'
24+
if os_name == 'Amazon Linux'
25+
repo_os = 'amazon'
26+
elsif os_name == 'Fedora'
27+
repo_os = 'fedora'
28+
else
29+
repo_os = 'el'
30+
end
31+
elsif os_family == 'Suse'
32+
repo_host = 'yum.voxpupuli.org'
33+
repo_os = 'sles' # OpenVox repos only exist for SLES, not OpenSUSE
34+
elsif os_family == 'Debian'
35+
repo_host = 'apt.voxpupuli.org'
36+
repo_os = @host.operatingsystem.release_name
37+
end
38+
39+
if host_param_true?('enable-openvox8')
40+
repo_name = 'openvox8-release'
41+
elsif host_param_true?('enable-openvox7')
42+
repo_name = 'openvox7-release'
43+
end
44+
-%>
45+
<% if repo_name -%>
46+
<% if os_family == 'Redhat' || os_name == 'Amazon Linux' || os_name == 'SLES' -%>
47+
rpm -Uvh<%= http_proxy %><%= http_port %> https://<%= repo_host %>/<%= repo_name %>-<%= repo_os %>-<%= os_major %>.noarch.rpm
48+
<% elsif os_family == 'Debian' -%>
49+
apt-get update
50+
apt-get -y install ca-certificates
51+
wget -O /tmp/<%= repo_name %>-<%= repo_os %>.deb<%= proxy_string %> https://<%= repo_host %>/<%= repo_name %>-<%= repo_os %>.deb
52+
dpkg -i /tmp/<%= repo_name %>-<%= repo_os %>.deb
53+
<% end -%>
54+
<% end -%>

app/views/unattended/provisioning_templates/user_data/autoyast_default_user_data.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e
3434
<% if host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
3535
<%= snippet 'puppetlabs_repo' %>
3636
<% end -%>
37+
<% if host_param_true?('enable-openvox8') || host_param_true?('enable-openvox7') -%>
38+
<%= snippet 'voxpupuli_repo' %>
39+
<% end -%>
3740
<%= snippet 'puppet_setup' %>
3841
<% end -%>
3942

app/views/unattended/provisioning_templates/user_data/kickstart_default_user_data.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ fi
6666
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
6767
<%= snippet 'puppetlabs_repo' %>
6868
<% end -%>
69+
<% if host_param_true?('enable-openvox8') || host_param_true?('enable-openvox7') -%>
70+
<%= snippet 'voxpupuli_repo' %>
71+
<% end -%>
6972
<%= snippet 'puppet_setup' %>
7073
<% end -%>
7174

app/views/unattended/provisioning_templates/user_data/preseed_default_user_data.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ echo 'Acquire::http::Proxy "<%= proxy_uri %>";' >> /etc/apt/apt.conf
4747
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
4848
<%= snippet 'puppetlabs_repo' %>
4949
<% end -%>
50+
<% if host_param_true?('enable-openvox8') || host_param_true?('enable-openvox7') -%>
51+
<%= snippet 'voxpupuli_repo' %>
52+
<% end -%>
5053
<%= snippet 'puppet_setup' %>
5154
<% end -%>
5255

app/views/unattended/provisioning_templates/user_data/userdata_default.erb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ description: |
2020
- ssh_authorized_keys: string w newline seperated keys (default="")
2121
- package_upgrade: boolean (default=false)
2222
- reboot: boolean (default=false)
23-
- skip-puppet-setup: boolean (default=false)
23+
- skip-openvox-setup: boolean (default=false)
24+
- force-puppet: boolean (default=false)
2425
-%>
2526
<%
2627
ssh_pwauth = host_param('ssh_pwauth') ? host_param_true?('ssh_pwauth') : !host_param('ssh_authorized_keys')
2728
rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
2829
# safemode renderer does not support unary negation
29-
puppet_enabled = !host_param_true?('skip-puppet-setup') && (host_puppet_server.present? || host_param_true?('force-puppet'))
30+
openvox_enabled = !host_param_true?('skip-openvox-setup') && (host_puppet_server.present? || host_param_true?('force-openvox'))
31+
# Use force-puppet to keep backward compatibility
32+
puppet_enabled = host_param_true?('force-puppet')
3033
salt_enabled = host_param('salt_master') ? true : false
3134
chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
3235
-%>
@@ -72,6 +75,12 @@ runcmd:
7275
- |
7376
<%= indent(2) { snippet('chef_client') } %>
7477
<% end -%>
78+
<% if openvox_enabled -%>
79+
- |
80+
<%= indent(2) { snippet('voxpupuli_repo') } %>
81+
- |
82+
<%= indent(2) { snippet('puppet_setup') } %>
83+
<% end -%>
7584
<% if puppet_enabled -%>
7685
- |
7786
<%= indent(2) { snippet('puppetlabs_repo') } %>

0 commit comments

Comments
 (0)