veewee 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +5 -1
  3. data/Gemfile.lock +29 -26
  4. data/README.md +51 -26
  5. data/Rakefile +41 -36
  6. data/lib/veewee/scancode.rb +1 -1
  7. data/lib/veewee/session.rb +156 -159
  8. data/lib/veewee/version.rb +1 -1
  9. data/templates/CentOS-4.8-i386/postinstall.sh +1 -1
  10. data/templates/CentOS-5.5-x86_64-netboot/definition.rb +16 -0
  11. data/templates/CentOS-5.5-x86_64-netboot/ks.cfg +46 -0
  12. data/templates/CentOS-5.5-x86_64-netboot/postinstall.sh +60 -0
  13. data/templates/CentOS-5.6-i386-netboot/definition.rb +1 -1
  14. data/templates/CentOS-5.6-i386-netboot/ks.cfg +2 -2
  15. data/templates/CentOS-5.6-i386-netboot/postinstall.sh +1 -1
  16. data/templates/CentOS-5.6-i386/postinstall.sh +1 -1
  17. data/templates/CentOS-5.6-x86_64-netboot/definition.rb +1 -1
  18. data/templates/CentOS-5.6-x86_64-netboot/ks.cfg +1 -1
  19. data/templates/CentOS-5.6-x86_64-netboot/postinstall.sh +3 -2
  20. data/templates/CentOS-5.7-i386-netboot/definition.rb +16 -0
  21. data/templates/CentOS-5.7-i386-netboot/ks.cfg +45 -0
  22. data/templates/CentOS-5.7-i386-netboot/postinstall.sh +53 -0
  23. data/templates/CentOS-5.7-x86_64-netboot/definition.rb +16 -0
  24. data/templates/CentOS-5.7-x86_64-netboot/ks.cfg +45 -0
  25. data/templates/CentOS-5.7-x86_64-netboot/postinstall.sh +60 -0
  26. data/templates/CentOS-6.0-i386-netboot/ks.cfg +1 -1
  27. data/templates/CentOS-6.0-i386-netboot/postinstall.sh +1 -1
  28. data/templates/CentOS-6.0-i386/postinstall.sh +2 -2
  29. data/templates/CentOS-6.0-x86_64-minimal/definition.rb +17 -0
  30. data/templates/CentOS-6.0-x86_64-minimal/ks.cfg +37 -0
  31. data/templates/CentOS-6.0-x86_64-minimal/postinstall.sh +50 -0
  32. data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +1 -1
  33. data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +1 -1
  34. data/templates/CentOS-6.0-x86_64/postinstall.sh +2 -2
  35. data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +1 -1
  36. data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +1 -1
  37. data/templates/{Debian-6.0.2-amd64-netboot → Debian-6.0.3-amd64-netboot}/definition.rb +3 -3
  38. data/templates/Debian-6.0.3-amd64-netboot/postinstall.sh +80 -0
  39. data/templates/{Debian-6.0.2-amd64-netboot → Debian-6.0.3-amd64-netboot}/preseed.cfg +0 -0
  40. data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/definition.rb +3 -3
  41. data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/postinstall.sh +2 -2
  42. data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/preseed.cfg +0 -0
  43. data/templates/Fedora-14-amd64-netboot/definition.rb +1 -1
  44. data/templates/Fedora-14-amd64-netboot/postinstall.sh +1 -1
  45. data/templates/Fedora-14-amd64/definition.rb +1 -1
  46. data/templates/Fedora-14-amd64/postinstall.sh +1 -1
  47. data/templates/Fedora-14-i386-netboot/postinstall.sh +1 -1
  48. data/templates/Fedora-14-i386/postinstall.sh +1 -1
  49. data/templates/Fedora-15-x86_64-netboot/definition.rb +29 -0
  50. data/templates/Fedora-15-x86_64-netboot/ks.cfg +64 -0
  51. data/templates/Fedora-15-x86_64-netboot/postinstall.sh +33 -0
  52. data/templates/Fedora-15-x86_64/definition.rb +17 -0
  53. data/templates/Fedora-15-x86_64/ks.cfg +64 -0
  54. data/templates/Fedora-15-x86_64/postinstall.sh +33 -0
  55. data/templates/archlinux-i386-netboot/aif.cfg +28 -0
  56. data/templates/archlinux-i386-netboot/definition.rb +26 -0
  57. data/templates/archlinux-i386-netboot/postinstall.sh +75 -0
  58. data/templates/archlinux-i386-netboot/postinstall2.sh +30 -0
  59. data/templates/archlinux-i386/postinstall.sh +12 -1
  60. data/templates/archlinux-x86_64-netboot/aif.cfg +28 -0
  61. data/templates/archlinux-x86_64-netboot/definition.rb +26 -0
  62. data/templates/archlinux-x86_64-netboot/postinstall.sh +75 -0
  63. data/templates/archlinux-x86_64-netboot/postinstall2.sh +30 -0
  64. data/templates/archlinux-x86_64/aif.cfg +1 -1
  65. data/templates/archlinux-x86_64/definition.rb +1 -1
  66. data/templates/archlinux-x86_64/postinstall.sh +16 -21
  67. data/templates/archlinux-x86_64/postinstall2.sh +38 -0
  68. data/templates/freebsd-8.2-pcbsd-i386-netboot/definition.rb +2 -4
  69. data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +1 -1
  70. data/templates/freebsd-8.2-pcbsd-i386/definition.rb +3 -2
  71. data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +1 -1
  72. data/templates/gentoo-latest-i386-experimental/definition.rb +4 -4
  73. data/templates/gentoo-latest-i386-experimental/postinstall.sh +1 -1
  74. data/templates/openSUSE-11.4-DVD-i586/autoinst_de.xml +1284 -0
  75. data/templates/openSUSE-11.4-DVD-i586/autoinst_en.xml +1284 -0
  76. data/templates/openSUSE-11.4-DVD-i586/definition.rb +28 -0
  77. data/templates/openSUSE-11.4-DVD-i586/postinstall.sh +43 -0
  78. data/templates/openSUSE-11.4-DVD-x86_64/autoinst_de.xml +1459 -0
  79. data/templates/openSUSE-11.4-DVD-x86_64/autoinst_en.xml +1459 -0
  80. data/templates/openSUSE-11.4-DVD-x86_64/definition.rb +28 -0
  81. data/templates/openSUSE-11.4-DVD-x86_64/postinstall.sh +43 -0
  82. data/templates/openSUSE-11.4-NET-i586/autoinst_de.xml +1278 -0
  83. data/templates/openSUSE-11.4-NET-i586/autoinst_en.xml +1278 -0
  84. data/templates/openSUSE-11.4-NET-i586/definition.rb +28 -0
  85. data/templates/openSUSE-11.4-NET-i586/postinstall.sh +43 -0
  86. data/templates/openSUSE-11.4-NET-x86_64/autoinst_de.xml +1453 -0
  87. data/templates/openSUSE-11.4-NET-x86_64/autoinst_en.xml +1453 -0
  88. data/templates/openSUSE-11.4-NET-x86_64/definition.rb +28 -0
  89. data/templates/openSUSE-11.4-NET-x86_64/postinstall.sh +43 -0
  90. data/templates/openindiana-148-ai-x86/postinstall.sh +1 -1
  91. data/templates/opensuse-11.4-i386-experimental/postinstall.sh +1 -1
  92. data/templates/scientificlinux-6.1-i386-netboot/definition.rb +16 -0
  93. data/templates/scientificlinux-6.1-i386-netboot/ks.cfg +53 -0
  94. data/templates/scientificlinux-6.1-i386-netboot/postinstall.sh +30 -0
  95. data/templates/scientificlinux-6.1-x86_64-netboot/definition.rb +16 -0
  96. data/templates/scientificlinux-6.1-x86_64-netboot/ks.cfg +53 -0
  97. data/templates/scientificlinux-6.1-x86_64-netboot/postinstall.sh +30 -0
  98. data/templates/solaris-11-express-i386/postinstall.sh +1 -1
  99. data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +1 -1
  100. data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +1 -1
  101. data/templates/{ubuntu-10.04.2-server-amd64-alt → ubuntu-10.04.3-server-amd64-alt}/definition.rb +4 -4
  102. data/templates/{ubuntu-10.04.2-server-amd64-alt → ubuntu-10.04.3-server-amd64-alt}/postinstall.sh +1 -1
  103. data/templates/{ubuntu-10.04.2-server-amd64-alt → ubuntu-10.04.3-server-amd64-alt}/preseed.cfg +0 -0
  104. data/templates/{ubuntu-10.04.2-server-amd64 → ubuntu-10.04.3-server-amd64}/definition.rb +3 -6
  105. data/templates/{ubuntu-10.04.2-server-amd64 → ubuntu-10.04.3-server-amd64}/postinstall.sh +1 -1
  106. data/templates/{ubuntu-10.04.2-server-amd64 → ubuntu-10.04.3-server-amd64}/preseed.cfg +0 -0
  107. data/templates/{ubuntu-10.04.2-server-i386 → ubuntu-10.04.3-server-i386}/definition.rb +4 -4
  108. data/templates/{ubuntu-10.04.2-server-i386 → ubuntu-10.04.3-server-i386}/postinstall.sh +1 -1
  109. data/templates/{ubuntu-10.04.2-server-i386 → ubuntu-10.04.3-server-i386}/preseed.cfg +0 -0
  110. data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +1 -1
  111. data/templates/ubuntu-10.10-server-amd64/postinstall.sh +1 -1
  112. data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +1 -1
  113. data/templates/ubuntu-10.10-server-i386/postinstall.sh +1 -1
  114. data/templates/ubuntu-11.04-server-amd64/postinstall.sh +7 -1
  115. data/templates/ubuntu-11.04-server-i386/definition.rb +1 -1
  116. data/templates/ubuntu-11.04-server-i386/postinstall.sh +1 -1
  117. data/templates/ubuntu-11.10-server-amd64-ishaya/definition.rb +24 -0
  118. data/templates/{Debian-6.0.2-amd64-netboot → ubuntu-11.10-server-amd64-ishaya}/postinstall.sh +42 -23
  119. data/templates/ubuntu-11.10-server-amd64-ishaya/preseed.cfg +87 -0
  120. data/templates/ubuntu-11.10-server-amd64-ruby192/definition.rb +24 -0
  121. data/templates/ubuntu-11.10-server-amd64-ruby192/postinstall.sh +90 -0
  122. data/templates/ubuntu-11.10-server-amd64-ruby192/preseed.cfg +87 -0
  123. data/templates/ubuntu-11.10-server-amd64/definition.rb +35 -0
  124. data/templates/ubuntu-11.10-server-amd64/postinstall.sh +88 -0
  125. data/templates/ubuntu-11.10-server-amd64/preseed.cfg +87 -0
  126. data/templates/ubuntu-11.10-server-i386/definition.rb +35 -0
  127. data/templates/ubuntu-11.10-server-i386/postinstall.sh +88 -0
  128. data/templates/ubuntu-11.10-server-i386/preseed.cfg +87 -0
  129. data/templates/ubuntu-8.04.4-server-amd64/definition.rb +1 -0
  130. data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +8 -7
  131. data/templates/ubuntu-8.04.4-server-amd64/preseed.cfg +0 -1
  132. data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +25 -3
  133. data/templates/windows-2008R2-amd64/postinstall.sh +1 -1
  134. data/validation/features/steps/ssh_steps.rb +1 -1
  135. data/validation/vagrant.feature +35 -35
  136. data/veewee.gemspec +6 -6
  137. metadata +109 -103
