<%= provisioner_wizard 3 %>

<%= _("All of the necessary network information has been collected, now run the Foreman installer again with the necessary arguments to configure provisioning.") %>

<%= _("Install provisioning with DHCP") %>

<% if defined? Katello %>
  <% command = 'katello-installer' %>
  <% parameter = '--capsule' %>
<% else %>
  <% command = 'foreman-installer' %>
  <% parameter = '--foreman-proxy' %>
<% end%>
<%= command %> \
  --enable-<%= parameter[2..-1] %> \
  <%= parameter %>-tftp=true \
  <%= parameter %>-tftp-servername=<%= provisioner.provision_interface_data[:ip] %> \
  <%= parameter %>-dhcp=true \
  <%= parameter %>-dhcp-interface=<%= provisioner.provision_interface %> \
  <%= parameter %>-dhcp-gateway=<%= provisioner.subnet.gateway %> \
  <%= parameter %>-dhcp-range="<%= provisioner.subnet.from %> <%= provisioner.subnet.to %>" \
  <%= parameter %>-dhcp-nameservers="<%= provisioner.subnet.dns_primary %><%= ("," + provisioner.subnet.dns_secondary) unless provisioner.subnet.dns_secondary.blank? %>" \
  <%= parameter %>-dns=true \
  <%= parameter %>-dns-interface=<%= provisioner.provision_interface %> \
  <%= parameter %>-dns-zone=<%= provisioner.domain.name %> \
  <%= parameter %>-dns-reverse=<%= provisioner.rdns_zone %> \
<%= provisioner.dns_forwarders.map { |f| "  #{parameter}-dns-forwarders=#{f} \\" }.join("\n") %>
<% if defined? Katello %>
  <%= parameter %>-parent-fqdn=<%= Setting[:foreman_url] %> \
  <%= parameter %>-foreman-oauth-key=<%= Setting[:oauth_consumer_key] %> \
  <%= parameter %>-foreman-oauth-secret=<%= Setting[:oauth_consumer_secret] %>
<% else %>
  <%= parameter %>-foreman-base-url=<%= Setting[:foreman_url] %> \
  <%= parameter %>-oauth-consumer-key=<%= Setting[:oauth_consumer_key] %> \
  <%= parameter %>-oauth-consumer-secret=<%= Setting[:oauth_consumer_secret] %>
<% end %>

<%= _("Install provisioning without DHCP") %>

<%= command %> \
  --enable-<%= parameter[2..-1] %> \
  <%= parameter %>-tftp=true \
  <%= parameter %>-tftp-servername=<%= provisioner.provision_interface_data[:ip] %> \
  <%= parameter %>-dns=true \
  <%= parameter %>-dns-interface=<%= provisioner.provision_interface %> \
  <%= parameter %>-dns-zone=<%= provisioner.domain.name %> \
  <%= parameter %>-dns-reverse=<%= provisioner.rdns_zone %> \
<%= provisioner.dns_forwarders.map { |f| "  #{parameter}-dns-forwarders=#{f} \\" }.join("\n") %>
<% if defined? Katello %>
  <%= parameter %>-parent-fqdn=<%= Setting[:foreman_url] %> \
  <%= parameter %>-foreman-oauth-key=<%= Setting[:oauth_consumer_key] %> \
  <%= parameter %>-foreman-oauth-secret=<%= Setting[:oauth_consumer_secret] %>
<% else %>
  <%= parameter %>-foreman-base-url=<%= Setting[:foreman_url] %> \
  <%= parameter %>-oauth-consumer-key=<%= Setting[:oauth_consumer_key] %> \
  <%= parameter %>-oauth-consumer-secret=<%= Setting[:oauth_consumer_secret] %>
<% end %>
<%= content_tag(:div, :class => "form-actions") do content_tag(:div) do link_to(_("Next"), step4_foreman_setup_provisioner_path, :class => "btn btn-primary", :method => :post) end end %>