t push -u origin master
This commit is contained in:
commit
1a5539fa14
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.git
|
||||
*.swp
|
||||
packer_cache/
|
18
README.md
Normal file
18
README.md
Normal file
@ -0,0 +1,18 @@
|
||||
#Packer.io
|
||||
|
||||
##Machine image builder
|
||||
|
||||
To launch build
|
||||
|
||||
```sh
|
||||
$ packer build os/debian8.2/debian.conf
|
||||
```
|
||||
|
||||
to host preseed file
|
||||
|
||||
```
|
||||
cd os/debian8.2/
|
||||
python -m SimpleHTTPServer #this is a hack beware that debian.conf (and thu the user password here publicly accessible)
|
||||
|
||||
```
|
||||
|
41
os/debian8.2/debian.conf
Normal file
41
os/debian8.2/debian.conf
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"variables": {
|
||||
"ssh_name": "kappataumu",
|
||||
"ssh_pass": "kappataumu",
|
||||
"hostname": "packer-test"
|
||||
},
|
||||
|
||||
"builders": [{
|
||||
"type": "virtualbox-iso",
|
||||
"guest_os_type": "Ubuntu_64",
|
||||
|
||||
"vboxmanage": [
|
||||
["modifyvm", "{{.Name}}", "--vram", "32"]
|
||||
],
|
||||
|
||||
"disk_size" : 10000,
|
||||
|
||||
"iso_url": "http://ftp.free.fr/mirrors/cdimage.debian.org/debian-cd/8.2.0/amd64/iso-cd/debian-8.2.0-amd64-netinst.iso",
|
||||
"iso_checksum_type": "sha1",
|
||||
"iso_checksum": "a41801dcc0e37bce2406e18b334f99ae366d6fde",
|
||||
"http_directory" : "ubuntu_64",
|
||||
"http_port_min" : 9001,
|
||||
"http_port_max" : 9001,
|
||||
|
||||
"ssh_username": "{{user `ssh_name`}}",
|
||||
"ssh_password": "{{user `ssh_pass`}}",
|
||||
"ssh_wait_timeout": "20m",
|
||||
|
||||
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",
|
||||
|
||||
"boot_command" :
|
||||
[
|
||||
"<esc><wait>",
|
||||
"auto ",
|
||||
"preseed/url=http://192.168.52.152:8000/preseed.cfg ",
|
||||
"<enter>"
|
||||
]
|
||||
|
||||
}]
|
||||
}
|
||||
|
59
os/debian8.2/preseed.cfg
Normal file
59
os/debian8.2/preseed.cfg
Normal file
@ -0,0 +1,59 @@
|
||||
d-i debian-installer/locale string en_US
|
||||
d-i keyboard-configuration/xkb-keymap select us
|
||||
|
||||
d-i passwd/root-password-again password vagrant
|
||||
d-i passwd/root-password password vagrant
|
||||
d-i passwd/user-fullname string vagrant
|
||||
d-i passwd/username string vagrant
|
||||
d-i passwd/user-password password vagrant
|
||||
d-i passwd/user-password-again password vagrant
|
||||
|
||||
d-i time/zone string UTC
|
||||
|
||||
d-i partman-auto/method string regular
|
||||
d-i partman-auto/expert_recipe string \
|
||||
scheme :: \
|
||||
200 0 200 ext4 \
|
||||
$primary{ } \
|
||||
$bootable{ } \
|
||||
method{ format } \
|
||||
format{ } \
|
||||
use_filesystem{ } \
|
||||
filesystem{ ext4 } \
|
||||
mountpoint{ /boot } . \
|
||||
200% 0 200% linux-swap \
|
||||
$primary{ } \
|
||||
method{ swap } \
|
||||
format{ } . \
|
||||
1 0 -1 ext4 \
|
||||
$primary{ } \
|
||||
method{ format } \
|
||||
format{ } \
|
||||
use_filesystem{ } \
|
||||
filesystem{ ext4 } \
|
||||
mountpoint{ / } .
|
||||
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
|
||||
|
||||
d-i apt-setup/non-free boolean true
|
||||
d-i apt-setup/contrib boolean true
|
||||
|
||||
tasksel tasksel/first multiselect
|
||||
d-i pkgsel/include string curl openssh-server sudo
|
||||
|
||||
d-i grub-installer/bootdev string default
|
||||
|
||||
d-i finish-install/reboot_in_progress note
|
||||
|
||||
d-i preseed/early_command string \
|
||||
sed -i \
|
||||
-e "/in-target/i echo 'd() { /sbin/discover \"\$@\" | grep -v virtualbox; }' > /target/etc/discover-pkginstall.conf" \
|
||||
-e "/in-target/i echo 'discover=d' >> /target/etc/discover-pkginstall.conf" \
|
||||
/usr/lib/pre-pkgsel.d/20install-hwpackages
|
||||
d-i preseed/late_command string \
|
||||
echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \
|
||||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \
|
||||
chmod 440 /target/etc/sudoers.d/vagrant
|
||||
|
Loading…
Reference in New Issue
Block a user