@@ -0,0 +1,33 @@
1
+ #!/bin/sh
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
6
+
7
+ yum -y install \
8
+ ruby \
9
+ ruby-devel \
10
+ puppet \
11
+ rubygems \
12
+ rubygem-erubis \
13
+ rubygem-highline \
14
+ rubygem-json \
15
+ rubygem-mime-types \
16
+ rubygem-net-ssh \
17
+ rubygem-polyglot \
18
+ rubygem-rest-client \
19
+ rubygem-treetop \
20
+ rubygem-uuidtools
21
+
22
+ cd /tmp
23
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
24
+ mount -o loop,ro VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
25
+ sh /mnt/VBoxLinuxAdditions.run
26
+ umount /mnt
27
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
28
+
29
+ gem install chef --no-rdoc --no-ri
30
+
31
+ exit
32
+
33
+ # EOF
@@ -0,0 +1,17 @@
1
+ Veewee::Session.declare({
2
+ # Minimum RAM requirement for installation is 640MB.
3
+ :cpu_count => '1', :memory_size=> '640',
4
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :hwvirtext => 'on',
5
+ :os_type_id => 'Fedora_64',
6
+ :iso_file => "Fedora-15-x86_64-DVD.iso",
7
+ :iso_src => "http://download.fedoraproject.org/pub/fedora/linux/releases/15/Fedora/x86_64/iso/Fedora-15-x86_64-DVD.iso",
8
+ :iso_md5 => "c122a2a4f478da4a3d2d12396e84244e",
9
+ :iso_download_timeout => 1000,
10
+ :boot_wait => "10", :boot_cmd_sequence => [ '<Tab> linux text ks=http://%IP%:%PORT%/ks.cfg<Enter><Enter>' ],
11
+ :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
12
+ :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
13
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
14
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
15
+ :shutdown_cmd => "/sbin/halt -h -p",
16
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000
17
+ })
@@ -0,0 +1,64 @@
1
+ # Kickstart file automatically generated by anaconda.
2
+
3
+ install
4
+ cdrom
5
+ lang en_US.UTF-8
6
+ keyboard us
7
+ network --onboot yes --device p2p1 --bootproto dhcp --noipv6
8
+ timezone --utc America/Los_Angeles
9
+ rootpw --iscrypted $6$n/NGsk5H2aiBMXL4$r/oPkJtB5rasvQHPo9AvIJBe6sNVlQbpZxvTRMN7.qZk/Sn9u2qZ0XgNxflUvK20y7OIWdr/vv7MED6gzkBiH0
10
+ selinux --enforcing
11
+ authconfig --enableshadow --passalgo=sha512
12
+ firewall --service=ssh
13
+ # The following is the partition information you requested
14
+ # Note that any partitions you deleted are not expressed
15
+ # here so unless you clear all partitions first, this is
16
+ # not guaranteed to work
17
+ clearpart --all --drives=sda --initlabel
18
+
19
+ part /boot --fstype=ext4 --size=500
20
+ part pv.2 --grow --size=500
21
+
22
+ volgroup vg_vagrant --pesize=32768 pv.2
23
+ logvol / --fstype=ext4 --name=lv_root --vgname=vg_vagrant --size=1024 --grow
24
+ logvol swap --fstype=swap --name=lv_swap --vgname=vg_vagrant --size=528 --grow --maxsize=1056
25
+ bootloader --location=mbr --driveorder=sda --append="norhgb"
26
+ # Disable remote repositories, as this is a non-netinst install.
27
+ #repo --name="Fedora 15 - x86_64" --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-15&arch=x86_64 --cost=1000
28
+ #repo --name="Fedora 15 - x86_64 - Updates" --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f15&arch=x86_64 --cost=1000
29
+ services --enabled network
30
+ reboot
31
+
32
+ %packages
33
+ @core
34
+ @online-docs
35
+
36
+ # Requirements for vagrant
37
+ kernel-devel
38
+ kernel-headers
39
+ make
40
+ gcc
41
+ %end
42
+
43
+ %post
44
+ # Make ssh quicker in disconnected situations.
45
+ echo 'UseDNS no' >> /etc/ssh/sshd_config
46
+
47
+ # Add Vagrant user and group.
48
+ /usr/sbin/groupadd vagrant
49
+ /usr/sbin/useradd vagrant -g vagrant
50
+ echo "vagrant"|passwd --stdin vagrant
51
+
52
+ # Give Vagrant user permission to sudo.
53
+ echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant
54
+ echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant
55
+ chmod 440 /etc/sudoers.d/vagrant
56
+
57
+ # Install vagrant authorized ssh key.
58
+ mkdir /home/vagrant/.ssh
59
+ curl -L 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' > /home/vagrant/.ssh/authorized_keys
60
+ chown vagrant:vagrant -R /home/vagrant/.ssh
61
+ chmod 700 /home/vagrant/.ssh
62
+ chmod 600 /home/vagrant/.ssh/authorized_keys
63
+ chcon -R unconfined_u:object_r:user_home_t:s0 /home/vagrant/.ssh
64
+ %end
@@ -0,0 +1,33 @@
1
+ #!/bin/sh
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
6
+
7
+ yum -y install \
8
+ ruby \
9
+ ruby-devel \
10
+ puppet \
11
+ rubygems \
12
+ rubygem-erubis \
13
+ rubygem-highline \
14
+ rubygem-json \
15
+ rubygem-mime-types \
16
+ rubygem-net-ssh \
17
+ rubygem-polyglot \
18
+ rubygem-rest-client \
19
+ rubygem-treetop \
20
+ rubygem-uuidtools
21
+
22
+ cd /tmp
23
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
24
+ mount -o loop,ro VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
25
+ sh /mnt/VBoxLinuxAdditions.run
26
+ umount /mnt
27
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
28
+
29
+ gem install chef --no-rdoc --no-ri
30
+
31
+ exit
32
+
33
+ # EOF
@@ -0,0 +1,28 @@
1
+ # Archlinux AIF config file
2
+ # created by Dave Simons
3
+ # 21/09/2011
4
+
5
+ # install source
6
+ SOURCE=net
7
+ if [ -d /repo/core ]; then
8
+ TARGET_REPOSITORIES=(core 'file:///repo/$repo/$arch')
9
+ else
10
+ MIRROR='http://archlinux.mirror.kangaroot.net/$repo/os/$arch'
11
+ TARGET_REPOSITORIES=(core $var_MIRRORLIST extra $var_MIRRORLIST)
12
+ fi
13
+
14
+ # time/date
15
+ HARDWARECLOCK=localtime
16
+ TIMEZONE=Europe/Brussels
17
+
18
+ # packages to install
19
+ TARGET_GROUPS=base
20
+ TARGET_PACKAGES='sudo openssh vim ruby linux-headers make gcc glibc git perl net-tools'
21
+ TARGET_PACKAGES_EXCLUDE='nano emacs wpa_supplicant xfsprogs reiserfsprogs pcmciautils mdadm jfsutils cryptsetup lvm2'
22
+
23
+ # hard drive setup
24
+ GRUB_DEVICE='/dev/sda'
25
+ PARTITIONS='/dev/sda 100:ext2:+ 512:swap *:ext4'
26
+ BLOCKDATA='/dev/sda1 raw no_label ext2;yes;/boot;target;no_opts;no_label;no_params
27
+ /dev/sda2 raw no_label swap;yes;no_mountpoint;target;no_opts;no_label;no_params
28
+ /dev/sda3 raw no_label ext4;yes;/;target;no_opts;no_label;no_params'
@@ -0,0 +1,26 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1', :memory_size=> '256',
3
+ :disk_size => '10140', :disk_format => 'VDI',:hostiocache => 'off',
4
+ :os_type_id => 'ArchLinux',
5
+ :iso_file => "archlinux-2011.08.19-netinstall-i686.iso",
6
+ :iso_src => "http://archlinux.mirror.kangaroot.net/iso/2011.08.19/archlinux-2011.08.19-netinstall-i686.iso",
7
+ :iso_md5 => "c3f7e10d040eac1da0efe68fb2f64d5b",
8
+ :iso_download_timeout => "1000",
9
+ :boot_wait => "5", :boot_cmd_sequence => [
10
+ '<Enter>',
11
+ '<Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait>',
12
+ '<Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait>',
13
+ 'dhcpcd eth0<Enter><Wait><Wait><Wait><Wait>',
14
+ 'passwd<Enter>',
15
+ 'vagrant<Enter>',
16
+ 'vagrant<Enter>',
17
+ '/etc/rc.d/sshd start<Enter><Wait>',
18
+ 'sleep 3 && wget 10.0.2.2:7122/aif.cfg<Enter>',
19
+ ],
20
+ :kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "aif.cfg",
21
+ :ssh_login_timeout => "10000", :ssh_user => "root", :ssh_password => "vagrant", :ssh_key => "",
22
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
23
+ :sudo_cmd => "sh '%f'",
24
+ :shutdown_cmd => "shutdown -h now",
25
+ :postinstall_files => [ "postinstall.sh", "postinstall2.sh"], :postinstall_timeout => "10000"
26
+ })
@@ -0,0 +1,75 @@
1
+ #!/bin/bash
2
+
3
+ # var to determine package source
4
+ PKGSRC=net
5
+
6
+ date > /etc/vagrant_box_build_time
7
+
8
+ # launch automated install
9
+ su -c 'aif -p automatic -c aif.cfg'
10
+
11
+ # copy over the vbox version file
12
+ /bin/cp -f /root/.vbox_version /mnt/root/.vbox_version
13
+
14
+ # chroot into the new system
15
+ mount -o bind /dev /mnt/dev
16
+ mount -o bind /sys /mnt/sys
17
+ mount -t proc none /mnt/proc
18
+ chroot /mnt <<ENDCHROOT
19
+
20
+ # make sure network is up and a nameserver is available
21
+ dhcpcd eth0
22
+
23
+ # sudo setup
24
+ # note: do not use tabs here, it autocompletes and borks the sudoers file
25
+ cat <<EOF > /etc/sudoers
26
+ root ALL=(ALL) ALL
27
+ %wheel ALL=(ALL) NOPASSWD: ALL
28
+ EOF
29
+
30
+ # set up user accounts
31
+ passwd<<EOF
32
+ vagrant
33
+ vagrant
34
+ EOF
35
+ useradd -m -G wheel -r vagrant
36
+ passwd -d vagrant
37
+ passwd vagrant<<EOF
38
+ vagrant
39
+ vagrant
40
+ EOF
41
+
42
+ # create puppet group
43
+ groupadd puppet
44
+
45
+ # make sure sshd starts
46
+ sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 sshd):' /etc/rc.conf
47
+
48
+ # install mitchellh's ssh key
49
+ mkdir /home/vagrant/.ssh
50
+ chmod 700 /home/vagrant/.ssh
51
+ wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
52
+ chmod 600 /home/vagrant/.ssh/authorized_keys
53
+ chown -R vagrant /home/vagrant/.ssh
54
+
55
+ # choose a mirror
56
+ sed -i 's/^#\(.*leaseweb.*\)/\1/' /etc/pacman.d/mirrorlist
57
+
58
+ # install some packages
59
+ gem install --no-ri --no-rdoc chef facter
60
+ cd /tmp
61
+ git clone https://github.com/puppetlabs/puppet.git
62
+ cd puppet
63
+ ruby install.rb --bindir=/usr/bin --sbindir=/sbin 2>/dev/null
64
+
65
+ # set up networking
66
+ [[ $PKGSRC == 'net' ]] && sed -i 's/^\(interface=*\)/\1eth0/' /etc/rc.conf
67
+
68
+ # leave the chroot
69
+ ENDCHROOT
70
+
71
+ # take down network to prevent next postinstall.sh from starting too soon
72
+ /etc/rc.d/network stop
73
+
74
+ # and reboot!
75
+ reboot
@@ -0,0 +1,30 @@
1
+ # install virtualbox guest additions
2
+ VBOX_VERSION=$(cat /root/.vbox_version)
3
+ cd /tmp
4
+ wget http://download.virtualbox.org/virtualbox/"$VBOX_VERSION"/VBoxGuestAdditions_"$VBOX_VERSION".iso
5
+ mount -o loop VBoxGuestAdditions_"$VBOX_VERSION".iso /mnt
6
+ sh /mnt/VBoxLinuxAdditions.run
7
+ umount /mnt
8
+ rm VBoxGuestAdditions_"$VBOX_VERSION".iso
9
+
10
+ # host-only networking
11
+ cat >> /etc/rc.local <<EOF
12
+ # enable DHCP at boot on eth0
13
+ # See https://wiki.archlinux.org/index.php/Network#DHCP_fails_at_boot
14
+ dhcpcd -k eth0
15
+ dhcpcd -nd eth0
16
+ EOF
17
+
18
+ # clean out pacman cache
19
+ pacman -Scc<<EOF
20
+ y
21
+ y
22
+ EOF
23
+
24
+ # zero out the fs
25
+ dd if=/dev/zero of=/clean bs=4M|| rm /clean
26
+ dd if=/dev/zero of=/tmp/clean bs=4M|| rm /tmp/clean
27
+ dd if=/dev/zero of=/boot/clean bs=4M|| rm /boot/clean
28
+
29
+ # and the final reboot!
30
+ #reboot
@@ -37,6 +37,9 @@ vagrant
37
37
  vagrant
