<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
  <general>
    <mode>
      <confirm config:type="boolean">false</confirm>
    </mode>
  </general>
  <networking>
    <!-- okurz: 2023-06-13: For multiple network interfaces by default the last is configured, prefer the first -->
    <interfaces config:type="list">
      <interface>
        <bootproto>dhcp</bootproto>
        <name>eth0</name>
        <startmode>auto</startmode>
      </interface>
    </interfaces>
    <keep_install_network config:type="boolean">true</keep_install_network>
    <routing t="map">
      <ipv4_forward t="boolean">true</ipv4_forward>
      <ipv6_forward t="boolean">true</ipv6_forward>
    </routing>
  </networking>
  <% if os_release[:id] == 'opensuse-leap' %>
  <add-on>
    <add_on_others config:type="list">
      <listentry>
        <media_url>https://download.opensuse.org/distribution/leap/<%= os_release[:version] %>/repo/oss</media_url>
        <alias>repo-oss</alias>
        <name>repo-oss</name>
      </listentry>
      <listentry>
        <media_url>https://download.opensuse.org/distribution/leap/<%= os_release[:version] %>/repo/non-oss</media_url>
        <alias>repo-non-oss</alias>
        <name>repo-non-oss</name>
      </listentry>
      <listentry>
        <media_url>https://download.opensuse.org/update/leap/<%= os_release[:version] %>/oss</media_url>
        <alias>repo-update-oss</alias>
        <name>repo-update-oss</name>
      </listentry>
      <listentry>
        <media_url>https://download.opensuse.org/update/leap/<%= os_release[:version] %>/non-oss</media_url>
        <alias>repo-update-non-oss</alias>
        <name>repo-update-non-oss</name>
      </listentry>
    </add_on_others>
  </add-on>
  <% end %>
  <software>
    <% if os_release[:id] == 'opensuse-leap' %>
    <products config:type="list">
      <product>Leap</product>
    </products>
    <% end %>
    <patterns config:type="list">
      <pattern>kvm_server</pattern>
    </patterns>
    <packages config:type="list">
      <package>openssh</package>
      <package>sudo</package>
      <package>salt-minion</package>
      <package>chrony</package>
    </packages>
  </software>
  <timezone t="map">
    <hwclock>UTC</hwclock>
    <timezone>Etc/UTC</timezone>
  </timezone>
  <partitioning config:type="list">
    <drive>
      <initialize config:type="boolean">true</initialize>
      <partitions config:type="list">
        <partition>
          <mount>/</mount>
          <size>max</size>
          <filesystem config:type="symbol">btrfs</filesystem>
        </partition>
        <partition>
          <mount>swap</mount>
          <size>auto</size>
        </partition>
      </partitions>
    </drive>
  </partitioning>
  <scripts>
    <post-scripts config:type="list">
      <script>
        <filename>setup.sh</filename>
        <interpreter>shell</interpreter>
        <debug config:type="boolean">true</debug>
        <source><![CDATA[
            echo 'roles: worker' > /etc/salt/grains
        ]]></source>
      </script>
    </post-scripts>
  </scripts>
  <firewall>
    <enable_firewall config:type="boolean">true</enable_firewall>
    <start_firewall config:type="boolean">true</start_firewall>
    <default_zone>public</default_zone>
    <zones config:type="list">
      <zone>
	<name>public</name>
	<services config:type="list">
          <service>ssh</service>
	</services>
      </zone>
    </zones>
  </firewall>
  <services-manager t="map">
    <services>
      <enable config:type="list">
        <service>sshd</service>
        <service>chronyd</service>
      </enable>
    </services>
  </services-manager>
</profile>
