|
<%#
|
|
kind: provision
|
|
name: XenServer default answerfile
|
|
oses:
|
|
- XenServer
|
|
-%>
|
|
<%
|
|
subnet = @host.subnet
|
|
dhcp = subnet.dhcp_boot_mode?
|
|
interface_name = @host.primary_interface.identifier.blank? ? 'eth0' : @host.primary_interface.identifier
|
|
-%>
|
|
<?xml version="1.0"?>
|
|
<installation mode="fresh" srtype="lvm">
|
|
<%= @host.diskLayout -%>
|
|
<keymap><%= @host.params['keyboard'] || 'us' %></keymap>
|
|
<hostname><%= @host.shortname %></hostname>
|
|
<root-password type="hash"><%= root_pass %></root-password>
|
|
<source type="url"><%= @mediapath %></source>
|
|
<admin-interface name="<%= interface_name %>" proto="<%= dhcp ? 'dhcp' : 'static' %>">
|
|
<% unless dhcp -%>
|
|
<ip><%= @host.ip %></ip>
|
|
<subnet-mask><%= subnet.mask %></subnet-mask>
|
|
<% if subnet.gateway.present? -%>
|
|
<gateway><%= subnet.gateway %></gateway>
|
|
<% end -%>
|
|
<% end -%>
|
|
</admin-interface>
|
|
<% if subnet.dns_primary.present? -%>
|
|
<name-server><%= subnet.dns_primary %></name-server>
|
|
<% end -%>
|
|
<% if subnet.dns_secondary.present? -%>
|
|
<name-server><%= subnet.dns_secondary %></name-server>
|
|
<% end -%>
|
|
<ntp-server><%= @host.params['ntp-server'] || 'pool.ntp.org' %></ntp-server>
|
|
<timezone><%= @host.params['time-zone'] || 'UTC' %></timezone>
|
|
<time-config-method>ntp</time-config-method>
|
|
<script stage="installation-complete" type="url">
|
|
<%= foreman_url('finish') %>
|
|
</script>
|
|
</installation>
|