38
38
  EOF
39
39
 
40
+ # create puppet group
41
+ groupadd puppet
42
+
40
43
  # make sure ssh is allowed
41
44
  echo "sshd: ALL" > /etc/hosts.allow
42
45
 
@@ -49,7 +52,7 @@ sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 sshd):' /etc/rc.conf
49
52
  # install mitchellh's ssh key
50
53
  mkdir /home/vagrant/.ssh
51
54
  chmod 700 /home/vagrant/.ssh
52
- wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
55
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
53
56
  chmod 600 /home/vagrant/.ssh/authorized_keys
54
57
  chown -R vagrant /home/vagrant/.ssh
55
58
 
@@ -80,6 +83,14 @@ sh /mnt/VBoxLinuxAdditions.run
80
83
  umount /mnt
81
84
  rm VBoxGuestAdditions_"$VBOX_VERSION".iso
82
85
 
86
+ # host-only networking
87
+ cat <<EOF
88
+ # enable DHCP at boot on eth0
89
+ # See https://wiki.archlinux.org/index.php/Network#DHCP_fails_at_boot
90
+ dhcpcd -k eth0
91
+ dhcpcd -nd eth0
92
+ EOF >> /etc/rc.local
93
+
83
94
  # clean out pacman cache
84
95
  pacman -Scc<<EOF
85
96
  y
@@ -0,0 +1,28 @@
1
+ # Archlinux AIF config file
2
+ # created by Dave Simons
3
+ # 21/09/2011
4
+
5
+ # install source
6
+ SOURCE=net
7
+ if [ -d /repo/core ]; then
8
+ TARGET_REPOSITORIES=(core 'file:///repo/$repo/$arch')
9
+ else
10
+ MIRROR='http://archlinux.mirror.kangaroot.net/$repo/os/$arch'
11
+ TARGET_REPOSITORIES=(core $var_MIRRORLIST extra $var_MIRRORLIST)
12
+ fi
13
+
14
+ # time/date
15
+ HARDWARECLOCK=localtime
16
+ TIMEZONE=Europe/Brussels
17
+
18
+ # packages to install
19
+ TARGET_GROUPS=base
20
+ TARGET_PACKAGES='sudo openssh vim ruby linux-headers make gcc glibc git perl net-tools'
21
+ TARGET_PACKAGES_EXCLUDE='nano emacs wpa_supplicant xfsprogs reiserfsprogs pcmciautils mdadm jfsutils cryptsetup lvm2'
22
+
23
+ # hard drive setup
24
+ GRUB_DEVICE='/dev/sda'
25
+ PARTITIONS='/dev/sda 100:ext2:+ 512:swap *:ext4'
26
+ BLOCKDATA='/dev/sda1 raw no_label ext2;yes;/boot;target;no_opts;no_label;no_params
27
+ /dev/sda2 raw no_label swap;yes;no_mountpoint;target;no_opts;no_label;no_params
28
+ /dev/sda3 raw no_label ext4;yes;/;target;no_opts;no_label;no_params'
@@ -0,0 +1,26 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1', :memory_size=> '256',
3
+ :disk_size => '10140', :disk_format => 'VDI',:hostiocache => 'off',
4
+ :os_type_id => 'ArchLinux_64',
5
+ :iso_file => "archlinux-2011.08.19-netinstall-x86_64.iso",
6
+ :iso_src => "http://archlinux.mirror.kangaroot.net/iso/2011.08.19/archlinux-2011.08.19-netinstall-x86_64.iso",
7
+ :iso_md5 => "03a328dfd7a2f901995d77bcf645130c",
8
+ :iso_download_timeout => "1000",
9
+ :boot_wait => "5", :boot_cmd_sequence => [
10
+ '<Enter>',
11
+ '<Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait>',
12
+ '<Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait><Wait>',
13
+ 'dhcpcd eth0<Enter><Wait><Wait><Wait><Wait>',
14
+ 'passwd<Enter>',
15
+ 'vagrant<Enter>',
16
+ 'vagrant<Enter>',
17
+ '/etc/rc.d/sshd start<Enter><Wait>',
18
+ 'sleep 3 && wget 10.0.2.2:7122/aif.cfg<Enter>',
19
+ ],
20
+ :kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "aif.cfg",
21
+ :ssh_login_timeout => "10000", :ssh_user => "root", :ssh_password => "vagrant", :ssh_key => "",
22
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
23
+ :sudo_cmd => "sh '%f'",
24
+ :shutdown_cmd => "shutdown -h now",
25
+ :postinstall_files => [ "postinstall.sh", "postinstall2.sh"], :postinstall_timeout => "10000"
26
+ })
@@ -0,0 +1,75 @@
1
+ #!/bin/bash
2
+
3
+ # var to determine package source
4
+ PKGSRC=net
5
+
6
+ date > /etc/vagrant_box_build_time
7
+
8
+ # launch automated install
9
+ su -c 'aif -p automatic -c aif.cfg'
10
+
11
+ # copy over the vbox version file
12
+ /bin/cp -f /root/.vbox_version /mnt/root/.vbox_version
13
+
14
+ # chroot into the new system
15
+ mount -o bind /dev /mnt/dev
16
+ mount -o bind /sys /mnt/sys
17
+ mount -t proc none /mnt/proc
18
+ chroot /mnt <<ENDCHROOT
19
+
20
+ # make sure network is up and a nameserver is available
21
+ dhcpcd eth0
22
+
23
+ # sudo setup
24
+ # note: do not use tabs here, it autocompletes and borks the sudoers file
25
+ cat <<EOF > /etc/sudoers
26
+ root ALL=(ALL) ALL
27
+ %wheel ALL=(ALL) NOPASSWD: ALL
28
+ EOF
29
+
30
+ # set up user accounts
31
+ passwd<<EOF
32
+ vagrant
33
+ vagrant
34
+ EOF
35
+ useradd -m -G wheel -r vagrant
36
+ passwd -d vagrant
37
+ passwd vagrant<<EOF
38
+ vagrant
39
+ vagrant
40
+ EOF
41
+
42
+ # create puppet group
43
+ groupadd puppet
44
+
45
+ # make sure sshd starts
46
+ sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 sshd):' /etc/rc.conf
47
+
48
+ # install mitchellh's ssh key
49
+ mkdir /home/vagrant/.ssh
50
+ chmod 700 /home/vagrant/.ssh
51
+ wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
52
+ chmod 600 /home/vagrant/.ssh/authorized_keys
53
+ chown -R vagrant /home/vagrant/.ssh
54
+
55
+ # choose a mirror
56
+ sed -i 's/^#\(.*leaseweb.*\)/\1/' /etc/pacman.d/mirrorlist
57
+
58
+ # install some packages
59
+ gem install --no-ri --no-rdoc chef facter
60
+ cd /tmp
61
+ git clone https://github.com/puppetlabs/puppet.git
62
+ cd puppet
63
+ ruby install.rb --bindir=/usr/bin --sbindir=/sbin 2>/dev/null
64
+
65
+ # set up networking
66
+ [[ $PKGSRC == 'net' ]] && sed -i 's/^\(interface=*\)/\1eth0/' /etc/rc.conf
67
+
68
+ # leave the chroot
69
+ ENDCHROOT
70
+
71
+ # take down network to prevent next postinstall.sh from starting too soon
72
+ /etc/rc.d/network stop
73
+
74
+ # and reboot!
75
+ reboot