# debian repository
d-i     mirror/http/hostname    string ftp.de.debian.org
d-i     mirror/http/directory   string /debian/
d-i     mirror/suite            string jessie

# saltstack repository
d-i     apt-setup/local0/repository string http://debian.saltstack.com/debian jessie-saltstack main
d-i     apt-setup/local0/comment string saltstack
d-i     apt-setup/local0/key string http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key

# contribute
popularity-contest popularity-contest/participate boolean false

# aptitude
d-i     apt-setup/uri_type      select d-i
d-i     apt-setup/hostname      string ftp.de.debian.org
d-i     apt-setup/directory     string /debian/
d-i     apt-setup/another       boolean false
d-i     apt-setup/security-updates      boolean true
d-i     finish-install/reboot_in_progress note
d-i     prebaseconfig/reboot_in_progress        note
d-i     apt-setup/non-free      boolean true
d-i     apt-setup/contrib       boolean true

# network setup
d-i     netcfg/get_hostname string unassigned-hostname
d-i     netcfg/get_hostname seen true
d-i     netcfg/get_domain string unassigned-domain
d-i     netcfg/get_domain seen true
#d-i     netcfg/get_hostname     string  deploy-depot
#d-i     netcfg/get_domain       string  localdomain
d-i     netcfg/disable_dhcp     boolean false
d-i     mirror/http/proxy       string
d-i     netcfg/choose_interface select eth0
d-i     netcfg/wireless_wep     string

# partition
#d-i     partman-auto/disk string /dev/sda
#d-i     partman-auto/method string regular
d-i     partman-auto/method string lvm
#d-i     partman-auto/method string crypto

d-i     partman/confirm boolean true
d-i     partman-partitioning/confirm_write_new_label boolean true
d-i     partman/choose_partition select finish
d-i     partman/confirm_nooverwrite boolean true
d-i     partman-lvm/confirm_nooverwrite boolean true
d-i     partman-lvm/device_remove_lvm boolean true
d-i     partman-lvm/confirm boolean true

# partition scheme
#d-i partman-auto/choose_recipe select atomic
#d-i partman-auto/choose_recipe select home
#d-i partman-auto/choose_recipe select multi

# partition detail - maybe relevant on some systems
#d-i partman/alignment select cylinder

#
d-i partman-auto/expert_recipe string       \
  boot-root ::                              \
  1 1 1 free                                \
    $lvmignore{ }                           \
    method{ biosgrub }                      \
  .                                         \
  256 1000 256 ext3                         \
    $primary{ } $bootable{ }                \
    method{ format } format{ }              \
    use_filesystem{ } filesystem{ ext3 }    \
    mountpoint{ /boot }                     \
    options/relatime{ relatime }            \
    options/nodev{ nodev }                  \
    options/noexec{ noexec }                \
    options/nosuid{ nosuid }                \
  .                                         \
  1024 10000 1000000000 ext3                \
    $primary{ }                             \
    method{ lvm }                           \
    vg_name{ vg_system }                    \
  .                                         \
#  1024 10000 1536 xfs                       \
  1024 2000 -1 xfs                          \
    $lvmok{ }                               \
    in_vg{ vg_system }                      \
    lv_name{ root }                         \
    method{ format } format{ }              \
    use_filesystem{ } filesystem{ xfs }     \
    mountpoint{ / }                         \
    options/relatime{ relatime }            \
  .                                         \
  100% 2000 250% linux-swap                 \
    $lvmok{ }                               \
    in_vg{ vg_system }                      \
    lv_name{ swap }                         \
    method{ swap } format{ }                \
#  .                                         \
#  2048 3072 3072 xfs                        \
#    $lvmok{ }                               \
#    in_vg{ vg_system }                      \
#    lv_name{ usr }                          \
#    method{ format } format{ }              \
#    use_filesystem{ } filesystem{ xfs }     \
#    mountpoint{ /usr }                      \
#    options/relatime{ relatime }            \
#    options/nodev{ nodev }                  \
#  .                                         \
#  3072 4096 4096 xfs                        \
#    $lvmok{ }                               \
#    in_vg{ vg_system }                      \
#    lv_name{ var }                          \
#    method{ format } format{ }              \
#    use_filesystem{ } filesystem{ xfs }     \
#    mountpoint{ /var }                      \
#    options/relatime{ relatime }            \
#    options/nodev{ nodev }                  \
#  .                                         \
#  3072 4096 4096 xfs                        \
#    $lvmok{ }                               \
#    in_vg{ vg_system }                      \
#    lv_name{ log }                          \
#    method{ format } format{ }              \
#    use_filesystem{ } filesystem{ xfs }     \
#    mountpoint{ /var/log }                  \
#    options/relatime{ relatime }            \
#    options/nodev{ nodev }                  \
#    options/noexec{ noexec }                \
#    options/nosuid{ nosuid }                \
#  .                                         \
#  1024 1000 -1 xfs                          \
#    $lvmok{ }                               \
#    in_vg{ vg_system }                      \
#    lv_name{ srv }                          \
#    method{ format } format{ }              \
#    use_filesystem{ } filesystem{ xfs }     \
#    mountpoint{ /srv }                      \
#    options/relatime{ relatime }            \
#    options/nodev{ nodev }                  \
#    options/noexec{ noexec }                \
#    options/nosuid{ nosuid }                \
  .

# bootloader
d-i     grub-installer/with_other_os    boolean true

# language
d-i     debian-installer/locale string de_DE
d-i     debian-installer/keymap select de-latin1
d-i     debian-installer/keymap string  de-latin1
d-i     languagechooser/language-name-fb    select German
d-i     countrychooser/country-name select Germany
d-i     console-setup/layoutcode string de_DE
d-i     debian-installer/locale             select de_DE.UTF-8

d-i     keyboard-configuration/layoutcode string de
d-i     console-tools/archs select at
d-i     keyboard-configuration/xkb-keymap select de
d-i     console-keymaps-at/keymap select de
d-i     console-data/keymap/policy      select  Don't touch keymap

# timezone
d-i     tzconfig/gmt            boolean false
d-i     tzconfig/choose_country_zone/Europe select Berlin
d-i     tzconfig/choose_country_zone_single boolean true
d-i     time/zone       select  Europe/Berlin
d-i     clock-setup/utc boolean true
d-i     mirror/country  string  manual
d-i     clock-setup/ntp boolean false

# root account
d-i     passwd/root-password-crypted    passwd    $1$lUHic/09$paz72yc6vfVroMhUI4wpA.

# user account
d-i passwd/make-user boolean false
#d-i    passwd/user-fullname            string user name
#d-i    passwd/username                 string username
#d-i    passwd/user-password-crypted    passwd $1$rP5u17lv$i/PMu.o7KXyCUwT1tAp2M.

# tasks and packages
tasksel tasksel/first   multiselect     standard
# wget, apache2, php, mysql => lamp stack
#d-i      pkgsel/include  string   ssh lvm2 mdadm vim mc debconf-utils rcconf screen console-setup console-data console-common gnu-fdisk wget apache2 mysql-server php5 php5-gd php5-mysql php5-curl php5-xmlrpc php5-intl dos2unix postgresql postgresql-contrib phppgadmin open-vm-tools curl unzip rpl parted bzip2 libssh2-1-dev libssh2-php txt2tags python python-pygraphviz python-pygresql git ntp libmysqlclient15-dev sudo salt-minion
#d-i      pkgsel/include  string   ssh lvm2 vim mc debconf-utils rcconf screen console-setup console-data console-common gnu-fdisk wget dos2unix open-vm-tools curl unzip rpl parted bzip2 txt2tags python git ntp sudo salt-minion aptitude xfsprogs
d-i      pkgsel/include  string   aptitude bzip2 console-common console-data console-setup curl debconf-utils dos2unix git lvm2 mc ntp open-vm-tools-dkms parted python rcconf rpl salt-minion screen ssh sudo txt2tags unzip util-linux vim wget xfsprogs
# no exim configuration
exim4-config exim4/no_config boolean true

# softwareraid setup
mdadm   mdadm/autostart boolean false
mdadm   mdadm/mail_to   string  root
mdadm   mdadm/initrdstart       string  none
mdadm   mdadm/initrdstart_notinconf     boolean false
mdadm   mdadm/autocheck boolean true
mdadm   mdadm/start_daemon      boolean true

# mysql
d-i mysql-server/root_password select root
d-i mysql-server/root_password_again select root

# bootloader
d-i grub-installer/only_debian boolean true

# To install grub to first disk:
#d-i grub-installer/bootdev  string (hd0,0)

# To install grub to multiple disks:
#d-i grub-installer/bootdev  string (hd0,0) (hd1,0) (hd2,0)

# To install to a particular device:
#d-i grub-installer/bootdev  string /dev/sda

# since jessie this is needed to prevent the question about the boot device
d-i grub-installer/bootdev  string default


# still in development
# after setup, run shell-script, may not work
#d-i preseed/late_command string in-target wget http://download.bmsoft.de/pub/deploy.pub; in-target mkdir /root/.ssh; in-target cp ./deploy.pub /root/.ssh/authorized_keys; echo "@reboot root curl -L http://bootstrap.saltstack.org | sudo sh -s -- -A salt.bmsoft.de" >> /target/etc/crontab;
#d-i preseed/late_command string in-target wget http://download.bmsoft.de/pub/deploy.pub; in-target mkdir /root/.ssh; in-target cp ./deploy.pub /root/.ssh/authorized_keys; echo "master: salt.bmsoft.de" > /target/etc/salt/minion.d/99-master-address.conf;
#d-i preseed/late_command string chroot /target /bin/bash -c 'wget -O - http://download.bmsoft.de/d-i/jessie/post-install.sh | /bin/sh -'
d-i preseed/late_command string cat /proc/cmdline > /target/root/.install-info; chroot /target /bin/bash -c 'wget -O - http://download.bmsoft.de/d-i/jessie/post-install.sh | /bin/sh -'

# shutdown after finishing
#d-i debian-installer/exit/poweroff boolean true
d-i finish-install/reboot_in_progress note
