Skip to content

Instantly share code, notes, and snippets.

@hermanbanken
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hermanbanken/10448563 to your computer and use it in GitHub Desktop.
Save hermanbanken/10448563 to your computer and use it in GitHub Desktop.
Preeseed CH
# Using preeseeding https://help.ubuntu.com/lts/installation-guide/i386/preseed-using.html
# Inspired by http://www.briancarpio.com/2012/04/04/system-automation-part-1/
# and https://help.ubuntu.com/12.04/installation-guide/example-preseed.txt
# Change PXE default:
# label Ubuntu 10.04 (Ubuntu 10.04)
# menu label Ubuntu 10.04 (Ubuntu 10.04)
# kernel pxe/images/ubuntu/ubuntu-10.4-x86_64
# append initrd=pxe/images/ubuntu/ubuntu-10.4-x86_64.img \
# ksdevice=eth0 DEBCONF_DEBUG=5 locale=en_US.UTF-8 \
# console-setup/layoutcode=us \
# domain=example.com hostname=hostname\
# url=http://192.168.10.133/preseed/
d-i debian-installer/locale string en_US
d-i localechooser/translation/warn-light boolean true
d-i localechooser/translation/warn-severe boolean true
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
# Alternatively: by default, the installer uses CC.archive.ubuntu.com where
# CC is the ISO-3166-2 code for the selected country. You can preseed this
# so that it does so without asking.
d-i mirror/http/mirror select NL.archive.ubuntu.com
### Clock and time zone setup
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Amsterdam
d-i clock-setup/ntp boolean true
### Partitioning
d-i clock-setup/ntp boolean true
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto/choose_recipe select atomic
# Confirm
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
### System setup
d-i passwd/make-user boolean true
d-i passwd/user-fullname string Administrator
d-i passwd/username string administrator
d-i passwd/root-password password r00tme
d-i passwd/root-password-again password r00tme
#d-i passwd/root-password-crypted password [MD5 hash here]
d-i user-setup/allow-password-weak boolean true
### Package selection
tasksel tasksel/first multiselect ubuntu-desktop
d-i pkgsel/include string openssh-server libnss-ldapd libpam-ldapd ldap-utils
### Bootloaders
d-i grub-installer/only_debian boolean true
### Finishing up the installation
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
# Monitor autodetection is recommended.
xserver-xorg xserver-xorg/autodetect_monitor boolean true
xserver-xorg xserver-xorg/config/monitor/selection-method select medium
xserver-xorg xserver-xorg/config/monitor/mode-list select 1024x768 @ 60 Hz
xserver-xorg xserver-xorg/config/display/modes multiselect 1280x1024, 1152x864, 1024x768, 832x624, 800x600, 720x400, 640x480
### LDAP
ldap-auth-config ldap-auth-config/dbrootlogin boolean false
ldap-auth-config ldap-auth-config/pam_password select crypt
ldap-auth-config ldap-auth-config/move-to-debconf boolean false
ldap-auth-config ldap-auth-config/ldapns/ldap-server string ldap
ldap-auth-config ldap-auth-config/ldapns/base-dn string dc=ank,dc=chnet
ldap-auth-config ldap-auth-config/ldapns/ldap-server string ldaps://frans.chnet ldaps://ank.chnet
ldap-auth-config ldap-auth-config/ldapns/ldap_version select 3
ldap-auth-config ldap-auth-config/dblogin boolean false
ldap-auth-config ldap-auth-config/override boolean true
libpam-runtime libpam-runtime/profiles multiselect unix, ldap
# Post install
#: apt-get install libnss-ldap libpam-ldap libpam-mount winbind smbclient cifs-utils ldap-utils
#: wget pem-file -O /etc/ssl/certs/wisvch.pem
#: cat > /etc/ldap.conf << "EOF"
#: # LDAP Defaults
#: # This file should be world readable but not world writable.
#: BASE dc=ank, dc=chnet
#: URI ldaps://frans.chnet ldaps://ank.chnet/
#:
#: TIMEOUT 3
#: NETWORK_TIMEOUT 3
#:
#: TLS_CACERT /etc/ssl/certs/wisvch.pem
#: TLS_REQCERT allow
#: SSL START_TLS
#:
#: nss_base_passwd ou=People,dc=ank,dc=chnet?one
#: nss_base_passwd ou=Computers,dc=ank,dc=chnet?one
#: nss_base_shadow ou=People,dc=ank,dc=chnet?one
#: nss_base_group ou=Group,dc=ank,dc=chnet?one
#: nss_schema rfc2307bis
#: nss_map_attribute uniqueMember member
#:
#: EOF
#: ln -s /etc/ldap.conf /etc/ldap/ldap.conf
#:
#: cat > /etc/nsswitch.conf << "EOF"
#: passwd: compat ldap
#: group: compat ldap
#: shadow: compat ldap
#: hosts: files dns
#: networks: files
#: protocols: db files
#: services: db files
#: ethers: db files
#: rpc: db files
#: netgroup: ldap
#: EOF#:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment