prepd 0.1.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +5 -5
  2. data/bin/console +2 -0
  3. data/files/cluster/Vagrantfile +118 -0
  4. data/files/cluster/vagrant.yml +52 -0
  5. data/files/developer/cluster/provision.yml +2 -0
  6. data/files/machine/build.json +52 -0
  7. data/files/machine/debian/stretch/iso.json +101 -0
  8. data/files/machine/debian/stretch/preseed.cfg +404 -0
  9. data/files/machine/json.rb +26 -0
  10. data/files/machine/push.json +56 -0
  11. data/files/machine/rebuild.json +60 -0
  12. data/files/project/provision.yml +20 -0
  13. data/files/project/vars.yml +5 -0
  14. data/files/setup.yml +16 -0
  15. data/files/setup/README.md +21 -0
  16. data/files/setup/ansible.cfg +4 -0
  17. data/files/setup/hosts +1 -0
  18. data/files/setup/setup.yml +19 -0
  19. data/files/setup/vars.yml +20 -0
  20. data/files/workspace/.gitignore +12 -0
  21. data/files/workspace/README.md +11 -0
  22. data/files/workspace/clusters/prepd.yml +17 -0
  23. data/files/workspace/clusters/provision.yml +73 -0
  24. data/files/workspace/clusters/vagrant.rb +106 -0
  25. data/files/workspace/clusters/vagrant.yml +18 -0
  26. data/files/workspace/data/.keep +0 -0
  27. data/files/workspace/developer/ansible.cfg +4 -0
  28. data/files/workspace/developer/credentials/.keep +0 -0
  29. data/files/workspace/developer/hosts +7 -0
  30. data/files/workspace/developer/machines/provision.yml +9 -0
  31. data/files/workspace/developer/provision.yml +15 -0
  32. data/files/workspace/machines/build.yml +34 -0
  33. data/files/workspace/machines/provision.yml +36 -0
  34. data/lib/prepd.rb +95 -34
  35. data/lib/prepd/cli.rb +27 -4
  36. data/lib/prepd/cli/commands.rb +64 -25
  37. data/lib/prepd/cli/options_parser.rb +42 -16
  38. data/lib/prepd/models.rb +7 -261
  39. data/lib/prepd/models/base.rb +124 -0
  40. data/lib/prepd/models/cluster.rb +255 -0
  41. data/lib/prepd/models/data.rb +5 -0
  42. data/lib/prepd/models/developer.rb +129 -0
  43. data/lib/prepd/models/machine.rb +146 -0
  44. data/lib/prepd/models/project.rb +94 -0
  45. data/lib/prepd/models/setup.rb +48 -0
  46. data/lib/prepd/models/workspace.rb +51 -0
  47. data/lib/prepd/version.rb +1 -1
  48. data/prepd.gemspec +4 -6
  49. metadata +47 -37
  50. data/TODO.md +0 -17
  51. data/lib/prepd/schema.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7da5fcedfd696ae8ed02c72983c3580aa81ebdb2
4
- data.tar.gz: 5ff634d081c083161b62fef9b55506d7ffe0c0d8
2
+ SHA256:
3
+ metadata.gz: 1b5bcc3a8c377d20bc61eedbb9690952615ccca2b582994d9475368e6c0dbebb
4
+ data.tar.gz: 991a75ff4ff62147cc79e06c8224d8996b91dc68b4d5756f9e785de42119dd2d
5
5
  SHA512:
6
- metadata.gz: eed08a0948cc105d1c88bc4ef489e35fd0dce5f5429c731c3f708689cc18ea14aee2f9413fdc85fce2c5fa926c93eb4b50203f80a221dc01c9ac4a15984fe770
7
- data.tar.gz: 5d687fbcbc00fcb87c2d0c1f25e619ac0532f640220daea216be2f7fcb7d6243010a42328fe90e2249cb579130427c762325aedcd1103eb57851b565b22c6d62
6
+ metadata.gz: 2d00aa6ea7fb7caf352536835053af7c94a73f875fc97506c6bf7416c8b6d19327416eb63a9dbc9b2dcb04d24720843e1189dead8588ae2a35f84c2012815fa9
7
+ data.tar.gz: 55830e53ce78e572bbcfb188d0b7b3f85114837ae0eaf80aaa24f1442be37d8a0d7e81d06802e0a9cd07a1c089617495fbc1522065f5ead85b4098aaa768baa8
data/bin/console CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'bundler/setup'
4
+ require 'prepd'
5
+ require 'prepd/models'
4
6
  require 'prepd/cli'
@@ -0,0 +1,118 @@
1
+ PREPD_VAGRANT = true
2
+ require_relative '../vagrant.rb'
3
+ prepd_config = Prepd::Vagrant::Config.new
4
+
5
+ # Run custom code depending on values of the vagrant action and host
6
+ operation, host = ARGV
7
+ if %w(up).include?(operation); end
8
+
9
+ Vagrant.configure(2) do |config|
10
+ # Add user's ssh key to vagrant vm
11
+ config.vm.provision :shell do |shell|
12
+ ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
13
+ shell.inline = <<-SHELL
14
+ echo '' >> /home/vagrant/.ssh/authorized_keys
15
+ echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
16
+ SHELL
17
+ end
18
+
19
+ config.ssh.forward_agent = true
20
+
21
+ config.vm.provider :virtualbox do |v|
22
+ # v.memory = 2048
23
+ # v.cpus = 1
24
+ v.customize ['guestproperty', 'set', :id, '/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold', 10000 ]
25
+ v.customize ['modifyvm', :id, '--nictype1', 'virtio']
26
+ # v.customize ['modifyvm', :id, '--nic1', 'hostonly', '--nic2', 'nat']
27
+
28
+ host = RbConfig::CONFIG["host_os"]
29
+ if host =~ /darwin/ # OS X
30
+ # sysctl returns bytes, convert to MB
31
+ # allocate 1/8 (12.5%) of available physical memory to the VM
32
+ v.memory = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 8
33
+ v.cpus = 1 # `sysctl -n hw.physicalcpu`.to_i
34
+ elsif host =~ /linux/ # Linux
35
+ # TODO: Linux host not tested
36
+ # meminfo returns kilobytes, convert to MB
37
+ v.memory = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 8
38
+ v.cpus = `nproc`.to_i
39
+ end
40
+ end
41
+
42
+ prepd_config.machines.each do |key|
43
+ machine = Prepd::Vagrant::Machine.new(key)
44
+ STDOUT.puts "#{'^' * 100}\n#{machine.config}\n#{'^' * 100}" if ARGV.include? '--debug'
45
+
46
+ config.vm.define key, autostart: machine.autostart do |node|
47
+ node.vm.provider :virtualbox do |v|
48
+ v.name = machine.host_name
49
+ end
50
+
51
+ node.vm.box = machine.vm_box
52
+ node.vm.box_url = machine.vm_box_url
53
+
54
+ # NFS directory mounts
55
+ # NOTE: NFS exports cannot be nested; If there is an error, make sure that the attempted mounts here
56
+ # are not subdirectories of an already NFS mounted directory in the directory tree
57
+ node.vm.synced_folder '.', '/vagrant', disabled: true
58
+ machine.mounts.each do |key, mount_path|
59
+ FileUtils.mkdir_p(mount_path['host'])
60
+ node.vm.synced_folder mount_path['host'], mount_path['guest'], type: 'nfs',
61
+ mount_options: ['rw', 'vers=3', 'tcp'],
62
+ linux__nfs_options: ['rw', 'no_subtree_check', 'all_squash', 'async']
63
+ end
64
+
65
+ # Networking
66
+ node.vm.hostname = machine.host_name
67
+ node.vm.network :private_network, type: :dhcp, nic_type: 'virtio'
68
+
69
+ # Port Forwarding on vagrant interface
70
+ machine.port_forwards.each do |key, forward|
71
+ node.vm.network 'forwarded_port', host: forward['host'], guest: forward['guest'], auto_correct: forward['auto_correct'] || true
72
+ end
73
+
74
+ if Vagrant.has_plugin?('vagrant-hostmanager')
75
+ # node.hostmanager.aliases = ["node#{i}.local"]
76
+ node.hostmanager.ip_resolver = proc do |vm, resolving_vm|
77
+ if hostname = (vm.ssh_info && vm.ssh_info[:host])
78
+ if_name = machine.ssh_interface
79
+ `vagrant ssh #{key} -c "/sbin/ip addr show #{if_name} | grep 'inet '"`.split[1].split('/')[0]
80
+ end
81
+ end
82
+ end
83
+
84
+ # Provision playbook each mount path
85
+ ansible_groups = machine.ansible_groups.each_with_object({}) { |group, hash| hash[group] = key }
86
+ machine.mounts.select { |key, mount| mount.include? 'provisioners' }.each do |mount_key, mount|
87
+ vault_password_file = mount['guest'] + (mount['vault_password_file'] || 'vault-password.txt')
88
+ mount['provisioners'].each do |file|
89
+ config.vm.provision 'ansible_local' do |ansible|
90
+ ansible.compatibility_mode = '2.0'
91
+ ansible.groups = ansible_groups
92
+ ansible.playbook = file
93
+ ansible.provisioning_path = mount['guest']
94
+ ansible.vault_password_file = vault_password_file if File.exists?(vault_password_file)
95
+ ansible.verbose = false # '-vvv'
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+
102
+ if Vagrant.has_plugin?('vagrant-hostmanager')
103
+ config.hostmanager.enabled = true
104
+ config.hostmanager.manage_host = true
105
+ config.hostmanager.manage_guest = true
106
+ config.hostmanager.ignore_private_ip = false
107
+ end
108
+
109
+ # if Vagrant.has_plugin?('vagrant-cachier')
110
+ # config.cache.scope = :box
111
+ # config.cache.auto_detect = false
112
+ # config.cache.enable :apt
113
+ # config.cache.synced_folder_opts = {
114
+ # owner: '_apt',
115
+ # group: '_apt'
116
+ # }
117
+ # end
118
+ end
@@ -0,0 +1,52 @@
1
+ # Applies to this specific cluster
2
+ ---
3
+ # Every machine will have these values applied. They can be overridden in the machine's definition
4
+ defaults:
5
+ domain: <%= settings['name'] %>.local
6
+ mounts:
7
+ data: # project data mount (sub directories for each project group, e.g. hashapp)
8
+ host: <%= settings['workspace'] %>/data/<%= settings['projects_name'] %>
9
+ guest: /home/vagrant/data
10
+ clusters: # location of prepd.yml
11
+ host: <%= settings['workspace'] %>/clusters
12
+ guest: /home/vagrant/clusters
13
+ provisioners:
14
+ - provision.yml
15
+ roles: # ansible roles mount
16
+ host: <%= Dir.home %>/.ansible/roles
17
+ guest: /usr/share/ansible/roles
18
+ share: # prepd shared projects mount (e.g. playbooks, rails-templates, etc.)
19
+ host: <%= Dir.home %>/.prepd/share
20
+ guest: /home/vagrant/share
21
+
22
+ machines:
23
+ node0:
24
+ hardware:
25
+ cpus: 1
26
+ memory: 1024
27
+ vm:
28
+ autostart: true
29
+ box: <%= (boxes['development'] || {})['box'] %>
30
+ box_url: <%= (boxes['development'] || {})['box_url'] %>
31
+ mounts:
32
+ developer:
33
+ host: <%= settings['workspace'] %>/developer
34
+ guest: /home/vagrant/developer
35
+ provisioners:
36
+ # - <%= settings['name'] %>/provision.yml
37
+ - provision.yml
38
+ projects: # project code mount (sub directories for each project group, e.g. hashapp)
39
+ host: <%= settings['workspace'] %>/projects/<%= settings['projects_name'] %>
40
+ guest: /home/vagrant/projects
41
+ provisioners:
42
+ - provision.yml
43
+ ssh:
44
+ interface: enp0s8
45
+ ansible_groups: ['development']
46
+ node1:
47
+ vm:
48
+ box: <%= (boxes['minikube'] || {})['box'] %>
49
+ box_url: <%= (boxes['minikube'] || {})['box_url'] %>
50
+ ssh:
51
+ interface: enp0s8
52
+ ansible_groups: ['minikube']
@@ -0,0 +1,2 @@
1
+ ---
2
+ - include_tasks: ../provision.yml
@@ -0,0 +1,52 @@
1
+ {
2
+ "variables": {
3
+ "box_namespace": "{{env `BOX_NAMESPACE`}}",
4
+ "box_version": "{{env `BOX_VERSION`}}",
5
+ "playbook_file": "{{env `PLAYBOOK_FILE`}}",
6
+ "vm_base_name": "{{env `VM_BASE_NAME`}}",
7
+ "vm_name": "{{env `VM_BASE_NAME`}}-{{env `VM_OUTPUT`}}",
8
+ "vm_input": "{{env `VM_INPUT`}}",
9
+ "vm_output": "{{env `VM_OUTPUT`}}",
10
+ "json_rb_file": "{{env `JSON_RB_FILE`}}"
11
+ },
12
+
13
+ "builders": [
14
+ {
15
+ "type": "virtualbox-ovf",
16
+ "guest_additions_mode": "disable",
17
+ "headless": true,
18
+ "output_directory": "images/{{user `vm_output`}}",
19
+ "shutdown_command": "echo 'halt -p' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'",
20
+ "source_path": "images/{{user `vm_input`}}/{{user `vm_base_name`}}-{{user `vm_input`}}.ovf",
21
+ "ssh_username": "vagrant",
22
+ "ssh_password": "vagrant",
23
+ "ssh_wait_timeout": "30s",
24
+ "vm_name": "{{user `vm_name`}}"
25
+ }
26
+ ],
27
+
28
+ "provisioners": [
29
+ {
30
+ "type": "ansible",
31
+ "groups": [ "{{user `vm_output`}}" ],
32
+ "playbook_file": "{{user `playbook_file`}}",
33
+ "user" : "vagrant"
34
+ }
35
+ ],
36
+
37
+ "post-processors": [
38
+ [
39
+ {
40
+ "type": "vagrant",
41
+ "keep_input_artifact": true,
42
+ "output": "boxes/{{user `vm_name`}}.box"
43
+ },
44
+ {
45
+ "type": "shell-local",
46
+ "inline": [
47
+ "{{user `json_rb_file`}} {{user `box_namespace`}} {{user `vm_name`}} {{user `box_version`}}"
48
+ ]
49
+ }
50
+ ]
51
+ ]
52
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "variables": {
3
+ "box_version": "{{env `BOX_VERSION`}}",
4
+ "core": "1",
5
+ "disk_size": "20240",
6
+ "iso_url": "{{env `ISO_URL`}}",
7
+ "iso_checksum": "{{env `ISO_CHECKSUM`}}",
8
+ "memory": "1024",
9
+ "playbook_file": "{{env `PLAYBOOK_FILE`}}",
10
+ "ssh_port": "22",
11
+ "ssh_wait_timeout": "10000s",
12
+ "vm_name": "{{env `VM_BASE_NAME`}}-{{env `VM_OUTPUT`}}",
13
+ "vm_output": "{{env `VM_OUTPUT`}}"
14
+ },
15
+
16
+ "builders": [
17
+ {
18
+ "type": "virtualbox-iso",
19
+ "boot_command": [
20
+ "<esc><wait>",
21
+ "install ",
22
+ "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
23
+ "debian-installer=en_US ",
24
+ "auto ",
25
+ "locale=en_US ",
26
+ "kbd-chooser/method=us ",
27
+ "netcfg/get_hostname={{ .Name }} ",
28
+ "netcfg/get_domain=vagrantup.com ",
29
+ "fb=false ",
30
+ "debconf/frontend=noninteractive ",
31
+ "console-setup/ask_detect=false ",
32
+ "console-keymaps-at/keymap=us ",
33
+ "keyboard-configuration/xkb-keymap=us ",
34
+ "<enter><wait>"
35
+ ],
36
+ "disk_size": "{{user `disk_size`}}",
37
+ "guest_os_type": "Debian_64",
38
+ "headless": true,
39
+ "http_directory": ".",
40
+ "iso_checksum": "{{user `iso_checksum`}}",
41
+ "iso_checksum_type": "md5",
42
+ "iso_url": "{{user `iso_url`}}",
43
+ "output_directory": "images/{{user `vm_output`}}",
44
+ "shutdown_command": "echo 'halt -p' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'",
45
+ "ssh_password": "vagrant",
46
+ "ssh_username": "vagrant",
47
+ "ssh_port": "{{user `ssh_port`}}",
48
+ "ssh_wait_timeout": "{{user `ssh_wait_timeout`}}",
49
+ "vboxmanage": [
50
+ ["modifyvm", "{{.Name}}", "--memory", "{{user `memory`}}"],
51
+ ["modifyvm", "{{.Name}}", "--cpus", "{{user `core`}}"]
52
+ ],
53
+ "vm_name": "{{user `vm_name`}}"
54
+ }
55
+ ],
56
+
57
+ "provisioners": [
58
+ {
59
+ "type": "shell",
60
+ "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
61
+ "inline": [
62
+ "mkdir -p /home/vagrant/.ssh",
63
+ "chmod 0700 /home/vagrant/.ssh",
64
+ "wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys",
65
+ "chmod 0600 /home/vagrant/.ssh/authorized_keys",
66
+ "chown -R vagrant /home/vagrant/.ssh",
67
+ "echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"
68
+ ]
69
+ },
70
+ {
71
+ "type": "shell",
72
+ "inline": [
73
+ "sleep 3",
74
+ "echo 'yes' | sudo m-a prepare",
75
+ "sudo mkdir /tmp/vboxguest",
76
+ "sudo mount -t iso9660 -o loop /home/vagrant/VBoxGuestAdditions.iso /tmp/vboxguest",
77
+ "cd /tmp/vboxguest",
78
+ "sudo ./VBoxLinuxAdditions.run",
79
+ "cd /tmp",
80
+ "sudo umount /tmp/vboxguest",
81
+ "sudo rmdir /tmp/vboxguest",
82
+ "rm /home/vagrant/VBoxGuestAdditions.iso",
83
+ "echo Image Provisioned!"
84
+ ]
85
+ },
86
+ {
87
+ "type": "ansible",
88
+ "groups": [ "{{user `vm_output`}}" ],
89
+ "playbook_file": "{{user `playbook_file`}}",
90
+ "user" : "vagrant"
91
+ }
92
+ ],
93
+
94
+ "post-processors": [
95
+ {
96
+ "type": "vagrant",
97
+ "keep_input_artifact": true,
98
+ "output": "boxes/{{user `vm_name`}}.box"
99
+ }
100
+ ]
101
+ }
@@ -0,0 +1,404 @@
1
+ #### Contents of the preconfiguration file (for stretch)
2
+ ### Localization
3
+ # Preseeding only locale sets language, country and locale.
4
+ d-i debian-installer/locale string en_US
5
+
6
+ # The values can also be preseeded individually for greater flexibility.
7
+ #d-i debian-installer/language string en
8
+ #d-i debian-installer/country string NL
9
+ #d-i debian-installer/locale string en_GB.UTF-8
10
+ # Optionally specify additional locales to be generated.
11
+ d-i localechooser/supported-locales multiselect en_US.UTF-8
12
+
13
+ # Keyboard selection.
14
+ # keymap is an alias for keyboard-configuration/xkb-keymap
15
+ d-i keymap select us
16
+ # d-i keyboard-configuration/toggle select No toggling
17
+
18
+ ### Network configuration
19
+ # Disable network configuration entirely. This is useful for cdrom
20
+ # installations on non-networked devices where the network questions,
21
+ # warning and long timeouts are a nuisance.
22
+ #d-i netcfg/enable boolean false
23
+
24
+ # netcfg will choose an interface that has link if possible. This makes it
25
+ # skip displaying a list if there is more than one interface.
26
+ d-i netcfg/choose_interface select auto
27
+
28
+ # To pick a particular interface instead:
29
+ #d-i netcfg/choose_interface select eth1
30
+
31
+ # To set a different link detection timeout (default is 3 seconds).
32
+ # Values are interpreted as seconds.
33
+ #d-i netcfg/link_detection_timeout string 10
34
+
35
+ # If you have a slow dhcp server and the installer times out waiting for
36
+ # it, this might be useful.
37
+ #d-i netcfg/dhcp_timeout string 60
38
+ #d-i netcfg/dhcpv6_timeout string 60
39
+
40
+ # If you prefer to configure the network manually, uncomment this line and
41
+ # the static network configuration below.
42
+ #d-i netcfg/disable_autoconfig boolean true
43
+
44
+ # If you want the preconfiguration file to work on systems both with and
45
+ # without a dhcp server, uncomment these lines and the static network
46
+ # configuration below.
47
+ #d-i netcfg/dhcp_failed note
48
+ #d-i netcfg/dhcp_options select Configure network manually
49
+
50
+ # Static network configuration.
51
+ #
52
+ # IPv4 example
53
+ #d-i netcfg/get_ipaddress string 192.168.1.42
54
+ #d-i netcfg/get_netmask string 255.255.255.0
55
+ #d-i netcfg/get_gateway string 192.168.1.1
56
+ #d-i netcfg/get_nameservers string 192.168.1.1
57
+ #d-i netcfg/confirm_static boolean true
58
+ #
59
+ # IPv6 example
60
+ #d-i netcfg/get_ipaddress string fc00::2
61
+ #d-i netcfg/get_netmask string ffff:ffff:ffff:ffff::
62
+ #d-i netcfg/get_gateway string fc00::1
63
+ #d-i netcfg/get_nameservers string fc00::1
64
+ #d-i netcfg/confirm_static boolean true
65
+
66
+ # Any hostname and domain names assigned from dhcp take precedence over
67
+ # values set here. However, setting the values still prevents the questions
68
+ # from being shown, even if values come from dhcp.
69
+ d-i netcfg/get_hostname string unassigned-hostname
70
+ d-i netcfg/get_domain string unassigned-domain
71
+
72
+ # If you want to force a hostname, regardless of what either the DHCP
73
+ # server returns or what the reverse DNS entry for the IP is, uncomment
74
+ # and adjust the following line.
75
+ #d-i netcfg/hostname string somehost
76
+
77
+ # Disable that annoying WEP key dialog.
78
+ d-i netcfg/wireless_wep string
79
+ # The wacky dhcp hostname that some ISPs use as a password of sorts.
80
+ #d-i netcfg/dhcp_hostname string radish
81
+
82
+ # If non-free firmware is needed for the network or other hardware, you can
83
+ # configure the installer to always try to load it, without prompting. Or
84
+ # change to false to disable asking.
85
+ #d-i hw-detect/load_firmware boolean true
86
+
87
+ ### Network console
88
+ # Use the following settings if you wish to make use of the network-console
89
+ # component for remote installation over SSH. This only makes sense if you
90
+ # intend to perform the remainder of the installation manually.
91
+ #d-i anna/choose_modules string network-console
92
+ #d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key
93
+ #d-i network-console/password password r00tme
94
+ #d-i network-console/password-again password r00tme
95
+
96
+ ### Mirror settings
97
+ # If you select ftp, the mirror/country string does not need to be set.
98
+ #d-i mirror/protocol string ftp
99
+ d-i mirror/country string singapore
100
+ d-i mirror/http/hostname string ftp.sg.debian.org
101
+ d-i mirror/http/directory string /debian
102
+ d-i mirror/http/proxy string
103
+
104
+ # Suite to install.
105
+ #d-i mirror/suite string testing
106
+ # Suite to use for loading installer components (optional).
107
+ #d-i mirror/udeb/suite string testing
108
+
109
+ ### Account setup
110
+ # Skip creation of a root account (normal user account will be able to
111
+ # use sudo).
112
+ d-i passwd/root-login boolean false
113
+ # Alternatively, to skip creation of a normal user account.
114
+ #d-i passwd/make-user boolean false
115
+
116
+ # Root password, either in clear text
117
+ #d-i passwd/root-password password r00tme
118
+ #d-i passwd/root-password-again password r00tme
119
+ # or encrypted using an MD5 hash.
120
+ #d-i passwd/root-password-crypted password [MD5 hash]
121
+
122
+ # To create a normal user account.
123
+ d-i passwd/user-fullname string Vagrant User
124
+ d-i passwd/username string vagrant
125
+ # Normal user's password, either in clear text
126
+ d-i passwd/user-password password vagrant
127
+ d-i passwd/user-password-again password vagrant
128
+ # or encrypted using an MD5 hash.
129
+ #d-i passwd/user-password-crypted password [MD5 hash]
130
+ # Create the first user with the specified UID instead of the default.
131
+ #d-i passwd/user-uid string 1010
132
+
133
+ # The user account will be added to some standard initial groups. To
134
+ # override that, use this.
135
+ #d-i passwd/user-default-groups string audio cdrom video
136
+
137
+ ### Clock and time zone setup
138
+ # Controls whether or not the hardware clock is set to UTC.
139
+ d-i clock-setup/utc boolean true
140
+
141
+ # You may set this to any valid setting for $TZ; see the contents of
142
+ # /usr/share/zoneinfo/ for valid values.
143
+ d-i time/zone string Asis/Singapore
144
+
145
+ # Controls whether to use NTP to set the clock during the install
146
+ d-i clock-setup/ntp boolean true
147
+ # NTP server to use. The default is almost always fine here.
148
+ #d-i clock-setup/ntp-server string ntp.example.com
149
+
150
+ ### Partitioning
151
+ ## Partitioning example
152
+ # If the system has free space you can choose to only partition that space.
153
+ # This is only honoured if partman-auto/method (below) is not set.
154
+ #d-i partman-auto/init_automatically_partition select biggest_free
155
+
156
+ # Alternatively, you may specify a disk to partition. If the system has only
157
+ # one disk the installer will default to using that, but otherwise the device
158
+ # name must be given in traditional, non-devfs format (so e.g. /dev/hda or
159
+ # /dev/sda, and not e.g. /dev/discs/disc0/disc).
160
+ # For example, to use the first SCSI/SATA hard disk:
161
+ #d-i partman-auto/disk string /dev/sda
162
+ # In addition, you'll need to specify the method to use.
163
+ # The presently available methods are:
164
+ # - regular: use the usual partition types for your architecture
165
+ # - lvm: use LVM to partition the disk
166
+ # - crypto: use LVM within an encrypted partition
167
+ d-i partman-auto/method string lvm
168
+
169
+ # If one of the disks that are going to be automatically partitioned
170
+ # contains an old LVM configuration, the user will normally receive a
171
+ # warning. This can be preseeded away...
172
+ d-i partman-lvm/device_remove_lvm boolean true
173
+ # The same applies to pre-existing software RAID array:
174
+ d-i partman-md/device_remove_md boolean true
175
+ # And the same goes for the confirmation to write the lvm partitions.
176
+ d-i partman-lvm/confirm boolean true
177
+ d-i partman-lvm/confirm_nooverwrite boolean true
178
+
179
+ # You can choose one of the three predefined partitioning recipes:
180
+ # - atomic: all files in one partition
181
+ # - home: separate /home partition
182
+ # - multi: separate /home, /usr, /var, and /tmp partitions
183
+ d-i partman-auto/choose_recipe select atomic
184
+
185
+ # Or provide a recipe of your own...
186
+ # If you have a way to get a recipe file into the d-i environment, you can
187
+ # just point at it.
188
+ #d-i partman-auto/expert_recipe_file string /hd-media/recipe
189
+
190
+ # If not, you can put an entire recipe into the preconfiguration file in one
191
+ # (logical) line. This example creates a small /boot partition, suitable
192
+ # swap, and uses the rest of the space for the root partition:
193
+ #d-i partman-auto/expert_recipe string \
194
+ # boot-root :: \
195
+ # 40 50 100 ext3 \
196
+ # $primary{ } $bootable{ } \
197
+ # method{ format } format{ } \
198
+ # use_filesystem{ } filesystem{ ext3 } \
199
+ # mountpoint{ /boot } \
200
+ # . \
201
+ # 500 10000 1000000000 ext3 \
202
+ # method{ format } format{ } \
203
+ # use_filesystem{ } filesystem{ ext3 } \
204
+ # mountpoint{ / } \
205
+ # . \
206
+ # 64 512 300% linux-swap \
207
+ # method{ swap } format{ } \
208
+ # .
209
+
210
+ # The full recipe format is documented in the file partman-auto-recipe.txt
211
+ # included in the 'debian-installer' package or available from D-I source
212
+ # repository. This also documents how to specify settings such as file
213
+ # system labels, volume group names and which physical devices to include
214
+ # in a volume group.
215
+
216
+ # This makes partman automatically partition without confirmation, provided
217
+ # that you told it what to do using one of the methods above.
218
+ d-i partman-partitioning/confirm_write_new_label boolean true
219
+ d-i partman/choose_partition select finish
220
+ d-i partman/confirm boolean true
221
+ d-i partman/confirm_nooverwrite boolean true
222
+
223
+ ## Partitioning using RAID
224
+ # The method should be set to "raid".
225
+ #d-i partman-auto/method string raid
226
+ # Specify the disks to be partitioned. They will all get the same layout,
227
+ # so this will only work if the disks are the same size.
228
+ #d-i partman-auto/disk string /dev/sda /dev/sdb
229
+
230
+ # Next you need to specify the physical partitions that will be used.
231
+ #d-i partman-auto/expert_recipe string \
232
+ # multiraid :: \
233
+ # 1000 5000 4000 raid \
234
+ # $primary{ } method{ raid } \
235
+ # . \
236
+ # 64 512 300% raid \
237
+ # method{ raid } \
238
+ # . \
239
+ # 500 10000 1000000000 raid \
240
+ # method{ raid } \
241
+ # .
242
+
243
+ # Last you need to specify how the previously defined partitions will be
244
+ # used in the RAID setup. Remember to use the correct partition numbers
245
+ # for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported;
246
+ # devices are separated using "#".
247
+ # Parameters are:
248
+ # <raidtype> <devcount> <sparecount> <fstype> <mountpoint> \
249
+ # <devices> <sparedevices>
250
+
251
+ #d-i partman-auto-raid/recipe string \
252
+ # 1 2 0 ext3 / \
253
+ # /dev/sda1#/dev/sdb1 \
254
+ # . \
255
+ # 1 2 0 swap - \
256
+ # /dev/sda5#/dev/sdb5 \
257
+ # . \
258
+ # 0 2 0 ext3 /home \
259
+ # /dev/sda6#/dev/sdb6 \
260
+ # .
261
+
262
+ # For additional information see the file partman-auto-raid-recipe.txt
263
+ # included in the 'debian-installer' package or available from D-I source
264
+ # repository.
265
+
266
+ # This makes partman automatically partition without confirmation.
267
+ d-i partman-md/confirm boolean true
268
+ d-i partman-partitioning/confirm_write_new_label boolean true
269
+ d-i partman/choose_partition select finish
270
+ d-i partman/confirm boolean true
271
+ d-i partman/confirm_nooverwrite boolean true
272
+
273
+ ## Controlling how partitions are mounted
274
+ # The default is to mount by UUID, but you can also choose "traditional" to
275
+ # use traditional device names, or "label" to try filesystem labels before
276
+ # falling back to UUIDs.
277
+ #d-i partman/mount_style select uuid
278
+
279
+ ### Base system installation
280
+ # Configure APT to not install recommended packages by default. Use of this
281
+ # option can result in an incomplete system and should only be used by very
282
+ # experienced users.
283
+ #d-i base-installer/install-recommends boolean false
284
+
285
+ # The kernel image (meta) package to be installed; "none" can be used if no
286
+ # kernel is to be installed.
287
+ #d-i base-installer/kernel/image string linux-image-486
288
+
289
+ ### Apt setup
290
+ # Don't prompt for next CD
291
+ d-i apt-setup/use_mirror boolean false
292
+ d-i apt-setup/cdrom/set-first boolean false
293
+ d-i apt-setup/cdrom/set-next boolean false
294
+ d-i apt-setup/cdrom/set-failed boolean false
295
+
296
+ # You can choose to install non-free and contrib software.
297
+ d-i apt-setup/non-free boolean true
298
+ d-i apt-setup/contrib boolean true
299
+ # Uncomment this if you don't want to use a network mirror.
300
+ d-i apt-setup/use_mirror boolean true
301
+ # Select which update services to use; define the mirrors to be used.
302
+ # Values shown below are the normal defaults.
303
+ #d-i apt-setup/services-select multiselect security, updates
304
+ #d-i apt-setup/security_host string security.debian.org
305
+
306
+ # Add backports repository (for at least rubygems, puppet and virtualbox)
307
+ d-i apt-setup/local0/repository string \
308
+ http://ftp.sg.debian.org/debian stretch-backports main contrib non-free
309
+ d-i apt-setup/local0/source boolean false
310
+
311
+
312
+ # Additional repositories, local[0-9] available
313
+ #d-i apt-setup/local0/repository string \
314
+ # http://local.server/debian stable main
315
+ #d-i apt-setup/local0/comment string local server
316
+ # Enable deb-src lines
317
+ #d-i apt-setup/local0/source boolean true
318
+ # URL to the public key of the local repository; you must provide a key or
319
+ # apt will complain about the unauthenticated repository and so the
320
+ # sources.list line will be left commented out
321
+ #d-i apt-setup/local0/key string http://local.server/key
322
+
323
+ # By default the installer requires that repositories be authenticated
324
+ # using a known gpg key. This setting can be used to disable that
325
+ # authentication. Warning: Insecure, not recommended.
326
+ d-i debian-installer/allow_unauthenticated boolean true
327
+
328
+ ### Package selection
329
+ tasksel tasksel/first multiselect standard
330
+ # If the desktop task is selected, install the kde and xfce desktops
331
+ # instead of the default gnome desktop.
332
+ #tasksel tasksel/desktop multiselect kde, xfce
333
+
334
+ # Individual additional packages to install
335
+ d-i pkgsel/include string openssh-server locales-all build-essential module-assistant linux-headers-amd64 dkms ifupdown isc-dhcp-client
336
+ # Whether to upgrade packages after debootstrap.
337
+ # Allowed values: none, safe-upgrade, full-upgrade
338
+ d-i pkgsel/upgrade select none
339
+
340
+ # Some versions of the installer can report back on what software you have
341
+ # installed, and what software you use. The default is not to report back,
342
+ # but sending reports helps the project determine what software is most
343
+ # popular and include it on CDs.
344
+ popularity-contest popularity-contest/participate boolean false
345
+
346
+ ### Finishing up the installation
347
+ d-i grub-installer/only_debian boolean true
348
+
349
+ d-i grub-installer/timeout string 2
350
+
351
+ d-i grub-installer/bootdev string /dev/sda
352
+
353
+ # During installations from serial console, the regular virtual consoles
354
+ # (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next
355
+ # line to prevent this.
356
+ #d-i finish-install/keep-consoles boolean true
357
+
358
+ # Avoid that last message about the install being complete.
359
+ d-i finish-install/reboot_in_progress note
360
+
361
+ # This will prevent the installer from ejecting the CD during the reboot,
362
+ # which is useful in some situations.
363
+ #d-i cdrom-detect/eject boolean false
364
+
365
+ # This is how to make the installer shutdown when finished, but not
366
+ # reboot into the installed system.
367
+ # d-i debian-installer/exit/halt boolean true
368
+ # This will power off the machine instead of just halting it.
369
+ #d-i debian-installer/exit/poweroff boolean true
370
+
371
+ ### Preseeding other packages
372
+ # Depending on what software you choose to install, or if things go wrong
373
+ # during the installation process, it's possible that other questions may
374
+ # be asked. You can preseed those too, of course. To get a list of every
375
+ # possible question that could be asked during an install, do an
376
+ # installation, and then run these commands:
377
+ # debconf-get-selections --installer > file
378
+ # debconf-get-selections >> file
379
+
380
+
381
+ #### Advanced options
382
+ ### Running custom commands during the installation
383
+ # d-i preseeding is inherently not secure. Nothing in the installer checks
384
+ # for attempts at buffer overflows or other exploits of the values of a
385
+ # preconfiguration file like this one. Only use preconfiguration files from
386
+ # trusted locations! To drive that home, and because it's generally useful,
387
+ # here's a way to run any shell command you'd like inside the installer,
388
+ # automatically.
389
+
390
+ # This first command is run as early as possible, just after
391
+ # preseeding is read.
392
+ #d-i preseed/early_command string anna-install some-udeb
393
+ # This command is run immediately before the partitioner starts. It may be
394
+ # useful to apply dynamic partitioner preseeding that depends on the state
395
+ # of the disks (which may not be visible when preseed/early_command runs).
396
+ #d-i partman/early_command \
397
+ # string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
398
+ # This command is run just before the install finishes, but when there is
399
+ # still a usable /target directory. You can chroot to /target and use it
400
+ # directly, or use the apt-install and in-target commands to easily install
401
+ # packages and run commands in the target system.
402
+ #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
403
+ d-i preseed/late_command string \
404
+ in-target sed -i 's/^deb cdrom/# DISABLED deb/' /etc/apt/sources.list