Dear experts,
What is the best way to easily add some entries into the /etc/hosts for new provisioning machines?
do it through kickstart template or there is a way that we can add those through Foreman UI host parameters?
Thanks.
Dear experts,
What is the best way to easily add some entries into the /etc/hosts for new provisioning machines?
do it through kickstart template or there is a way that we can add those through Foreman UI host parameters?
Thanks.
Looks like they have a snippet for this, although, I have not tested it myself.
<%#
kind: snippet
name: fix_hosts
model: ProvisioningTemplate
snippet: true
%>
echo "<%= @host.shortname %>" > /etc/hostname
<% if @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.major.to_i == 6 %>
hostname <%= @host %>
<% else %>
hostname <%= @host.shortname %>
<% end %>
cat > /etc/hosts << EOF
<%# simple snippet to generate /etc/hosts when provisioning image based systems -%>
127.0.0.1 <%= @host %> <%= @host.shortname %> localhost localhost.localdomain
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF