├── .rbenv-gemsets ├── .ruby-version ├── .gitignore ├── README.md ├── template ├── build_time.sh ├── apt.sh ├── sudo.sh ├── vagrant.sh ├── cleanup.sh ├── vbox.sh ├── definition.rb └── preseed.cfg ├── renovate.json ├── definitions └── trusty │ └── definition.rb └── Makefile /.rbenv-gemsets: -------------------------------------------------------------------------------- 1 | veewee 2 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.0.0p481 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.box 2 | /iso 3 | /veewee 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Vagrant Boxes 2 | ============= 3 | -------------------------------------------------------------------------------- /template/build_time.sh: -------------------------------------------------------------------------------- 1 | date > /etc/vagrant_box_build_time 2 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ], 5 | "groupName": "all" 6 | } 7 | -------------------------------------------------------------------------------- /template/apt.sh: -------------------------------------------------------------------------------- 1 | apt-get -y update 2 | apt-get -y upgrade 3 | apt-get -y install linux-headers-$(uname -r) build-essential emacs24-nox htop tmux less net-tools ssh wget socat lsof tcpdump netcat ioping fio locate ethstatus dstat file iotop docker.io 4 | -------------------------------------------------------------------------------- /template/sudo.sh: -------------------------------------------------------------------------------- 1 | groupadd -r admin 2 | usermod -a -G admin vagrant 3 | cp /etc/sudoers /etc/sudoers.orig 4 | sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers 5 | sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers 6 | -------------------------------------------------------------------------------- /template/vagrant.sh: -------------------------------------------------------------------------------- 1 | mkdir /home/vagrant/.ssh 2 | chmod 700 /home/vagrant/.ssh 3 | cd /home/vagrant/.ssh 4 | wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys 5 | chmod 600 /home/vagrant/.ssh/authorized_keys 6 | chown -R vagrant /home/vagrant/.ssh 7 | -------------------------------------------------------------------------------- /definitions/trusty/definition.rb: -------------------------------------------------------------------------------- 1 | require '../../template/definition.rb' 2 | 3 | Veewee::Session.declare ::Definition.merge( 4 | :iso_file => "ubuntu-14.04.1-server-amd64.iso", 5 | :iso_src => "http://fr.releases.ubuntu.com/trusty/ubuntu-14.04.1-server-amd64.iso", 6 | :iso_md5 => "af5f788aee1b32c4b2634734309cc9e9" 7 | ) 8 | -------------------------------------------------------------------------------- /template/cleanup.sh: -------------------------------------------------------------------------------- 1 | apt-get -y autoremove 2 | 3 | dd if=/dev/zero of=/EMPTY bs=1M 4 | rm -f /EMPTY 5 | 6 | echo "cleaning up dhcp leases" 7 | rm /var/lib/dhcp/* 8 | 9 | echo "cleaning up udev rules" 10 | rm /etc/udev/rules.d/70-persistent-net.rules 11 | mkdir /etc/udev/rules.d/70-persistent-net.rules 12 | rm -rf /dev/.udev/ 13 | rm /lib/udev/rules.d/75-persistent-net-generator.rules 14 | 15 | echo "pre-up sleep 2" >> /etc/network/interfaces 16 | exit 17 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VEEWEE := cd veewee && VEEWEE_DIR=.. bundle exec veewee 2 | BOXES := $(addsuffix .box, $(subst definitions/, , $(wildcard definitions/*))) 3 | 4 | list: 5 | $(VEEWEE) vbox list 6 | 7 | install: 8 | git clone https://github.com/jedi4ever/veewee.git 9 | cd veewee && bundle install 10 | 11 | all: $(BOXES) 12 | 13 | $(BOXES): 14 | @for file in template/* ; do ln -s $(PWD)/$$file definitions/$(basename $@) 2> /dev/null || true; done 15 | $(VEEWEE) vbox build $(basename $@) --force 16 | $(VEEWEE) vbox export $(basename $@) 17 | mv veewee/$@ . 18 | 19 | # phonies 20 | 21 | .PHONY: list 22 | .PHONY: install 23 | .PHONY: all 24 | -------------------------------------------------------------------------------- /template/vbox.sh: -------------------------------------------------------------------------------- 1 | # Without libdbus virtualbox would not start automatically after compile 2 | apt-get -y install --no-install-recommends libdbus-1-3 3 | 4 | # Remove existing VirtualBox guest additions 5 | /etc/init.d/virtualbox-ose-guest-utils stop 6 | rmmod vboxguest 7 | aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils 8 | aptitude -y install dkms 9 | 10 | # Install the VirtualBox guest additions 11 | VBOX_VERSION=$(cat /home/vagrant/.vbox_version) 12 | VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso 13 | mount -o loop $VBOX_ISO /mnt 14 | yes|sh /mnt/VBoxLinuxAdditions.run 15 | umount /mnt 16 | 17 | # Cleanup 18 | rm $VBOX_ISO 19 | -------------------------------------------------------------------------------- /template/definition.rb: -------------------------------------------------------------------------------- 1 | Definition = { 2 | :cpu_count => '1', 3 | :memory_size=> '512', 4 | :disk_size => '10140', 5 | :disk_format => 'VDI', 6 | :hostiocache => 'off', 7 | :os_type_id => 'Ubuntu_64', 8 | :iso_download_timeout => "1000", 9 | :boot_wait => "4", 10 | :boot_cmd_sequence => [ 11 | '', 12 | '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ', 13 | 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ', 14 | 'hostname=%NAME% ', 15 | 'fb=false debconf/frontend=noninteractive ', 16 | 'keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=us keyboard-configuration/variant=us console-setup/ask_detect=false ', 17 | 'initrd=/install/initrd.gz -- ' 18 | ], 19 | :kickstart_port => "7122", 20 | :kickstart_timeout => "10000", 21 | :kickstart_file => "preseed.cfg", 22 | :ssh_login_timeout => "10000", 23 | :ssh_user => "vagrant", 24 | :ssh_password => "vagrant", 25 | :ssh_key => "", 26 | :ssh_host_port => "7222", 27 | :ssh_guest_port => "22", 28 | :sudo_cmd => "echo '%p'|sudo -S sh '%f'", 29 | :shutdown_cmd => "shutdown -P now", 30 | :postinstall_files => [ 31 | "build_time.sh", 32 | "apt.sh", 33 | "vbox.sh", 34 | "sudo.sh", 35 | "vagrant.sh", 36 | "cleanup.sh" 37 | ], 38 | :postinstall_timeout => "10000" 39 | } 40 | -------------------------------------------------------------------------------- /template/preseed.cfg: -------------------------------------------------------------------------------- 1 | ## Options to set on the command line 2 | d-i debian-installer/locale string en_US.utf8 3 | d-i console-setup/ask_detect boolean false 4 | d-i console-setup/layout string us 5 | 6 | d-i netcfg/get_hostname string unassigned-hostname 7 | d-i netcfg/get_domain string unassigned-domain 8 | 9 | d-i time/zone string UTC 10 | d-i clock-setup/utc-auto boolean true 11 | d-i clock-setup/utc boolean true 12 | 13 | d-i kbd-chooser/method select American English 14 | 15 | d-i netcfg/wireless_wep string 16 | 17 | d-i base-installer/kernel/override-image string linux-server 18 | 19 | d-i debconf debconf/frontend select Noninteractive 20 | 21 | d-i pkgsel/install-language-support boolean false 22 | tasksel tasksel/first multiselect standard, ubuntu-server 23 | 24 | d-i partman-auto/method string lvm 25 | 26 | d-i partman-lvm/confirm boolean true 27 | d-i partman-lvm/device_remove_lvm boolean true 28 | d-i partman-auto/choose_recipe select atomic 29 | 30 | d-i partman/confirm_write_new_label boolean true 31 | d-i partman/confirm_nooverwrite boolean true 32 | d-i partman/choose_partition select finish 33 | d-i partman/confirm boolean true 34 | 35 | # Write the changes to disks and configure LVM? 36 | d-i partman-lvm/confirm boolean true 37 | d-i partman-lvm/confirm_nooverwrite boolean true 38 | d-i partman-auto-lvm/guided_size string max 39 | 40 | # Default user 41 | d-i passwd/user-fullname string vagrant 42 | d-i passwd/username string vagrant 43 | d-i passwd/user-password password vagrant 44 | d-i passwd/user-password-again password vagrant 45 | d-i user-setup/encrypt-home boolean false 46 | d-i user-setup/allow-password-weak boolean true 47 | 48 | # Minimum packages (see postinstall.sh) 49 | d-i pkgsel/include string openssh-server ntp 50 | 51 | # Upgrade packages after debootstrap? (none, safe-upgrade, full-upgrade) 52 | # (note: set to none for speed) 53 | d-i pkgsel/upgrade select none 54 | 55 | d-i grub-installer/only_debian boolean true 56 | d-i grub-installer/with_other_os boolean true 57 | d-i finish-install/reboot_in_progress note 58 | 59 | d-i pkgsel/update-policy select none 60 | 61 | choose-mirror-bin mirror/http/proxy string 62 | --------------------------------------------------------------------------------