foreman/app/views/unattended/provisioning_templates/finish/kickstart_default_finish.erb @ ca34010f
e8e6a960 | Dominic Cleal | <%#
|
|
kind: finish
|
|||
name: Kickstart default finish
|
|||
f9889300 | Ondrej Prazak | model: ProvisioningTemplate
|
|
e8e6a960 | Dominic Cleal | oses:
|
|
3b9411cb | Bernhard Suttner | - AlmaLinux
|
|
7b966530 | Dominic Cleal | - CentOS
|
|
7364916b | Lukas Zapletal | - CentOS_Stream
|
|
7b966530 | Dominic Cleal | - Fedora
|
|
ce819044 | Bernhard Suttner | - Rocky
|
|
9f802d90 | Marek Hulan | description: |
|
|
A finish template executed at the end of the image based provisioning
|
|||
using the image without user data. Foreman connects to the VM over SSH
|
|||
and runs the script rendered from this template. It is meant to be run
|
|||
on RPM based distributons.
|
|||
3d038824 | Stephen Benjamin | This template accepts the following parameters:
|
|
- bootloader-append: string (default="nofb quiet splash=quiet")
|
|||
- force-puppet: boolean (default=false)
|
|||
4b9d12df | Daniel Henninger | - skip-puppet-setup: boolean (default=false)
|
|
f7e8785b | Tomer Brisker | - use-ntp: boolean (default depends on OS release)
|
|
- ntp-server: string (default=undef)
|
|||
3d038824 | Stephen Benjamin | - package_upgrade: boolean (default=true)
|
|
- salt_master: string (default=undef)
|
|||
713a1878 | Adam Růžička | - enable-remote-execution-pull: boolean (default=false)
|
|
9f802d90 | Marek Hulan | -%>
|
|
e8e6a960 | Dominic Cleal | <%
|
|
rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
|
|||
8a46df0d | Bernhard Suttner | os_major = @host.operatingsystem.major.to_i
|
|
4b9d12df | Daniel Henninger | puppet_enabled = !host_param_true?('skip-puppet-setup') && (host_puppet_server.present? || host_param_true?('force-puppet'))
|
|
857a5d14 | Daniel Lobato Garcia | salt_enabled = host_param('salt_master') ? true : false
|
|
7b966530 | Dominic Cleal | chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
|
|
e8e6a960 | Dominic Cleal | %>
|
|
8a46df0d | Bernhard Suttner | <%= snippet_if_exists(template_name + " custom pre") -%>
|
|
567cb9f1 | Marek Hulán | <% if @host.provision_method == 'image' && root_pass.present? -%>
|
|
c47be8a8 | Tommy McNeely | # Install the root password
|
|
echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e
|
|||
<% end -%>
|
|||
f7e8785b | Tomer Brisker | <%= snippet 'yum_proxy' %>
|
|
e8e6a960 | Dominic Cleal | ||
f7e8785b | Tomer Brisker | <%= snippet 'ntp' %>
|
|
e8e6a960 | Dominic Cleal | ||
45c7dd75 | Evgeni Golov | <% if rhel_compatible && host_param_true?('enable-epel') -%>
|
|
567cb9f1 | Marek Hulán | <%= snippet 'epel' -%>
|
|
<% end -%>
|
|||
3bd6f09c | Stephen Benjamin | <%= snippet 'redhat_register' %>
|
|
76731030 | Tomer Brisker | <% if host_enc['parameters']['realm'] && @host.realm && (@host.realm.realm_type == 'FreeIPA' || @host.realm.realm_type == 'Red Hat Identity Management') -%>
|
|
c0fe869d | Dominic Cleal | <%= snippet 'freeipa_register' %>
|
|
e8e6a960 | Dominic Cleal | <% end -%>
|
|
857a5d14 | Daniel Lobato Garcia | <% unless host_param_false?('package_upgrade') -%>
|
|
e8e6a960 | Dominic Cleal | # update all the base packages from the updates repository
|
|
5728bb3f | Dominic Cleal | if [ -f /usr/bin/dnf ]; then
|
|
dnf -y update
|
|||
else
|
|||
yum -t -y update
|
|||
fi
|
|||
3d038824 | Stephen Benjamin | <% end -%>
|
|
e8e6a960 | Dominic Cleal | ||
7b966530 | Dominic Cleal | <%= snippet('remote_execution_ssh_keys') %>
|
|
e8e6a960 | Dominic Cleal | ||
713a1878 | Adam Růžička | <% if plugin_present?('katello') && host_param_true?('enable-remote-execution-pull') -%>
|
|
30c41d67 | Adam Růžička | <%= save_to_file('/root/remote_execution_pull_setup.sh', snippet('remote_execution_pull_setup'), verbatim: true) %>
|
|
713a1878 | Adam Růžička | chmod +x /root/remote_execution_pull_setup.sh
|
|
/root/remote_execution_pull_setup.sh
|
|||
<% end -%>
|
|||
91de0279 | Marek Hulan | <%= snippet "blacklist_kernel_modules" %>
|
|
dc4fbcae | Pablo N. Hess | <%= snippet_if_exists(template_name + " custom post") -%>
|
|
7b966530 | Dominic Cleal | <% if chef_enabled %>
|
|
<%= snippet 'chef_client' %>
|
|||
9736dac8 | Dominic Cleal | <% end -%>
|
|
e8e6a960 | Dominic Cleal | ||
7b966530 | Dominic Cleal | <% if puppet_enabled %>
|
|
c35092bd | Trent Anderson | <% 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') -%>
|
|
5728bb3f | Dominic Cleal | <%= snippet 'puppetlabs_repo' %>
|
|
567cb9f1 | Marek Hulán | <% end -%>
|
|
7b966530 | Dominic Cleal | <%= snippet 'puppet_setup' %>
|
|
e8e6a960 | Dominic Cleal | <% end -%>
|
|
7b966530 | Dominic Cleal | <% if salt_enabled %>
|
|
<%= snippet 'saltstack_setup' %>
|
|||
<% end -%>
|
|||
857a5d14 | Daniel Lobato Garcia | <% if host_param_true?('ansible_tower_provisioning') -%>
|
|
<%= save_to_file('/root/ansible_provisioning_call.sh', snippet('ansible_tower_callback_script')) %>
|
|||
d334af4e | Ondřej Ezr | chmod +x /root/ansible_provisioning_call.sh
|
|
daec9eb7 | Ondrej Prazak | /root/ansible_provisioning_call.sh
|
|
857a5d14 | Daniel Lobato Garcia | <% end -%>
|
|
7b966530 | Dominic Cleal | sync
|
|
0936290f | Lukas Zapletal | <%= snippet 'schedule_reboot' -%>
|
|
e8e6a960 | Dominic Cleal | exit 0
|