Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Replace blacklist with blocklist #746

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions provisioning_templates/PXEGrub2/preseed_default_pxegrub2.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ oses:
os_name = @host.operatingsystem.name

options = []
if host_param('blacklist')
options << host_param('blacklist').split(',').collect{|x| "#{x.strip}.blacklist=yes"}.join(' ')
if host_param('blocklist_kernel_modules')
options << host_param('blocklist_kernel_modules').split(%r{,\s*}).collect{|x| "#{x.strip}.blacklist=yes"}.join(' ')
end
raise("Host param 'blacklist' has been deprecated, use 'blocklist_kernel_modules' instead") if host_param('blacklist')
if os_name == 'Debian'
options << "auto=true"
options << "domain=#{@host.domain}"
Expand Down
5 changes: 3 additions & 2 deletions provisioning_templates/PXELinux/preseed_default_pxelinux.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ oses:
#
<%
options = []
if host_param('blacklist')
options << host_param('blacklist').split(',').collect{|x| "#{x.strip}.blacklist=yes"}.join(' ')
if host_param('blocklist_kernel_modules')
options << host_param('blocklist_kernel_modules').split(%r{,\s*}).collect{|x| "#{x.strip}.blacklist=yes"}.join(' ')
end
raise("Host param 'blacklist' has been deprecated, use 'blocklist_kernel_modules' instead") if host_param('blacklist')
if @host.operatingsystem.name == 'Debian'
options << "auto=true"
options << "domain=#{@host.domain}"
Expand Down
2 changes: 1 addition & 1 deletion provisioning_templates/cloud_init/cloud_init_default.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ runcmd:
- |
<%= indent(2) { snippet 'remote_execution_ssh_keys' } %>
- |
<%= indent(2) { snippet 'blacklist_kernel_modules' } %>
<%= indent(2) { snippet 'blocklist_kernel_modules' } %>
- |
<% if chef_enabled %>
<%= indent(2) { snippet 'chef_client' } %>
Expand Down
2 changes: 1 addition & 1 deletion provisioning_templates/finish/kickstart_default_finish.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>
<%= snippet "blocklist_kernel_modules" %>

<% if chef_enabled %>
<%= snippet 'chef_client' %>
Expand Down
2 changes: 1 addition & 1 deletion provisioning_templates/finish/preseed_default_finish.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ oses:

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>
<%= snippet "blocklist_kernel_modules" %>

<% if chef_enabled %>
<%= snippet 'chef_client' %>
Expand Down
2 changes: 1 addition & 1 deletion provisioning_templates/provision/autoyast_default.erb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ cp /etc/resolv.conf /mnt/etc

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>
<%= snippet "blocklist_kernel_modules" %>

<% if puppet_enabled -%>
<%= snippet 'puppet_setup' %>
Expand Down
2 changes: 1 addition & 1 deletion provisioning_templates/provision/autoyast_sles_default.erb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ cp /etc/resolv.conf /mnt/etc

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>
<%= snippet "blocklist_kernel_modules" %>

<% if puppet_enabled -%>
<%= snippet 'puppet_setup' %>
Expand Down
2 changes: 1 addition & 1 deletion provisioning_templates/provision/kickstart_default.erb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ fi

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>
<%= snippet "blocklist_kernel_modules" %>

<% if chef_enabled %>
<%= snippet 'chef_client' %>
Expand Down
8 changes: 2 additions & 6 deletions provisioning_templates/snippet/blacklist_kernel_modules.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ kind: snippet
name: blacklist_kernel_modules
model: ProvisioningTemplate
snippet: true
%>
<% if host_param('blacklist_kernel_modules') -%>
<% host_param('blacklist_kernel_modules').split.each do |mod| -%>
echo "blacklist <%= mod %>" >> /etc/modprobe.d/blacklist.conf
<% end -%>
<% end -%>
-%>
<% raise("Snippet 'blacklist_kernel_modules' was renamed to 'blocklist_kernel_modules', update your template.") %>
11 changes: 11 additions & 0 deletions provisioning_templates/snippet/blocklist_kernel_modules.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<%#
kind: snippet
name: blocklist_kernel_modules
model: ProvisioningTemplate
snippet: true
%>
<% if host_param('blocklist_kernel_modules') -%>
<% host_param('blocklist_kernel_modules').split.each do |mod| -%>
echo "blacklist <%= mod %>" >> /etc/modprobe.d/blocklist.conf
<% end -%>
<% end -%>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>
<%= snippet "blocklist_kernel_modules" %>

<% if puppet_enabled %>
<% if host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fi

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>
<%= snippet "blocklist_kernel_modules" %>

<% if chef_enabled %>
<%= snippet 'chef_client' %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ echo 'Acquire::http::Proxy "<%= proxy_uri %>";' >> /etc/apt/apt.conf

<%= snippet('remote_execution_ssh_keys') %>

<%= snippet "blacklist_kernel_modules" %>
<%= snippet "blocklist_kernel_modules" %>

<% if chef_enabled %>
<%= snippet 'chef_client' %>
Expand Down