diff --git a/.bundle/config b/.bundle/config index 6c52d9a9..947c4035 100644 --- a/.bundle/config +++ b/.bundle/config @@ -1,2 +1,2 @@ ---- -BUNDLE_WITHOUT: kvm +--- +BUNDLE_WITHOUT: "kvm" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..019b07c5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +#ensures shell scripts aren't broken when checking out on Windows (see issue #805) +*.sh eol=lf diff --git a/.gitignore b/.gitignore index 91103bf4..6c2bd008 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,5 @@ pkg/* virtualfloppy.vfd *.swp AutoPartition.app -.ruby-version -.rbenv-gemsets +.rvmrc .project -.ruby-version diff --git a/.ruby-gemset b/.ruby-gemset new file mode 100644 index 00000000..35948590 --- /dev/null +++ b/.ruby-gemset @@ -0,0 +1 @@ +veewee diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..58f65ad5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-2.2.1 diff --git a/.rvmrc b/.rvmrc deleted file mode 100755 index 4aa1deed..00000000 --- a/.rvmrc +++ /dev/null @@ -1,6 +0,0 @@ -rvm use ruby-1.9.3@veewee --create -#rvm use ruby-1.8.7@veewee --create - -alias veewee="bundle exec veewee" -alias irb="bundle exec irb" -#alias vagrant="bundle exec vagrant" diff --git a/.travis.yml b/.travis.yml index 18d9cea7..817f6ea3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ language: ruby rvm: - - 1.9.2 - - 1.9.2-p320 - 1.9.3 - 2.0 + - 2.1 +sudo: false +cache: bundler +before_script: + - rvm rubygems latest + - gem update bundler notifications: irc: "chat.freenode.net#veewee" diff --git a/Gemfile b/Gemfile index 40c025b1..b2250271 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ #Encoding.default_internal = Encoding::UTF_8 #end -source "http://rubygems.org" +source "https://rubygems.org" #gem "veewee", :path => "." #gem "fission", :path => '/Users/patrick/dev/fission' @@ -13,7 +13,7 @@ group :kvm do end group :windows do - gem "em-winrm", :git => 'https://github.com/hh/em-winrm.git', :ref => '31745601d3' + gem "em-winrm" gem "log4r" end diff --git a/doc/basics.md b/doc/basics.md index b5f86850..3bdd2860 100644 --- a/doc/basics.md +++ b/doc/basics.md @@ -14,8 +14,8 @@ Each template folder name follows a naming scheme to help you choosing the right For example, the template for a Ubuntu 12.10 server (i386) basebox looks like this: ubuntu-12.10-server-i386[-netboot] - ^ ^ ^ ^ - | | | +----- install flavor + ^ ^ ^ ^ + | | | +----- install flavor | | +----- architecture | +----- version +----- OS name @@ -62,6 +62,17 @@ Veewee provides templates for a lot of different operation systems. To see all t Templates have the same structure as definitions, but templates are used to generate definitions. Definitions are simply **your** customizable templates that you can modify as you see fit. +### Template sources + +Veewee will detect all gems with `veewee-templates` gemspec `metadata` pointing to templates directory: + +```ruby + spec.metadata = { + "veewee-templates" => "templates" + } +``` + +For example see [veewee.gemspec](../veewee.gemspec). ## Create a definition @@ -97,9 +108,9 @@ Or you can remove the folder under `definitions`: ## Manage ISO files -The distro ISOs (also called *disk images*) provide all files needed to install the OS. This file is essential for starting the installation process. +The distro ISOs (also called *disk images*) provide all files needed to install the OS. This file is essential for starting the installation process. -If you already have an `.iso` file for the desired distribution on your disk, put it inside the `iso/` directory and make sure `definition.rb` is referencing the correct file. +If you already have an `.iso` file for the desired distribution on your disk, put it inside the `iso/` directory and make sure `definition.rb` is referencing the correct file. If an expected ISO is not found in the `iso/` directory, Veewee will ask you to download the ISO file from the web. Depending on your internet connection fetching an ISO file can take a while. @@ -113,7 +124,7 @@ In order to build the defined box, execute this subcommand: The `build` subcommand can take the following optional flags: Flag Option | Description ---------------------------------|------------- +--------------------------------|------------- -f --force | overwrites if already exists -a --auto | automatically downloads the ISO without asking -n --nogui | builds in the background rather than opening a VM GUI and building in the GUI window @@ -133,7 +144,7 @@ The `build` subcommand will run the following routines behind the scenes: * Mount the ISO file `:iso_file` * Boot up the machine and wait for `:boot_time` * Send the keystrokes in `:boot_cmd_sequence` -* Start up a webserver on `:kickstart_port` to wait for a request from the `:kickstart_file` +* Start up a webserver on `:kickstart_port` to wait `:kickstart_timeout` for a request for the `:kickstart_file` IMPORTANT: Do NOT navigate to the file in your browser or the server will stop and the installer will not be able to find your preseed * Wait for ssh login to work with `:ssh_user` and `:ssh_password` * `sudo` execute the `:postinstall_files` @@ -198,7 +209,7 @@ Validation is highly recommended before requesting a fork pull on any modified t Finally let's export the box so it can be distributed or used by Vagrant: - $ bundle exec veewee vbox export 'myubuntubox' + $ bundle exec veewee vbox export 'myubuntubox' ## Up Next diff --git a/doc/build_hooks.md b/doc/build_hooks.md index 7a9d84dd..3f27626d 100644 --- a/doc/build_hooks.md +++ b/doc/build_hooks.md @@ -25,7 +25,7 @@ But if you want to copy arbitrary files to the guest you can do this in a hook.
Veewee::Definition.declare({ - hooks => { + :hooks => { :after_postinstall => Proc.new { definition.box.scp('/tmp/foo.txt', '/tmp/bar.txt') } } }) @@ -58,7 +58,7 @@ end myhooks = Hooks.new(veewee_definition) Veewee::Definition.declare({ - hooks => { + :hooks => { :after_boot_sequence => Proc.new { myhooks.after_boot_sequence }, :before_ssh => Proc.new { myhooks.before_ssh } } diff --git a/doc/customize.md b/doc/customize.md index aa8c4723..6bf05cd5 100644 --- a/doc/customize.md +++ b/doc/customize.md @@ -92,7 +92,7 @@ All other settings are used internally by Veewee, the virtualization provider, o 'initrd=/install/initrd.gz --' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "60", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -128,7 +128,6 @@ Definition Option | Default | Provider :boot_wait | uninitialised | core :boot_cmd_sequence | empty | core :kickstart_port | uninitialised | core -:kickstart_ip | uninitialised | core :kickstart_timeout | uninitialised | core :kickstart_file | uninitialised | core :ssh_login_timeout | uninitialised | kvm, parallels, virtualbox, vmfusion @@ -192,6 +191,42 @@ Each provider _can_ take options that are specific the provider; more details wi This box will have `pae` and `ioapic` enabled with VirtualBox, and will use the `brlxc0` bridge with KVM (on libvirt). +## Using Yaml for storing configuration + +You can store definitions in `*.yml` files, loading them is as easy as: + + Veewee::Definition.declare_yaml(filename1, filename2 ...) + +For example given those 3 files: + + . + ├── definitions + │ └── myubuntubox + │ ├── definition.rb + │ ├── definition.yml + │ ├── 64bit.yml + │ ├── 32bit.yml + │ └── ... + +And `definition.rb` with + + Veewee::Definition.declare_yaml('definition.yml', '64bit.yml') + +Then veewee will read first `definition.yml` and `64bit.yml`, this way +it is possible to mix multiple possible combinations of systems, +versions, and architectures. All the configurations available in +`declare` are also valid in `*yml` files. + +You can also mix options with file names like: + + Veewee::Definition.declare_yaml( + {:cpu_count => '1'}, + filename1, + {:ssh_user => 'vagrant'}, + filename2, + ... + ) + ## Up Next diff --git a/doc/installation.md b/doc/installation.md index 0ad1f8ff..92c01e8f 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -1,6 +1,8 @@ # Veewee Installation Before installing Veewee, please see the [Requirements](requirements.md) doc. +Currently supported versions of ruby: `1.9.3` to `2.2.1` +##### IMPORTANT: For best results, please use the latest version of Ruby. ## Install as a gem @@ -33,7 +35,7 @@ Installing Veewee without a Ruby version manager is **NOT** recommended: With RVM already installed (see [Requirements](requirements.md)), ensure a ruby version that's supported by Veewee is available on your machine: - $ rvm install 1.9.2 + $ rvm install ruby Clone the veewee project from source: @@ -43,7 +45,7 @@ Clone the veewee project from source: Set the local gemset and ruby version within the current directory: - $ rvm use 1.9.2@veewee --create + $ rvm use ruby@veewee --create Run `bundle install` to install Gemfile dependencies for our local gemset: @@ -55,7 +57,7 @@ Run `bundle install` to install Gemfile dependencies for our local gemset: With rbenv already installed (see [Requirements](requirements.md)), ensure a ruby version that's supported by Veewee is available on your machine: - $ rbenv install 1.9.2-p320 + $ rbenv install 2.2.1 $ rbenv rehash Clone the veewee project from source: @@ -66,7 +68,7 @@ Clone the veewee project from source: Set the local ruby version within the current directory: - $ rbenv local 1.9.2-p320 + $ rbenv local 2.2.1 $ rbenv rehash Run `bundle install` to install Gemfile dependencies for our selected ruby version: diff --git a/doc/requirements.md b/doc/requirements.md index c9bbb091..36b7d058 100644 --- a/doc/requirements.md +++ b/doc/requirements.md @@ -43,12 +43,15 @@ On Windows, you will need to install: It is highly recommended that you use either `rvm` or `rbenv` to manage your ruby versions. +Veewee currently supports Ruby version `1.9.3` to `2.2.1` +IMPORTANT : For best results, please use the latest version of Ruby. + ### Option 1: RVM [RVM](https://rvm.io/) is Veewee's prefered ruby version manager. -RVM will allow Veewee to install it's own [gemset](https://rvm.io/gemsets/basics/) and configure it's own ruby version - which keeps Veewee and it's dependancies completely separate from your other projects. Please see https://rvm.io/gemsets/basics/ for details if you are new to the concept of 'gemsets'. +RVM will allow Veewee to install its own [gemset](https://rvm.io/gemsets/basics/) and configure its own ruby version - which keeps Veewee and its dependancies completely separate from your other projects. Please see https://rvm.io/gemsets/basics/ for details if you are new to the concept of 'gemsets'. ##### Installing RVM diff --git a/lib/fission.rb b/lib/fission.rb index 24a9acdb..9d48332d 100644 --- a/lib/fission.rb +++ b/lib/fission.rb @@ -5,12 +5,26 @@ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib]) -#require 'fission/error' +require 'fission/action/shell_executor' +require 'fission/action/snapshot/creator' +require 'fission/action/snapshot/deleter' +require 'fission/action/snapshot/lister' +require 'fission/action/snapshot/reverter' +require 'fission/action/vm/cloner' +require 'fission/action/vm/deleter' +require 'fission/action/vm/lister' +require 'fission/action/vm/starter' +require 'fission/action/vm/stopper' +require 'fission/action/vm/suspender' require 'fission/cli' require 'fission/command' require 'fission/command_helpers' +require 'fission/command_line_parser' require 'fission/command/clone' +require 'fission/command/delete' +require 'fission/command/info' require 'fission/command/snapshot_create' +require 'fission/command/snapshot_delete' require 'fission/command/snapshot_list' require 'fission/command/snapshot_revert' require 'fission/command/start' @@ -27,6 +41,7 @@ require 'fission/response' require 'fission/ui' require 'fission/vm' +require 'fission/vm_configuration' require 'fission/version' module Fission diff --git a/lib/fission/config.rb b/lib/fission/config.rb index 096a720a..ef133ee9 100644 --- a/lib/fission/config.rb +++ b/lib/fission/config.rb @@ -24,23 +24,23 @@ def initialize fusion_version = :unknown - if File.exists?("/Library/Application Support/VMware Fusion/vmrun") - @attributes['vmrun_bin'] = '/Library/Application Support/VMware Fusion/vmrun' - end - - if File.exists?("/Applications/VMware Fusion.app/Contents/Library/vmrun") - @attributes['vmrun_bin'] = "/Applications/VMware Fusion.app/Contents/Library/vmrun" - end + @attributes['vmrun_bin'] = [ + '/Library/Application Support/VMware Fusion/vmrun', + '/Applications/VMware Fusion.app/Contents/Library/vmrun', + '/usr/local/bin/vmrun' + ].find { |path| File.exists?(path) } if fusion_version == :unknown end @attributes['plist_file'] = File.expand_path('~/Library/Preferences/com.vmware.fusion.plist') - @attributes['gui_bin'] = File.expand_path('/Applications/VMware Fusion.app/Contents/MacOS/vmware') + @attributes['gui_bin'] = '/Applications/VMware Fusion.app/Contents/MacOS/vmware' load_from_file + @attributes['vmrun_cmd'] = "#{@attributes['vmrun_bin'].gsub(' ', '\ ')} -T fusion" + @attributes['gui_bin'] = File.expand_path(@attributes['gui_bin']) end # Public: Helper method to access config atributes. This is a shortcut for diff --git a/lib/veewee/command/group_base.rb b/lib/veewee/command/group_base.rb index 2911d1b4..a8095622 100644 --- a/lib/veewee/command/group_base.rb +++ b/lib/veewee/command/group_base.rb @@ -92,9 +92,9 @@ class GroupBase < Thor # def self.register(options = {}) # self refers to the class object of the provider subclass - self.class_variable_set(:@@command, options[:command]) - self.class_variable_set(:@@description, options[:description]) - self.class_variable_set(:@@provider, options[:provider]) + self.send(:class_variable_set, :@@command, options[:command] ) + self.send(:class_variable_set, :@@description, options[:description]) + self.send(:class_variable_set, :@@provider, options[:provider] ) CLI.register(self, options[:command], options[:command], options[:description], options[:opts]) end diff --git a/lib/veewee/command/helpers.rb b/lib/veewee/command/helpers.rb index 2d0ccdc9..2d5d20d8 100644 --- a/lib/veewee/command/helpers.rb +++ b/lib/veewee/command/helpers.rb @@ -6,8 +6,9 @@ module Helpers def initialize_environment(args, options, config) raise Errors::CLIMissingEnvironment if !config[:env] @env = config[:env] + @env.cwd = File.expand_path(@options[:cwd]) if @options[:cwd] end end end -end \ No newline at end of file +end diff --git a/lib/veewee/config/ostypes.yml b/lib/veewee/config/ostypes.yml index 9a4e7292..6c0493f8 100644 --- a/lib/veewee/config/ostypes.yml +++ b/lib/veewee/config/ostypes.yml @@ -10,22 +10,22 @@ Windows7: :vbox: Windows7 :parallels: win-7 Windows8: - :fusion: + :fusion: windows8 :kvm: :vbox: Windows8 :parallels: win-8 Windows8_64: - :fusion: + :fusion: windows8-64 :kvm: :vbox: Windows8_64 :parallels: win-8 Windows81: - :fusion: + :fusion: windows8 :kvm: :vbox: Windows81 :parallels: win-8 Windows81_64: - :fusion: + :fusion: windows8-64 :kvm: :vbox: Windows81_64 :parallels: win-8 @@ -348,22 +348,22 @@ NetBSD_64: :vbox: NetBSD_64 :parallels: other ESXi5: - :fusion: vmkernel5 + :fusion: vmkernel5 :kvm: - :vbox: - :parallels: + :vbox: + :parallels: Darwin_10_7: :fusion: darwin11 :kvm: - :vbox: + :vbox: MacOS :parallels: Darwin_10_7_64: :fusion: darwin11-64 :kvm: - :vbox: + :vbox: MacOS_64 :parallels: Darwin_10_8_64: :fusion: darwin12-64 :kvm: - :vbox: + :vbox: MacOS_64 :parallels: diff --git a/lib/veewee/definition.rb b/lib/veewee/definition.rb index 3986b634..0b2272e1 100644 --- a/lib/veewee/definition.rb +++ b/lib/veewee/definition.rb @@ -1,3 +1,4 @@ +require 'yaml' require 'ostruct' require 'veewee/provider/core/helper/iso' @@ -20,7 +21,7 @@ class Definition attr_accessor :boot_wait, :boot_cmd_sequence - attr_accessor :kickstart_port, :kickstart_ip, :kickstart_timeout, :kickstart_file + attr_accessor :kickstart_port, :kickstart_timeout, :kickstart_file attr_accessor :ssh_login_timeout, :ssh_user, :ssh_password, :ssh_key, :ssh_host_port, :ssh_guest_port @@ -91,7 +92,7 @@ def initialize(name, path, env) # :hostiocache => 'off' , # :os_type_id => 'Ubuntu', # :boot_wait => "10", :boot_cmd_sequence => [ "boot"], - # :kickstart_port => "7122", :kickstart_ip => "127.0.0.1", :kickstart_timeout => 10000,# + # :kickstart_port => "7122", :kickstart_timeout => 60,# # :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "", @ssh_host_port = "2222" ; @ssh_guest_port = "22" # :ssh_host_port => "2222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", @@ -124,6 +125,18 @@ def declare(options) end + def declare_yaml(*files) + files.each do |file| + if Hash === file + env.logger.info("Reading hash options") + else + env.logger.info("Reading yaml file: #{file}") + file = YAML.load_file(file) + end + declare(file) + end + end + # Class method to loading a definition def self.load(name, env) diff --git a/lib/veewee/environment.rb b/lib/veewee/environment.rb index 8059028f..cc376fc2 100644 --- a/lib/veewee/environment.rb +++ b/lib/veewee/environment.rb @@ -26,10 +26,10 @@ class Environment # - :validation_dir : directory that contains a list of validation tests, that can be run after building a box # - :tmp_dir : directory that will be used for creating temporary files, needs to be rewritable, default to $environment_dir/tmp attr_accessor :template_path - attr_accessor :definition_dir - attr_accessor :iso_dir + attr_writer :definition_dir + attr_writer :iso_dir attr_accessor :validation_dir - attr_accessor :tmp_dir + attr_writer :tmp_dir # The {UI} Object to communicate with the outside world attr_writer :ui @@ -66,11 +66,8 @@ def initialize(options = {}) defaults = { :cwd => cwd, :veewee_filename => "Veeweefile", - :definition_dir => File.join(cwd, "definitions"), - :template_path => [File.expand_path(File.join(File.dirname(__FILE__), "..", "..", 'templates')), "templates"], - :iso_dir => File.join(cwd, "iso"), + :template_path => ["templates"], :validation_dir => File.join(File.expand_path(File.join(File.dirname(__FILE__), "..", "..")), "validation"), - :tmp_dir => File.join(cwd, "tmp") } options = defaults.merge(options) @@ -107,6 +104,16 @@ def initialize(options = {}) return self end + def definition_dir + @definition_dir ||= File.join(cwd, "definitions") + end + def iso_dir + @iso_dir ||= File.join(cwd, "iso") + end + def tmp_dir + tmp_dir ||= File.join(cwd, "tmp") + end + def self.workdir ENV['VEEWEE_DIR'] || Dir.pwd end diff --git a/lib/veewee/provider/core/box/build.rb b/lib/veewee/provider/core/box/build.rb index 31125d43..a0dfc991 100644 --- a/lib/veewee/provider/core/box/build.rb +++ b/lib/veewee/provider/core/box/build.rb @@ -1,3 +1,5 @@ +require 'to_slug' + module Veewee module Provider module Core @@ -70,10 +72,12 @@ def kickstart(options) }) # Type the boot sequence + t = Thread.new do self.console_type(boot_sequence) run_hook(:after_boot_sequence) end + t.abort_on_exception = true self.handle_kickstart(options) end @@ -219,31 +223,30 @@ def build_info # It requires a definition to find all the necessary information def handle_kickstart(options) - # Handling the kickstart by web - kickstartfiles=definition.kickstart_file + case definition.kickstart_file + when Array then kickstartfiles = definition.kickstart_file + when String then kickstartfiles = definition.kickstart_file.split + when nil then kickstartfiles = [] + else raise "Do not know how to handle kickstart_file: #{kickstart_file.inspect}" + end - if kickstartfiles.nil? || kickstartfiles.length == 0 + if kickstartfiles.empty? env.ui.info "Skipping webserver as no kickstartfile was specified" else - env.ui.info "Starting a webserver #{definition.kickstart_ip}:#{definition.kickstart_port}\n" - end - - # Check if the kickstart is an array or a single string - if kickstartfiles.is_a?(String) - # Let's turn it into an array - kickstartfiles=kickstartfiles.split + env.ui.info "Starting a webserver #{host_ip_as_seen_by_guest}:#{definition.kickstart_port}, check your firewall if nothing happens\n" + timeouts = Array(definition.kickstart_timeout).map(&:to_i) end # For each kickstart file spinup a webserver and wait for the file to be fetched - unless kickstartfiles.nil? - kickstartfiles.each do |kickfile| - wait_for_http_request(kickfile,{ + kickstartfiles.each_with_index do |kickfile, index| + wait_for_http_request( + File.join(definition.path, kickfile), + kickfile.start_with?('/') ? kickfile : '/' + kickfile, + { :port => definition.kickstart_port, - :host => definition.kickstart_ip, - :timeout => definition.kickstart_timeout, - :web_dir => definition.path - }) - end + :timeout => timeouts.fetch(index, timeouts.last), # get the matching kickfile timeout or the last defined + } + ) end end @@ -254,6 +257,12 @@ def handle_postinstall(options) definition.postinstall_files.each do |postinstall_file| # Filenames of postinstall_files are relative to their definition filename=File.join(definition.path,postinstall_file) + + if File.basename(postinstall_file).start_with?("_") + env.logger.info "Skipping copy of postinstallfile #{postinstall_file}" + next + end + self.copy_to_box(filename,File.basename(filename)) if not (definition.winrm_user && definition.winrm_password) self.exec("chmod +x \"#{File.basename(filename)}\"") diff --git a/lib/veewee/provider/core/box/copy.rb b/lib/veewee/provider/core/box/copy.rb index d09c440d..6b8595ec 100644 --- a/lib/veewee/provider/core/box/copy.rb +++ b/lib/veewee/provider/core/box/copy.rb @@ -5,8 +5,14 @@ module BoxCommand def copy_to_box(localfile,remotefile,options={}) raise Veewee::Error,"Box is not running" unless self.running? - if definition.winrm_user && definition.winrm_password # prefer winrm + if + definition.winrm_user && definition.winrm_password # prefer winrm + then self.wincp(localfile,remotefile,options) + elsif + definition.os_type_id =~ /^Windows/ + then + raise "Trying to transfer #{localfile} to windows machine without 'winrm_user' and 'winrm_password' set in definition." else self.scp(localfile,remotefile,options) end diff --git a/lib/veewee/provider/core/box/ssh.rb b/lib/veewee/provider/core/box/ssh.rb index 98b222f1..61821dac 100644 --- a/lib/veewee/provider/core/box/ssh.rb +++ b/lib/veewee/provider/core/box/ssh.rb @@ -1,11 +1,12 @@ require 'veewee/provider/core/helper/ssh' require 'shellwords' +require 'pathname' + module Veewee module Provider module Core module BoxCommand - def ssh(command=nil,options={}) raise Veewee::Error,"Box is not running" unless self.running? @@ -14,7 +15,7 @@ def ssh(command=nil,options={}) if (options[:interactive]==true) unless host_ip.nil? || host_ip=="" - ssh_command="ssh #{ssh_commandline_options(options)} #{host_ip} #{Shellwords.escape command}" + ssh_command="ssh #{ssh_commandline_options(options)} #{host_ip} #{Shellwords.escape(command) if command}" fg_exec(ssh_command,options) @@ -23,7 +24,8 @@ def ssh(command=nil,options={}) end else ssh_options={:user => definition.ssh_user,:password => definition.ssh_password, :port => definition.ssh_host_port} - ssh_execute(host_ip,command,ssh_options) + ssh_options[:keys] = ssh_key_to_a(definition.ssh_key) if definition.ssh_key + ssh_execute(host_ip, command, ssh_options) end end @@ -37,13 +39,17 @@ def ssh_commandline_options(options) "-p #{ssh_options[:port]}", "-o UserKnownHostsFile=/dev/null", "-t -o StrictHostKeyChecking=no", - "-o IdentitiesOnly=yes", "-o VerifyHostKeyDNS=no" ] - if !(definition.ssh_key.nil? || definition.ssh_key.empty?) - # Filenames of SSH keys are relative to their definition - ssh_key = File.join(definition.path, definition.ssh_key) - command_options << "-i #{ssh_key}" + if definition.ssh_key + command_options << "-o IdentitiesOnly=yes" + ssh_keys = ssh_key_to_a(definition.ssh_key) + ssh_keys.each do |ssh_keys| + # Filenames of SSH keys are relative to their definition + ssh_key = Pathname.new(ssh_keys) + ssh_key = File.join(definition.path, ssh_key) if ssh_key.relative? + command_options << "-i #{ssh_key}" + end end commandline_options="#{command_options.join(" ")} ".strip diff --git a/lib/veewee/provider/core/box/validate_tags.rb b/lib/veewee/provider/core/box/validate_tags.rb index 9502620e..e81da294 100644 --- a/lib/veewee/provider/core/box/validate_tags.rb +++ b/lib/veewee/provider/core/box/validate_tags.rb @@ -103,6 +103,12 @@ def checks_linux :expected_string => 'root', :sudo => true }, + { :description => 'Checking passwordless sudo', + :tags => [ 'virtualbox','kvm', 'parallels'], + :command => 'echo '' | sudo -S -l 2>/dev/null | grep NOPASSWD 1>/dev/null; echo $?', + :expected_string => '0', + :sudo => false + }, { :description => 'Checking ruby', :tags => [ 'virtualbox','kvm', 'parallels','ruby'], :command => '. /etc/profile ;ruby --version 2> /dev/null 1> /dev/null; echo $?', diff --git a/lib/veewee/provider/core/box/vnc.rb b/lib/veewee/provider/core/box/vnc.rb index b98a41cd..38c8ca56 100644 --- a/lib/veewee/provider/core/box/vnc.rb +++ b/lib/veewee/provider/core/box/vnc.rb @@ -12,26 +12,25 @@ module BoxCommand def vnc_type(sequence,host,display=20) counter=0 env.logger.info "Opening VNC #{host} on display #{display}" - vnc=Net::VNC.open("#{host}:#{display}",{:wait => 0.001}) - sequence.each { |s| - counter=counter+1 + Net::VNC.open("#{host}:#{display}",{:wait => 0.001}) do |vnc| + sequence.each { |s| + counter=counter+1 - ui.info "Typing:[#{counter}]: "+s + ui.info "Typing:[#{counter}]: "+s - keycodes=string_to_vnccode(s) + keycodes=string_to_vnccode(s) - keycodes.each do |keycode| - if keycode==:wait - sleep 1 - else - send_vnc_keycode(vnc,keycode) + keycodes.each do |keycode| + if keycode==:wait + sleep 1 + else + send_vnc_keycode(vnc,keycode) + end end - end - } - vnc.close - ui.info "Done typing." - ui.info "" - + } + ui.info "Done typing." + ui.info "" + end end def send_vnc_keycode(vnc,keycode) @@ -48,7 +47,7 @@ def send_vnc_keycode(vnc,keycode) def string_to_vnccode(thestring) - # https://github.com/aquasync/ruby-vnc/blob/master/data/keys.yaml + # https://github.com/aquasync/ruby-vnc/blob/master/data/keys.yaml special=Hash.new # Specific veewee diff --git a/lib/veewee/provider/core/box/wincp.rb b/lib/veewee/provider/core/box/wincp.rb index 6951b2fb..479fbc42 100644 --- a/lib/veewee/provider/core/box/wincp.rb +++ b/lib/veewee/provider/core/box/wincp.rb @@ -1,4 +1,6 @@ +require 'to_slug' require 'veewee/provider/core/helper/winrm' + module Veewee module Provider module Core @@ -14,7 +16,6 @@ def wincp(localfile,remotefile,options={}) end end - # Calculate an available kickstart port which we will use for wincp definition.kickstart_port = "7000" if definition.kickstart_port.nil? guessed_port=guess_free_port(definition.kickstart_port.to_i,7199).to_s @@ -23,18 +24,23 @@ def wincp(localfile,remotefile,options={}) definition.kickstart_port=guessed_port.to_s end - env.ui.warn "Spinning up a wait_for_http_request on http://#{host_ip_as_seen_by_guest}:#{definition.kickstart_port}#{localfile}" - webthread=allow_for_http_request(localfile,{ - :port => definition.kickstart_port, - :host => definition.kickstart_ip, - :timeout => definition.kickstart_timeout, - :web_dir => '/' - }) - + urlpath = localfile.to_slug + urlpath = urlpath.start_with?('/') ? urlpath : '/' + urlpath + begin self.when_winrm_login_works(self.ip_address,winrm_options.merge(options)) do + env.ui.warn "Spinning up an allow_for_http_request on http://#{host_ip_as_seen_by_guest}:#{definition.kickstart_port}#{localfile} at URL #{urlpath}" + allow_for_http_request( + localfile, + urlpath, + { + :port => definition.kickstart_port, + :timeout => 300, + } + ) + env.ui.info "Going to try and copy #{localfile} to #{remotefile.inspect}" - self.exec("cmd.exe /C cscript %TEMP%\\wget.vbs /url:http://#{host_ip_as_seen_by_guest}:#{definition.kickstart_port}#{localfile} /path:#{remotefile}") + self.exec("cmd.exe /C cscript %TEMP%\\wget.vbs /url:http://#{host_ip_as_seen_by_guest}:#{definition.kickstart_port}#{urlpath} /path:#{remotefile}") # while true do # sleep 0.1 # used to debug # end diff --git a/lib/veewee/provider/core/box/winrm.rb b/lib/veewee/provider/core/box/winrm.rb index 3385dabc..6748b908 100644 --- a/lib/veewee/provider/core/box/winrm.rb +++ b/lib/veewee/provider/core/box/winrm.rb @@ -31,27 +31,6 @@ def winrm(command=nil,options={}) end - private - def winrm_options(options) - - command_options = [ - #"-q", #Suppress warning messages - # "-T", #Pseudo-terminal will not be allocated because stdin is not a terminal. - "-p #{winrm_options[:port]}", - "-o UserKnownHostsFile=/dev/null", - "-t -o StrictHostKeyChecking=no", - "-o IdentitiesOnly=yes", - "-o VerifyHostKeyDNS=no" - ] - if !(definition.winrm_key.nil? || definition.winrm_key.length!="") - command_options << "-i #{definition.winrm_key}" - end - commandline_options="#{command_options.join(" ")} ".strip - - user_option=definition.winrm_user.nil? ? "" : "-l #{definition.winrm_user}" - - return "#{commandline_options} #{user_option}" - end end # Module end # Module end # Module diff --git a/lib/veewee/provider/core/helper/iso.rb b/lib/veewee/provider/core/helper/iso.rb index 003314dd..2cb05106 100644 --- a/lib/veewee/provider/core/helper/iso.rb +++ b/lib/veewee/provider/core/helper/iso.rb @@ -31,33 +31,38 @@ def download_progress(url,localfile) pbar = nil uri = URI.parse(url) uri.open( - :content_length_proc => lambda {|t| - if t && 0 < t - pbar = ProgressBar.new("Fetching file", t) - pbar.file_transfer_mode - end - }, + :content_length_proc => lambda { |t| + if t && 0 < t + pbar = ProgressBar.new("Fetching file", t) + pbar.file_transfer_mode + end + }, :progress_proc => lambda {|s| - pbar.set s if pbar - }, + pbar.set s if pbar + }, #consider proxy env vars only if host is not excluded :proxy => !no_proxy?(uri.host) ) { |src| - # We assume large 10K files, so this is tempfile object - env.logger.info "#{src.class}" + if + src.methods(&:to_sym).include?(:path) + then + # We assume large 10K files, so this is tempfile object ui.info "Moving #{src.path} to #{localfile}" # Force the close of the src stream to release handle before moving # Not forcing the close may cause an issue on windows (Permission Denied) src.close FileUtils.mv(src.path,localfile) - #open(localfile,"wb") { |dst| - #dst.write(src.read) - #} + else + open(localfile,"wb") { |dst| + dst.write(src.read) + } + end } end #return true if host is excluded from proxy via no_proxy env var, false otherwise def no_proxy? host + return false if host.nil? @no_proxy ||= (ENV['NO_PROXY'] || ENV['no_proxy'] || 'localhost, 127.0.0.1').split(/\s*,\s*/) @no_proxy.each do |host_addr| return true if host.match(Regexp.quote(host_addr)+'$') diff --git a/lib/veewee/provider/core/helper/scancode.rb b/lib/veewee/provider/core/helper/scancode.rb index 1b65260c..0d14eaca 100644 --- a/lib/veewee/provider/core/helper/scancode.rb +++ b/lib/veewee/provider/core/helper/scancode.rb @@ -35,15 +35,16 @@ class Scancode end end - @@special_keys=Hash.new; + @@special_keys = Hash.new; @@special_keys[' '] = '1c 9c'; @@special_keys[' '] = '0e 8e'; + @@special_keys[' '] = '0e 8e'; @@special_keys[' '] = '39 b9'; @@special_keys[' '] = '1c 9c' @@special_keys[' '] = '01 81'; @@special_keys[' '] = '0f 8f'; @@special_keys[' '] = '1d 38 0e b8'; - @@special_keys[' '] = 'wait'; + @@special_keys[' '] = 'wait'; @@special_keys[' '] = '48 c8'; @@special_keys[' '] = '50 d0'; @@ -52,6 +53,7 @@ class Scancode @@special_keys[' '] = '4f cf'; @@special_keys[' '] = '52 d2'; @@special_keys[' '] = '53 d3'; + @@special_keys[' '] = '53 d3'; @@special_keys[''] = '4b cb'; @@special_keys[' '] = '4d cd'; @@special_keys[' '] = '47 c7'; @@ -69,13 +71,15 @@ def self.string_to_keycode(thestring) until thestring.length == 0 nospecial=true; - @@special_keys.keys.each { |key| - if thestring.start_with?(key) + @@special_keys.each { |key, value| + if + result = thestring.match(/^#{key}/i) + then #take thestring #check if it starts with a special key + pop special string - keycodes=keycodes+@@special_keys[key]+' '; - thestring=thestring.slice(key.length,thestring.length-key.length) - nospecial=false; + keycodes += value + result.captures.join(",") + ' ' + thestring = thestring.slice(result.to_s.length, thestring.length-result.to_s.length) + nospecial = false; break; end } diff --git a/lib/veewee/provider/core/helper/shell.rb b/lib/veewee/provider/core/helper/shell.rb index 35b7d061..20bf6dcb 100644 --- a/lib/veewee/provider/core/helper/shell.rb +++ b/lib/veewee/provider/core/helper/shell.rb @@ -20,31 +20,36 @@ module Shell # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/185404 # This should work on windows too now # This will result in a ShellResult structure with stdout, stderr and status - def shell_exec(command,options = {:mute => true,:status => 0,:stderr => "&1"}) - defaults={:mute => true, :status => 0} - options=defaults.merge(options) - result=ShellResult.new("","",-1) + def shell_exec(command, options = {}) + defaults = { :mute => true, :status => 0, :stderr => "&1" } + options = defaults.merge(options) + result = ShellResult.new("","",-1) ui.info "Executing #{command}" unless options[:mute] env.logger.debug "Command: \"#{command}\"" env.logger.debug "Output:" env.logger.debug "-------" - escaped_command=command + escaped_command = command stderr_redirect = options[:stderr]? options[:stderr] : "&1" - IO.popen("#{escaped_command}"+ " 2>#{stderr_redirect}") { |p| - p.each_line{ |l| - result.stdout+=l - ui.info(l,{:new_line => false}) unless options[:mute] - env.logger.debug(l.chomp) - } - result.status=Process.waitpid2(p.pid)[1].exitstatus - if result.status.to_i!=options[:status] + io_options = {} + io_options[:external_encoding] = options[:external_encoding] if options[:external_encoding] + + IO.popen("#{escaped_command}"+ " 2>#{stderr_redirect}", io_options) do |pipe| + pipe.each_line do |line| + result.stdout += line + ui.info(line, :new_line => false) unless options[:mute] + env.logger.debug(line.chomp) + end + result.status = Process.waitpid2(pipe.pid)[1].exitstatus + if + result.status.to_i != options[:status] + then ui.error "Error: We executed a shell command and the exit status was not #{options[:status]}" ui.error "- Command :#{command}." ui.error "- Exitcode :#{result.status}." ui.error "- Output :\n#{result.stdout}" raise Veewee::Error,"Wrong exit code for command #{command}" end - } + end return result end diff --git a/lib/veewee/provider/core/helper/ssh.rb b/lib/veewee/provider/core/helper/ssh.rb index 4d47573d..2f2b50b4 100644 --- a/lib/veewee/provider/core/helper/ssh.rb +++ b/lib/veewee/provider/core/helper/ssh.rb @@ -1,3 +1,7 @@ +require 'socket' +require 'net/ssh' +require 'net/scp' + module Veewee module Provider module Core @@ -15,211 +19,215 @@ def initialize(stdout,stderr,status) end end - module Ssh - - require 'socket' - - # nonblocking ssh connection check - def tcp_test_ssh(hostname, port, timeout = 2) - - addr = Socket.getaddrinfo(hostname, nil) - sockaddr = Socket.pack_sockaddr_in(port, addr[0][3]) - - Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0).tap do |socket| - socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) - begin - socket.connect_nonblock(sockaddr) - - rescue IO::WaitWritable - if IO.select(nil, [socket], nil, timeout) - begin - result = socket.connect_nonblock(sockaddr) - if result == 0 - socket.close - return true - end - rescue Errno::EISCONN - socket.close - return true - rescue - socket.close - return false - end - else - socket.close - return false - end - end + end + end + end +end + +module Veewee::Provider::Core::Helper::Ssh + + def build_ssh_options + ssh_options={ + :user => definition.ssh_user, + :port => 22, + :password => definition.ssh_password, + :timeout => definition.ssh_login_timeout.to_i + } + ssh_options[:keys] = ssh_key_to_a(definition.ssh_key) if definition.ssh_key + return ssh_options + end + + def ssh_options + build_ssh_options + end + + def ssh_key_to_a(ssh_key) + case ssh_key + when "" then [] + else Array(ssh_key) + end + end + + # nonblocking ssh connection check + def tcp_test_ssh(hostname, port, timeout = 2) + + addr = Socket.getaddrinfo(hostname, nil) + sockaddr = Socket.pack_sockaddr_in(port, addr[0][3]) + + Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0).tap do |socket| + socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) + begin + socket.connect_nonblock(sockaddr) + + rescue IO::WaitWritable + if IO.select(nil, [socket], nil, timeout) + begin + result = socket.connect_nonblock(sockaddr) + if result == 0 + socket.close + return true end - false + rescue Errno::EISCONN + socket.close + return true + rescue + socket.close + return false end - - require 'net/ssh' - require 'net/scp' - - def when_ssh_login_works(ip="127.0.0.1", options = { } , &block) - - defaults={ :port => '22', :timeout => 20000 } - - options=defaults.merge(options) - - timeout = options[:timeout] - timeout=ENV['VEEWEE_TIMEOUT'].to_i unless ENV['VEEWEE_TIMEOUT'].nil? - - unless options[:mute] - ui.info "Waiting for ssh login on #{ip} with user #{options[:user]} to sshd on port => #{options[:port]} to work, timeout=#{timeout} sec" - end - - run_hook(:before_ssh) - - begin - Timeout::timeout(timeout) do - connected=false - while !connected do - begin - env.ui.info ".",{:new_line => false , :prefix => false} unless options[:mute] - if tcp_test_ssh(ip, options[:port]) - Net::SSH.start(ip, options[:user], - { :port => options[:port], - :password => options[:password], - :auth_methods => ['password','publickey','keyboard-interactive'], - :paranoid => false , - :timeout => timeout }) do |ssh| - - ui.info "\n", {:prefix => false} unless options[:mute] - block.call(ip); - return true - end - else - sleep 5 - end - rescue Net::SSH::Disconnect, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNABORTED, Errno::ECONNRESET, Errno::ENETUNREACH, Errno::ETIMEDOUT - sleep 5 - end - end + else + socket.close + return false + end + end + end + false + end + + def when_ssh_login_works(ip="127.0.0.1", options = { } , &block) + defaults={ :port => '22', :timeout => 20000 } + options=defaults.merge(options) + + timeout = options[:timeout] + timeout = ENV['VEEWEE_TIMEOUT'].to_i unless ENV['VEEWEE_TIMEOUT'].nil? + + unless options[:mute] + ui.info "Waiting for ssh login on #{ip} with user #{options[:user]} to sshd on port => #{options[:port]} to work, timeout=#{timeout} sec" + end + + run_hook(:before_ssh) + + begin + Timeout::timeout(timeout) do + connected=false + while !connected do + begin + env.ui.info ".",{:new_line => false , :prefix => false} unless options[:mute] + if + tcp_test_ssh(ip, options[:port]) + then + ssh_connection(ip, options, :timeout => timeout ) do |ssh| + ui.info "\n", {:prefix => false} unless options[:mute] + block.call(ip); + return true end - rescue IOError - ui.info "Received a disconnect; moving on" + else sleep 5 - rescue Timeout::Error - raise Veewee::Error, "Ssh timeout #{timeout} sec has been reached." end - ui.info "" - return false + rescue Net::SSH::Disconnect, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNABORTED, Errno::ECONNRESET, Errno::ENETUNREACH, Errno::ETIMEDOUT + sleep 5 end + end + end + rescue IOError + ui.info "Received a disconnect; moving on" + sleep 5 + rescue Timeout::Error + raise Veewee::Error, "Ssh timeout #{timeout} sec has been reached." + end + ui.info "" + return false + end + + def ssh_transfer_file(host,filename,destination = '.' , options = {}) + + ssh_connection( host, options ) do |ssh| + ui.info "Transferring #{filename} to #{destination} " + ssh.scp.upload!( filename, destination ) do |ch, name, sent, total| + # print "\r#{destination}: #{(sent.to_f * 100 / total.to_f).to_i}%" + env.ui.info ".",{:new_line => false , :prefix => false} + end + end + ui.info "", {:prefix => false} + end + + + def ssh_execute(host,command, options = { :progress => "on"} ) + defaults= { :port => "22", :exitcode => "0", :user => "root"} + options=defaults.merge(options) + pid="" + stdin=command + stdout="" + stderr="" + status=-99999 + + unless options[:mute] + ui.info "Executing command: #{command}" + end + + ssh_connection( host, options ) do |ssh| + + # open a new channel and configure a minimal set of callbacks, then run + # the event loop until the channel finishes (closes) + channel = ssh.open_channel do |ch| + + #request pty for sudo stuff and so + ch.request_pty do |ch, success| + raise "Error requesting pty" unless success + end + ch.exec "#{command}" do |ch, success| + raise "could not execute command" unless success - def ssh_transfer_file(host,filename,destination = '.' , options = {}) - - defaults={ - :paranoid => false, - :auth_methods => ['password','publickey','keyboard-interactive'] - } - options=defaults.merge(options) - - Net::SSH.start( host,options[:user],options ) do |ssh| - ui.info "Transferring #{filename} to #{destination} " - ssh.scp.upload!( filename, destination ) do |ch, name, sent, total| - # print "\r#{destination}: #{(sent.to_f * 100 / total.to_f).to_i}%" - env.ui.info ".",{:new_line => false , :prefix => false} - end - end - ui.info "", {:prefix => false} + # "on_data" is called when the process writes something to stdout + ch.on_data do |c, data| + stdout+=data + ui.info(data, :new_line => false) unless options[:mute] end + # "on_extended_data" is called when the process writes something to stderr + # NOTE: When requesting a pty (ch.request_pty), everything goes to stdout + ch.on_extended_data do |c, type, data| + stderr+=data + ui.info(data, :new_line => false) unless options[:mute] + end - def ssh_execute(host,command, options = { :progress => "on"} ) - defaults= { :port => "22", :exitcode => "0", :user => "root"} - options=defaults.merge(options) - pid="" - stdin=command - stdout="" - stderr="" - status=-99999 - - unless options[:mute] - ui.info "Executing command: #{command}" - end - - Net::SSH.start(host, options[:user], { - :port => options[:port], - :password => options[:password], - :auth_methods => ['password','publickey','keyboard-interactive'], - :paranoid => false }) do |ssh| - - # open a new channel and configure a minimal set of callbacks, then run - # the event loop until the channel finishes (closes) - channel = ssh.open_channel do |ch| - - #request pty for sudo stuff and so - ch.request_pty do |ch, success| - raise "Error requesting pty" unless success - end - - ch.exec "#{command}" do |ch, success| - raise "could not execute command" unless success - - - # "on_data" is called when the process writes something to stdout - ch.on_data do |c, data| - stdout+=data - - ui.info(data, :new_line => false) unless options[:mute] - - end - - # "on_extended_data" is called when the process writes something to stderr - # NOTE: When requesting a pty (ch.request_pty), everything goes to stdout - ch.on_extended_data do |c, type, data| - stderr+=data - - ui.info(data, :new_line => false) unless options[:mute] - - end - - #exit code - #http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a806b0f5dae4e1e2 - channel.on_request("exit-status") do |ch, data| - exit_code = data.read_long - status=exit_code - if exit_code > 0 - ui.info "ERROR: exit code #{exit_code}" unless options[:mute] - else - #ui.info "Successfully executed" - end - end - - channel.on_request("exit-signal") do |ch, data| - ui.info "SIGNAL: #{data.read_long}" unless options[:mute] - end - - ch.on_close { - #ui.info "done!" - } - #status=ch.exec "echo $?" - end - end - channel.wait - end - - - if (status.to_s != options[:exitcode] ) - if (options[:exitcode]=="*") - #its a test so we don't need to worry - else - raise Veewee::Provider::Core::Helper::SshResult.new(stdout,stderr,status), "Exitcode was not what we expected" - end - + #exit code + #http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a806b0f5dae4e1e2 + channel.on_request("exit-status") do |ch, data| + exit_code = data.read_long + status=exit_code + if exit_code > 0 + ui.info "ERROR: exit code #{exit_code}" unless options[:mute] + else + #ui.info "Successfully executed" end - - return Veewee::Provider::Core::Helper::SshResult.new(stdout,stderr,status) - end + channel.on_request("exit-signal") do |ch, data| + ui.info "SIGNAL: #{data.read_long}" unless options[:mute] + end - - end #Class - end #Module - end #Module - end #Module -end #Module + ch.on_close { + #ui.info "done!" + } + #status=ch.exec "echo $?" + end + end + channel.wait + end + + if (status.to_s != options[:exitcode] ) + if (options[:exitcode]=="*") + #its a test so we don't need to worry + else + raise Veewee::Provider::Core::Helper::SshResult.new(stdout,stderr,status), "Exitcode was not what we expected" + end + + end + + return Veewee::Provider::Core::Helper::SshResult.new(stdout,stderr,status) + end + + def ssh_connection(host, options, defaults={}, &block) + options=defaults.merge(options) + options={ + :auth_methods => %w[ password publickey keyboard-interactive ], + :paranoid => false + }.merge(options) + options=Hash[ options.select { |key, value| Net::SSH::VALID_OPTIONS.include?(key) } ] + Net::SSH.start( host, options[:user], options ) do |ssh| + yield ssh + end + end + +end diff --git a/lib/veewee/provider/core/helper/web.rb b/lib/veewee/provider/core/helper/web.rb index 1e8da85d..6ddd684a 100644 --- a/lib/veewee/provider/core/helper/web.rb +++ b/lib/veewee/provider/core/helper/web.rb @@ -2,81 +2,87 @@ module Veewee module Provider module Core module Helper - require 'webrick' - include WEBrick - module Servlet + require 'webrick' - class FileServlet < WEBrick::HTTPServlet::AbstractServlet - - attr_reader :ui, :threaded + include WEBrick - def initialize(server,localfile,ui,threaded) - super(server) - @server=server - @localfile=localfile - @ui=ui - @threaded=threaded + module Web + def wait_for_http_request(filename, urlname, options) # thread with timeout + thread = allow_for_http_request(filename, urlname, options) + timeout = options[:timeout] || 60 + thread.join(timeout) or begin + thread.kill + raise "File #{filename.inspect} was not requested as #{urlname.inspect} in #{timeout} seconds, are you using firewall blocking connections to port: #{options[:port]}?" end + end - def do_GET(request,response) - response['Content-Type']='text/plain' - response.status = 200 - content = File.open(@localfile, "r").read - response.body = case File.extname(@localfile) - when ".erb" - ui.info "Rendering and serving file #{@localfile}" - ERB.new(content).result(binding) - else - ui.info "Serving file #{@localfile}" - content - end - if not @threaded - ui.info "Shutting down for #{@localfile}" - @server.shutdown - end + def allow_for_http_request(filename, urlname, options) # start in new thread + thread = Thread.new do + server_for_http_request(filename, urlname, options) end + thread.abort_on_exception = true + trap("INT") { thread.kill; exit } + thread end - end - module Web - - def wait_for_http_request(filename,options) # original blocking - s = server_for_http_request(filename,options) - s.start - end + private - def allow_for_http_request(filename,options) # start in new thread - s = server_for_http_request(filename,options.merge({:threaded => false})) - Thread.new { s.start } + def server_for_http_request(filename, urlname, options) + initialize_server(options[:port]) + mount_file(filename, urlname) + @server.start + ensure + server_shutdown end - def server_for_http_request(filename,options={:timeout => 10, :web_dir => "", :port => 7125, :threaded => false}) + def initialize_server(port) # Calculate the OS equivalent of /dev/null , on windows this is NUL: # http://www.ruby-forum.com/topic/115472 fn = test(?e, '/dev/null') ? '/dev/null' : 'NUL:' + webrick_logger = WEBrick::Log.new(fn, WEBrick::Log::INFO) - webrick_logger=WEBrick::Log.new(fn, WEBrick::Log::INFO) - - web_dir=options[:web_dir] - filename=filename - s= ::WEBrick::HTTPServer.new( - :Port => options[:port], + @server = + ::WEBrick::HTTPServer.new( + :Port => port, :Logger => webrick_logger, - :AccessLog => webrick_logger + :AccessLog => webrick_logger, ) - mount_filename = filename.start_with?('/') ? filename : "/#{filename}" - env.logger.debug("mounting file #{mount_filename}") - s.mount("#{mount_filename}", Veewee::Provider::Core::Helper::Servlet::FileServlet,File.join(web_dir,filename),ui,options[:threaded]) - trap("INT"){ - s.shutdown + end + + def mount_file(filename, urlname) + urlname = urlname[0..-5] if File.extname(urlname) == ".erb" + + @server.mount_proc(urlname) do |request, response| + ui.info "Serving content for #{urlname}" + response['Content-Type']='text/plain' + response.status = 200 + response.body = read_content(filename) + server_shutdown + end + end + + def read_content(filename) + ui.info "Reading content #{filename}" + content = File.open(filename, "r").read + if File.extname(filename) == ".erb" + ui.info "Evaluating template #{filename}" + content = ::ERB.new(content).result(binding) + end + content + end + + def server_shutdown + if @server ui.info "Stopping webserver" - exit - } - s + yield @server if block_given? + @server.shutdown + @server = nil + end end end #Class + end #Module end #Module end #Module diff --git a/lib/veewee/provider/core/helper/winrm.rb b/lib/veewee/provider/core/helper/winrm.rb index e0874b11..fac8c859 100644 --- a/lib/veewee/provider/core/helper/winrm.rb +++ b/lib/veewee/provider/core/helper/winrm.rb @@ -22,6 +22,21 @@ module Winrm require 'em-winrm' require 'highline' + def build_winrm_options + { + :user => definition.winrm_user, + :pass => definition.winrm_password, + :port => definition.winrm_host_port, + :basic_auth_only => true, + :timeout => definition.winrm_login_timeout.to_i, + :operation_timeout => 600 # ten minutes + } + end + + def winrm_options + build_winrm_options + end + def winrm_up?(ip,options) begin if not @winrm_up diff --git a/lib/veewee/provider/kvm/box.rb b/lib/veewee/provider/kvm/box.rb index 6f9d5a85..eeca2b07 100644 --- a/lib/veewee/provider/kvm/box.rb +++ b/lib/veewee/provider/kvm/box.rb @@ -11,7 +11,6 @@ require 'veewee/provider/kvm/box/export_vagrant' require 'veewee/provider/kvm/box/helper/ip' -require 'veewee/provider/kvm/box/helper/ssh_options' require 'veewee/provider/kvm/box/helper/status' require 'veewee/provider/kvm/box/helper/console_type' diff --git a/lib/veewee/provider/kvm/box/helper/ssh_options.rb b/lib/veewee/provider/kvm/box/helper/ssh_options.rb deleted file mode 100644 index 7a7441eb..00000000 --- a/lib/veewee/provider/kvm/box/helper/ssh_options.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Veewee - module Provider - module Kvm - module BoxCommand - - def ssh_options - ssh_options={ - :user => definition.ssh_user, - :port => 22, - :password => definition.ssh_password, - :timeout => definition.ssh_login_timeout.to_i - } - return ssh_options - end - - end # End Module - end # End Module - end # End Module -end # End Module diff --git a/lib/veewee/provider/kvm/box/up.rb b/lib/veewee/provider/kvm/box/up.rb index becec082..b83eda7e 100644 --- a/lib/veewee/provider/kvm/box/up.rb +++ b/lib/veewee/provider/kvm/box/up.rb @@ -6,6 +6,11 @@ module BoxCommand def up(options={}) matched_servers=@connection.servers.all(:name => name) matched_servers.first.start unless matched_servers.nil? + rescue Libvirt::Error => e + warn " +Libvirt Error! Make sure your user has permissions to run anything. +" + raise e end end # End Module diff --git a/lib/veewee/provider/kvm/provider.rb b/lib/veewee/provider/kvm/provider.rb index 9e7bdfef..b0d92860 100644 --- a/lib/veewee/provider/kvm/provider.rb +++ b/lib/veewee/provider/kvm/provider.rb @@ -46,7 +46,7 @@ def check_requirements conn.pools.any? or raise Veewee::Error, "You need at least one (active) storage pool defined in #{Fog.credentials[:libvirt_uri]}." env.logger.info "Checking availability of the arp utility" - shell_exec("arp").status.zero? or raise Veewee::Error, "Could not execute the arp command. This is required to find the IP address of the VM" + shell_exec("arp -an").status.zero? or raise Veewee::Error, "Could not execute the arp command. This is required to find the IP address of the VM" end diff --git a/lib/veewee/provider/parallels/box.rb b/lib/veewee/provider/parallels/box.rb index ea13d568..b55c4fb7 100644 --- a/lib/veewee/provider/parallels/box.rb +++ b/lib/veewee/provider/parallels/box.rb @@ -3,7 +3,6 @@ require 'veewee/provider/parallels/box/helper/status' require 'veewee/provider/parallels/box/helper/ip' -require 'veewee/provider/parallels/box/helper/ssh_options' require 'veewee/provider/parallels/box/helper/console_type' require 'veewee/provider/parallels/box/helper/buildinfo' diff --git a/lib/veewee/provider/parallels/box/export.rb b/lib/veewee/provider/parallels/box/export.rb index 71225dd5..4d00bc2e 100644 --- a/lib/veewee/provider/parallels/box/export.rb +++ b/lib/veewee/provider/parallels/box/export.rb @@ -175,7 +175,7 @@ def template_metadatafile def optimize_disk env.ui.info "Optimizing Disk" path_to_hdd = File.join read_settings.fetch("Home"), "harddisk.hdd" - optimize_command = "#{@prldisktool} compact --buildmap --hdd #{path_to_hdd}" + optimize_command = "#{@prldisktool} compact --hdd #{path_to_hdd}" shell_exec optimize_command end end #Module diff --git a/lib/veewee/provider/parallels/box/helper/ssh_options.rb b/lib/veewee/provider/parallels/box/helper/ssh_options.rb deleted file mode 100644 index dfe5cb37..00000000 --- a/lib/veewee/provider/parallels/box/helper/ssh_options.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Veewee - module Provider - module Parallels - module BoxCommand - - # Translate the definition ssh options to ssh options that can be passed to Net::Ssh calls - def ssh_options - ssh_options={ - :user => definition.ssh_user, - :port => 22, - :password => definition.ssh_password, - :timeout => definition.ssh_login_timeout.to_i - } - return ssh_options - end - - end - end - end -end diff --git a/lib/veewee/provider/virtualbox/box.rb b/lib/veewee/provider/virtualbox/box.rb index cd4bdee0..e9f09bdc 100644 --- a/lib/veewee/provider/virtualbox/box.rb +++ b/lib/veewee/provider/virtualbox/box.rb @@ -28,34 +28,35 @@ module Veewee module Provider module Virtualbox class Box < Veewee::Provider::Core::Box - include ::Veewee::Provider::Virtualbox::BoxCommand - def initialize(name,env) + def initialize(name, env) @vboxcmd = self.class.determine_vboxcmd super(name, env) end def self.windows_vboxcmd # based on Vagrant/plugins/providers/virtualbox/driver/base.rb - if OS.windows? && ENV.has_key?("VBOX_INSTALL_PATH") - ENV["VBOX_INSTALL_PATH"].split(File::PATH_SEPARATOR).each do |path| - vboxmanage = File.join(path,"VBoxManage.exe") - return "\"#{vboxmanage}\"" if File.file?(vboxmanage) + if OS.windows? + if ENV.key?('VBOX_INSTALL_PATH') || + ENV.key?('VBOX_MSI_INSTALL_PATH') + path = ENV['VBOX_INSTALL_PATH'] || ENV['VBOX_MSI_INSTALL_PATH'] + path.split(File::PATH_SEPARATOR).each do |single| + vboxmanage = File.join(single, 'VBoxManage.exe') + return "\"#{vboxmanage}\"" if File.file?(vboxmanage) + end end end nil end def self.default_vboxcmd - "VBoxManage" + 'VBoxManage' end def self.determine_vboxcmd @command ||= windows_vboxcmd || default_vboxcmd end - - end # End Class end # End Module end # End Module diff --git a/lib/veewee/provider/virtualbox/box/export_vagrant.rb b/lib/veewee/provider/virtualbox/box/export_vagrant.rb index 65477d56..2bbd9200 100644 --- a/lib/veewee/provider/virtualbox/box/export_vagrant.rb +++ b/lib/veewee/provider/virtualbox/box/export_vagrant.rb @@ -110,7 +110,7 @@ def export_vagrant(options) end ui.info "Exporting the box" - command = "#{@vboxcmd} export \"#{name}\" --output #{File.join(tmp_dir,'box.ovf')}" + command = "#{@vboxcmd} export \"#{name}\" --output \"#{File.join(tmp_dir,'box.ovf')}\"" env.logger.debug("Command: #{command}") shell_exec(command, {:mute => false}) diff --git a/lib/veewee/provider/virtualbox/box/helper/console_type.rb b/lib/veewee/provider/virtualbox/box/helper/console_type.rb index 348791cc..1658f5fe 100644 --- a/lib/veewee/provider/virtualbox/box/helper/console_type.rb +++ b/lib/veewee/provider/virtualbox/box/helper/console_type.rb @@ -29,11 +29,11 @@ def send_virtualbox_sequence(sequence) # A workaround is to send the scancodes one-by-one. codes="" for keycode in keycodes.split(' ') do - unless keycode=="wait" + case keycode + when /^wait(\d*)$/ then sleep_guess($1) + else send_keycode(keycode) sleep 0.01 - else - sleep 1 end end #sleep after each sequence (needs to be param) @@ -45,11 +45,19 @@ def send_virtualbox_sequence(sequence) end + def sleep_guess(str) + str = "1" if str == "" + sleep str.to_i + end + def send_keycode(keycode) command= "#{@vboxcmd} controlvm \"#{name}\" keyboardputscancode #{keycode}" env.logger.debug "#{command}" - sshresult=shell_exec("#{command}",{:mute => true}) - unless sshresult.stdout.index("E_ACCESSDENIED").nil? + sshresult = shell_exec("#{command}",{:mute => true}) + env.logger.debug "\ +sshresult.stdout: #{sshresult.stdout.inspect}, +sshresult.stderr: #{sshresult.stderr.inspect}" + if sshresult.stdout.index("E_ACCESSDENIED") error= "There was an error typing the commands on the console" error+="Probably the VM did not get started." error+= "" diff --git a/lib/veewee/provider/virtualbox/box/helper/ip.rb b/lib/veewee/provider/virtualbox/box/helper/ip.rb index 3791a8bf..046f0382 100644 --- a/lib/veewee/provider/virtualbox/box/helper/ip.rb +++ b/lib/veewee/provider/virtualbox/box/helper/ip.rb @@ -5,7 +5,11 @@ module BoxCommand # http://www.virtualbox.org/manual/ch09.html#idp13716288 def host_ip_as_seen_by_guest - "10.0.2.2" + # as per definition in virtualbox + # we need to add 1 because vboxmanage starts counting from 1 for display, + # but counts from 0 when actually assigning the IP + host_ip = "10.0.#{self.natinterface.to_i + 1}.2" + return host_ip # "10.0.2.2" end # Get the IP address of the box diff --git a/lib/veewee/provider/virtualbox/box/helper/ssh_options.rb b/lib/veewee/provider/virtualbox/box/helper/ssh_options.rb index 8d05eedd..b6fa6ea5 100644 --- a/lib/veewee/provider/virtualbox/box/helper/ssh_options.rb +++ b/lib/veewee/provider/virtualbox/box/helper/ssh_options.rb @@ -4,22 +4,16 @@ module Virtualbox module BoxCommand def ssh_options - port=definition.ssh_host_port - if self.exists? - forward=self.forwarding("guestssh") - unless forward.nil? - port=forward[:host_port] + build_ssh_options.tap do |options| + port = definition.ssh_host_port + if self.exists? + forward=self.forwarding("guestssh") + unless forward.nil? + port=forward[:host_port] + end end + options[:port] = port end - - ssh_options={ - :user => definition.ssh_user, - :port => port, - :password => definition.ssh_password, - :timeout => definition.ssh_login_timeout.to_i - } - return ssh_options - end end diff --git a/lib/veewee/provider/virtualbox/box/helper/winrm_options.rb b/lib/veewee/provider/virtualbox/box/helper/winrm_options.rb index 3abcc4c3..0be6f8ee 100644 --- a/lib/veewee/provider/virtualbox/box/helper/winrm_options.rb +++ b/lib/veewee/provider/virtualbox/box/helper/winrm_options.rb @@ -4,25 +4,16 @@ module Virtualbox module BoxCommand def winrm_options - port=definition.winrm_host_port - if self.exists? - forward=self.forwarding("guestwinrm") - unless forward.nil? - port=forward[:host_port] + build_winrm_options.tap do |options| + port=definition.winrm_host_port + if self.exists? + forward=self.forwarding("guestwinrm") + unless forward.nil? + port=forward[:host_port] + end end + options[:port] = port end - - winrm_options={ - :user => definition.winrm_user, - :pass => definition.winrm_password, - :port => port, -# :port => (port.to_i+1).to_s, # debug, by running charles with a reverse proxy - :basic_auth_only => true, - :timeout => definition.winrm_login_timeout.to_i, - :operation_timeout => 600 # ten minutes - } - return winrm_options - end end diff --git a/lib/veewee/provider/vmfusion/box.rb b/lib/veewee/provider/vmfusion/box.rb index 44cb955a..a3739b0f 100644 --- a/lib/veewee/provider/vmfusion/box.rb +++ b/lib/veewee/provider/vmfusion/box.rb @@ -4,8 +4,6 @@ require 'veewee/provider/vmfusion/box/helper/status' require 'veewee/provider/vmfusion/box/helper/ip' -require 'veewee/provider/vmfusion/box/helper/ssh_options' -require 'veewee/provider/vmfusion/box/helper/winrm_options' require 'veewee/provider/vmfusion/box/helper/vnc' require 'veewee/provider/vmfusion/box/helper/console_type' require 'veewee/provider/vmfusion/box/helper/buildinfo' diff --git a/lib/veewee/provider/vmfusion/box/helper/ip.rb b/lib/veewee/provider/vmfusion/box/helper/ip.rb index 365f0b46..cb60a55f 100644 --- a/lib/veewee/provider/vmfusion/box/helper/ip.rb +++ b/lib/veewee/provider/vmfusion/box/helper/ip.rb @@ -27,7 +27,7 @@ def ip_address # Use alternate method to retrieve the IP address using vmrun readVariable ip_address = shell_exec("#{vmrun_cmd.shellescape} readVariable \"#{vmx_file_path}\" guestVar ip", { :mute => true}).stdout.strip - return ip_address unless ip_address.empty? + return ip_address unless ip_address.empty? || ip_address == 'unknown' unless mac_address.nil? lease = Fission::Lease.find_by_mac_address(mac_address).data diff --git a/lib/veewee/provider/vmfusion/box/helper/ssh_options.rb b/lib/veewee/provider/vmfusion/box/helper/ssh_options.rb deleted file mode 100644 index 28e10473..00000000 --- a/lib/veewee/provider/vmfusion/box/helper/ssh_options.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Veewee - module Provider - module Vmfusion - module BoxCommand - - # Translate the definition ssh options to ssh options that can be passed to Net::Ssh calls - def ssh_options - ssh_options={ - :user => definition.ssh_user, - :port => 22, - :password => definition.ssh_password, - :timeout => definition.ssh_login_timeout.to_i - } - return ssh_options - end - - end - end - end -end diff --git a/lib/veewee/provider/vmfusion/box/helper/winrm_options.rb b/lib/veewee/provider/vmfusion/box/helper/winrm_options.rb deleted file mode 100644 index 109b23ec..00000000 --- a/lib/veewee/provider/vmfusion/box/helper/winrm_options.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Veewee - module Provider - module Vmfusion - module BoxCommand - - def winrm_options - winrm_options={ - :user => definition.winrm_user, - :pass => definition.winrm_password, - :port => definition.winrm_host_port, - :basic_auth_only => true, - :timeout => definition.winrm_login_timeout.to_i, - :operation_timeout => 600 # ten minutes - } - return winrm_options - end - - end - end - end -end diff --git a/lib/veewee/provider/vmfusion/provider.rb b/lib/veewee/provider/vmfusion/provider.rb index bbfc199e..3dc685d3 100644 --- a/lib/veewee/provider/vmfusion/provider.rb +++ b/lib/veewee/provider/vmfusion/provider.rb @@ -10,11 +10,10 @@ class Provider < Veewee::Provider::Core::Provider def check_requirements require 'fission' - if File.exists?("/Library/Application Support/VMware Fusion/vmrun") - ::Fission.config.attributes["vmrun_bin"] = "/Library/Application Support/VMware Fusion/vmrun" - elsif File.exists?("/Applications/VMware Fusion.app/Contents/Library/vmrun") - ::Fission.config.attributes["vmrun_bin"] = "/Applications/VMware Fusion.app/Contents/Library/vmrun" - elsif + if + ::Fission.config.attributes["vmrun_bin"].nil? || + !File.exists?(::Fission.config.attributes["vmrun_bin"]) + then raise Veewee::Error,"Could not find vmrun at standard locations. Probably you don't have Vmware fusion installed" end env.logger.info("Found fusion version: #{fusion_version}") @@ -22,12 +21,12 @@ def check_requirements def fusion_version # We ask the system profiler for all installed software - shell_results = shell_exec("system_profiler SPApplicationsDataType") + shell_results = shell_exec("system_profiler SPApplicationsDataType", :external_encoding => Encoding::UTF_8) env.logger.info("Checking version by querying the system_profiler") env.logger.debug(shell_results.stdout) - if (shell_results.stdout == "") + if shell_results.stdout == "" ui.warn "Could not detect the exact version of vmware. assuming 5.1" version = "5.1" else diff --git a/lib/veewee/templates.rb b/lib/veewee/templates.rb index d104c389..be47293a 100644 --- a/lib/veewee/templates.rb +++ b/lib/veewee/templates.rb @@ -1,3 +1,5 @@ +require "gem-content" + module Veewee class Templates @@ -53,6 +55,7 @@ def each(&block) # Traverses path to see which exist or not # and checks if available def valid_paths(paths) + paths = GemContent.get_gem_paths("veewee-templates") valid_paths = paths.collect { |path| if File.exists?(path) && File.directory?(path) env.logger.info "Path #{path} exists" diff --git a/lib/veewee/version.rb b/lib/veewee/version.rb index ae36a25f..fe942880 100644 --- a/lib/veewee/version.rb +++ b/lib/veewee/version.rb @@ -4,5 +4,5 @@ module Veewee # Only set the version constant if it wasn't set before unless defined?(Veewee::VERSION) - ::Veewee::VERSION="0.3.12" + ::Veewee::VERSION="0.5.0.alpha4" end diff --git a/templates/.ubuntu/base.sh b/templates/.ubuntu/base.sh index ed9aa3bb..02ade858 100644 --- a/templates/.ubuntu/base.sh +++ b/templates/.ubuntu/base.sh @@ -1,3 +1,5 @@ +#!/bin/bash + if [ -f .veewee_params ] then . .veewee_params diff --git a/templates/.ubuntu/chef.sh b/templates/.ubuntu/chef.sh index cd119586..75f5faf4 100644 --- a/templates/.ubuntu/chef.sh +++ b/templates/.ubuntu/chef.sh @@ -1,3 +1,5 @@ +#!/bin/bash + if [ -f .veewee_params ] then . .veewee_params diff --git a/templates/.ubuntu/cleanup.sh b/templates/.ubuntu/cleanup.sh index 4779c1e4..c32b0760 100644 --- a/templates/.ubuntu/cleanup.sh +++ b/templates/.ubuntu/cleanup.sh @@ -1,3 +1,10 @@ +#!/bin/bash + +if [ -f .veewee_params ] +then + . .veewee_params +fi + # Remove items used for building, since they aren't needed anymore echo "removing unnessary packages" apt-get -y remove linux-headers-$(uname -r) build-essential diff --git a/templates/.ubuntu/puppet.sh b/templates/.ubuntu/puppet.sh index 94ea6af9..7cc9a8ec 100644 --- a/templates/.ubuntu/puppet.sh +++ b/templates/.ubuntu/puppet.sh @@ -1,3 +1,5 @@ +#!/bin/bash + if [ -f .veewee_params ] then . .veewee_params diff --git a/templates/.ubuntu/ruby.sh b/templates/.ubuntu/ruby.sh index c1dc046b..f25c7a3c 100644 --- a/templates/.ubuntu/ruby.sh +++ b/templates/.ubuntu/ruby.sh @@ -1,3 +1,5 @@ +#!/bin/bash + if [ -f .veewee_params ] then . .veewee_params diff --git a/templates/.ubuntu/vagrant.sh b/templates/.ubuntu/vagrant.sh index 69cbd36d..24795688 100644 --- a/templates/.ubuntu/vagrant.sh +++ b/templates/.ubuntu/vagrant.sh @@ -1,3 +1,5 @@ +#!/bin/bash + if [ -f .veewee_params ] then . .veewee_params diff --git a/templates/.ubuntu/virtualbox.sh b/templates/.ubuntu/virtualbox.sh index b63013f9..f094b5c5 100644 --- a/templates/.ubuntu/virtualbox.sh +++ b/templates/.ubuntu/virtualbox.sh @@ -1,3 +1,5 @@ +#!/bin/bash + if [ -f .veewee_params ] then . .veewee_params diff --git a/templates/.ubuntu/zerodisk.sh b/templates/.ubuntu/zerodisk.sh index 90381469..46e84c70 100644 --- a/templates/.ubuntu/zerodisk.sh +++ b/templates/.ubuntu/zerodisk.sh @@ -1,3 +1,5 @@ +#!/bin/bash + if [ -f .veewee_params ] then . .veewee_params diff --git a/templates/CentOS-4.8-i386/definition.rb b/templates/CentOS-4.8-i386/definition.rb index 10653b09..02daf1d9 100644 --- a/templates/CentOS-4.8-i386/definition.rb +++ b/templates/CentOS-4.8-i386/definition.rb @@ -5,7 +5,7 @@ :iso_file => "CentOS-4.8-i386-bin-DVD.iso", :iso_src => "", :iso_md5 => "", :iso_download_timeout => 1000, :iso_download_instructions => "This iso is no more available, for instructions see http://vault.centos.org/4.8/isos/i386/", :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.10-i386-netboot/ks.cfg b/templates/CentOS-5.10-i386-netboot/ks.cfg deleted file mode 100755 index e5d4ee09..00000000 --- a/templates/CentOS-5.10-i386-netboot/ks.cfg +++ /dev/null @@ -1,27 +0,0 @@ -install -url --url=http://mirrors.kernel.org/centos/5.10/os/i386/ -lang en_US.UTF-8 -langsupport --default=en_US.UTF-8 en_US.UTF-8 -keyboard us -text -skipx -zerombr -network --device eth0 --bootproto dhcp -rootpw vagrant -firewall --enabled --trust eth0 --ssh -selinux --disabled -authconfig --enableshadow --enablemd5 -timezone America/New_York -bootloader --location=mbr -clearpart --all --initlabel -autopart -reboot - -%packages -@ core -%post -/usr/sbin/groupadd vagrant -/usr/sbin/useradd vagrant -g vagrant -G wheel -echo "vagrant"|passwd --stdin vagrant -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -%end diff --git a/templates/CentOS-5.10-i386-netboot/ruby.sh b/templates/CentOS-5.10-i386-netboot/ruby.sh deleted file mode 100755 index 6158728d..00000000 --- a/templates/CentOS-5.10-i386-netboot/ruby.sh +++ /dev/null @@ -1,41 +0,0 @@ -# Install Ruby from sources - -# add epel repo for Ruby compile time dependencies -cat > /etc/yum.repos.d/epel.repo << EOM -[epel] -name=epel -baseurl=http://download.fedoraproject.org/pub/epel/5/\$basearch -enabled=1 -gpgcheck=0 -includepkgs=libffi* -EOM - -# Install required library packages -yum install -y gdbm-devel libffi-devel ncurses-devel - -# Install LibYAML (prerequisite for Ruby) -YAML_VERSION=0.1.4 -wget http://pyyaml.org/download/libyaml/yaml-$YAML_VERSION.tar.gz -tar xzvf yaml-$YAML_VERSION.tar.gz -cd yaml-$YAML_VERSION -./configure --prefix=/opt -make && make install -cd .. -rm -rf yaml-$YAML_VERSION -rm -f yaml-$YAML_VERSION.tar.gz - -# Install Ruby -RUBY_VERSION=1.9.3-p484 -wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-$RUBY_VERSION.tar.gz -tar xvzf ruby-$RUBY_VERSION.tar.gz -cd ruby-$RUBY_VERSION -# Fix: BSD compatibility arguments not supported by the installed version of sed -sed -i "s/sed -E/sed -e/" configure -./configure --prefix=/opt/ruby --disable-install-doc --with-opt-dir=/opt -make && make install -cd .. -rm -rf ruby-$RUBY_VERSION -rm -f ruby-$RUBY_VERSION.tar.gz - -# remove epel repo -rm -rf /etc/yum.repos.d/epel.repo \ No newline at end of file diff --git a/templates/CentOS-5.10-i386/base.sh b/templates/CentOS-5.10-i386/base.sh deleted file mode 100755 index acd9c1cd..00000000 --- a/templates/CentOS-5.10-i386/base.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Base install - -sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers -sed -i "s/^\(.*env_keep = \"\)/\1PATH /" /etc/sudoers - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms bzip2 - -yum -y erase gtk2 libX11 hicolor-icon-theme freetype bitstream-vera-fonts diff --git a/templates/CentOS-5.10-i386/cleanup.sh b/templates/CentOS-5.10-i386/cleanup.sh deleted file mode 100755 index 8b3c3670..00000000 --- a/templates/CentOS-5.10-i386/cleanup.sh +++ /dev/null @@ -1,11 +0,0 @@ -# Clean up - -yum -y clean all -rm -rf /etc/yum.repos.d/puppetlabs.repo -rm -rf VBoxGuestAdditions_*.iso - -# Remove mac address from network configuration -sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 - -# Remove DHCP leases -rm /var/lib/dhclient/*.leases \ No newline at end of file diff --git a/templates/CentOS-5.10-i386/definition.rb b/templates/CentOS-5.10-i386/definition.rb deleted file mode 100755 index 96847d21..00000000 --- a/templates/CentOS-5.10-i386/definition.rb +++ /dev/null @@ -1,42 +0,0 @@ -Veewee::Session.declare({ - :cpu_count => '1', - :memory_size=> '384', - :disk_size => '10140', - :disk_format => 'VDI', - :hostiocache => 'on', - :virtualbox => { - :vm_options => [ - "pae" => "on", - "ioapic" => "on", - ], - }, - :os_type_id => 'RedHat', - :iso_file => "CentOS-5.10-i386-bin-DVD-1of2.iso", - :iso_src => "http://mirrors.kernel.org/centos/5.10/isos/i386/CentOS-5.10-i386-bin-DVD-1of2.iso", - :iso_md5 => "ec0acc2a4f6a813ea85bf1e36acb03f0", - :iso_download_timeout => 1000, - :boot_wait => "10", - :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", - :kickstart_timeout => 10000, - :kickstart_file => "ks.cfg", - :ssh_login_timeout => "10000", - :ssh_user => "vagrant", - :ssh_password => "vagrant", - :ssh_key => "", - :ssh_host_port => "7222", - :ssh_guest_port => "22", - :sudo_cmd => "echo '%p'|sudo -S sh '%f'", - :shutdown_cmd => "/sbin/halt -h -p", - :postinstall_files => [ - "base.sh", - "ruby.sh", - "chef.sh", - "puppet.sh", - "vagrant.sh", - "virtualbox.sh", - "cleanup.sh", - "zerodisk.sh" - ], - :postinstall_timeout => 10000 -}) diff --git a/templates/CentOS-5.10-i386/ks.cfg b/templates/CentOS-5.10-i386/ks.cfg deleted file mode 100755 index 5df289a7..00000000 --- a/templates/CentOS-5.10-i386/ks.cfg +++ /dev/null @@ -1,27 +0,0 @@ -install -cdrom -lang en_US.UTF-8 -langsupport --default=en_US.UTF-8 en_US.UTF-8 -keyboard us -text -skipx -zerombr -network --device eth0 --bootproto dhcp -rootpw vagrant -firewall --enabled --trust eth0 --ssh -selinux --disabled -authconfig --enableshadow --enablemd5 -timezone America/New_York -bootloader --location=mbr -clearpart --all --initlabel -autopart -reboot - -%packages -@ core -%post -/usr/sbin/groupadd vagrant -/usr/sbin/useradd vagrant -g vagrant -G wheel -echo "vagrant"|passwd --stdin vagrant -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -%end diff --git a/templates/CentOS-5.10-i386/puppet.sh b/templates/CentOS-5.10-i386/puppet.sh deleted file mode 100755 index d1e42973..00000000 --- a/templates/CentOS-5.10-i386/puppet.sh +++ /dev/null @@ -1,17 +0,0 @@ -# Install Puppet - -cat > /etc/yum.repos.d/puppetlabs.repo << EOM -[puppetlabs-dependencies] -name=puppetlabdsdependencies -baseurl=http://yum.puppetlabs.com/el/5/dependencies/\$basearch -enabled=1 -gpgcheck=0 - -[puppetlabs] -name=puppetlabs -baseurl=http://yum.puppetlabs.com/el/5/products/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install puppet facter ruby-shadow diff --git a/templates/CentOS-5.10-i386/ruby.sh b/templates/CentOS-5.10-i386/ruby.sh deleted file mode 100755 index 6158728d..00000000 --- a/templates/CentOS-5.10-i386/ruby.sh +++ /dev/null @@ -1,41 +0,0 @@ -# Install Ruby from sources - -# add epel repo for Ruby compile time dependencies -cat > /etc/yum.repos.d/epel.repo << EOM -[epel] -name=epel -baseurl=http://download.fedoraproject.org/pub/epel/5/\$basearch -enabled=1 -gpgcheck=0 -includepkgs=libffi* -EOM - -# Install required library packages -yum install -y gdbm-devel libffi-devel ncurses-devel - -# Install LibYAML (prerequisite for Ruby) -YAML_VERSION=0.1.4 -wget http://pyyaml.org/download/libyaml/yaml-$YAML_VERSION.tar.gz -tar xzvf yaml-$YAML_VERSION.tar.gz -cd yaml-$YAML_VERSION -./configure --prefix=/opt -make && make install -cd .. -rm -rf yaml-$YAML_VERSION -rm -f yaml-$YAML_VERSION.tar.gz - -# Install Ruby -RUBY_VERSION=1.9.3-p484 -wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-$RUBY_VERSION.tar.gz -tar xvzf ruby-$RUBY_VERSION.tar.gz -cd ruby-$RUBY_VERSION -# Fix: BSD compatibility arguments not supported by the installed version of sed -sed -i "s/sed -E/sed -e/" configure -./configure --prefix=/opt/ruby --disable-install-doc --with-opt-dir=/opt -make && make install -cd .. -rm -rf ruby-$RUBY_VERSION -rm -f ruby-$RUBY_VERSION.tar.gz - -# remove epel repo -rm -rf /etc/yum.repos.d/epel.repo \ No newline at end of file diff --git a/templates/CentOS-5.10-i386/vagrant.sh b/templates/CentOS-5.10-i386/vagrant.sh deleted file mode 100755 index 1183befc..00000000 --- a/templates/CentOS-5.10-i386/vagrant.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Vagrant configuration - -date > /etc/vagrant_box_build_time - -# Installing vagrant keys -mkdir -pm 700 /home/vagrant/.ssh -wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys -chmod 0600 /home/vagrant/.ssh/authorized_keys -chown -R vagrant /home/vagrant/.ssh diff --git a/templates/CentOS-5.10-i386/virtualbox.sh b/templates/CentOS-5.10-i386/virtualbox.sh deleted file mode 100755 index bf64c760..00000000 --- a/templates/CentOS-5.10-i386/virtualbox.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Installing VirtualBox Guest Additions - -VBOX_VERSION=$(cat /home/vagrant/.vbox_version) -cd /tmp -mount -o loop /home/vagrant/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt -sh /mnt/VBoxLinuxAdditions.run -umount /mnt -rm -rf /home/vagrant/VBoxGuestAdditions_*.iso - diff --git a/templates/CentOS-5.10-x86_64-netboot/base.sh b/templates/CentOS-5.10-x86_64-netboot/base.sh deleted file mode 100755 index acd9c1cd..00000000 --- a/templates/CentOS-5.10-x86_64-netboot/base.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Base install - -sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers -sed -i "s/^\(.*env_keep = \"\)/\1PATH /" /etc/sudoers - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms bzip2 - -yum -y erase gtk2 libX11 hicolor-icon-theme freetype bitstream-vera-fonts diff --git a/templates/CentOS-5.10-x86_64-netboot/chef.sh b/templates/CentOS-5.10-x86_64-netboot/chef.sh deleted file mode 100755 index 9ea4fb83..00000000 --- a/templates/CentOS-5.10-x86_64-netboot/chef.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Install Chef - -curl -L https://www.opscode.com/chef/install.sh | sudo bash diff --git a/templates/CentOS-5.10-x86_64-netboot/cleanup.sh b/templates/CentOS-5.10-x86_64-netboot/cleanup.sh deleted file mode 100755 index 8b3c3670..00000000 --- a/templates/CentOS-5.10-x86_64-netboot/cleanup.sh +++ /dev/null @@ -1,11 +0,0 @@ -# Clean up - -yum -y clean all -rm -rf /etc/yum.repos.d/puppetlabs.repo -rm -rf VBoxGuestAdditions_*.iso - -# Remove mac address from network configuration -sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 - -# Remove DHCP leases -rm /var/lib/dhclient/*.leases \ No newline at end of file diff --git a/templates/CentOS-5.10-x86_64-netboot/definition.rb b/templates/CentOS-5.10-x86_64-netboot/definition.rb deleted file mode 100755 index fa619f52..00000000 --- a/templates/CentOS-5.10-x86_64-netboot/definition.rb +++ /dev/null @@ -1,42 +0,0 @@ -Veewee::Session.declare({ - :cpu_count => '1', - :memory_size=> '384', - :disk_size => '10140', - :disk_format => 'VDI', - :hostiocache => 'on', - :virtualbox => { - :vm_options => [ - "pae" => "on", - "ioapic" => "on", - ], - }, - :os_type_id => 'RedHat_64', - :iso_file => "CentOS-5.10-x86_64-netinstall.iso", - :iso_src => "http://mirrors.kernel.org/centos/5.10/isos/x86_64/CentOS-5.10-x86_64-netinstall.iso", - :iso_md5 => "e09e44f04f0a4b97b04935e0ba88833f", - :iso_download_timeout => 1000, - :boot_wait => "10", - :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", - :kickstart_timeout => 10000, - :kickstart_file => "ks.cfg", - :ssh_login_timeout => "10000", - :ssh_user => "vagrant", - :ssh_password => "vagrant", - :ssh_key => "", - :ssh_host_port => "7222", - :ssh_guest_port => "22", - :sudo_cmd => "echo '%p'|sudo -S sh '%f'", - :shutdown_cmd => "/sbin/halt -h -p", - :postinstall_files => [ - "base.sh", - "ruby.sh", - "chef.sh", - "puppet.sh", - "vagrant.sh", - "virtualbox.sh", - "cleanup.sh", - "zerodisk.sh" - ], - :postinstall_timeout => 10000 -}) diff --git a/templates/CentOS-5.10-x86_64-netboot/puppet.sh b/templates/CentOS-5.10-x86_64-netboot/puppet.sh deleted file mode 100755 index d1e42973..00000000 --- a/templates/CentOS-5.10-x86_64-netboot/puppet.sh +++ /dev/null @@ -1,17 +0,0 @@ -# Install Puppet - -cat > /etc/yum.repos.d/puppetlabs.repo << EOM -[puppetlabs-dependencies] -name=puppetlabdsdependencies -baseurl=http://yum.puppetlabs.com/el/5/dependencies/\$basearch -enabled=1 -gpgcheck=0 - -[puppetlabs] -name=puppetlabs -baseurl=http://yum.puppetlabs.com/el/5/products/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install puppet facter ruby-shadow diff --git a/templates/CentOS-5.10-x86_64-netboot/vagrant.sh b/templates/CentOS-5.10-x86_64-netboot/vagrant.sh deleted file mode 100755 index 1183befc..00000000 --- a/templates/CentOS-5.10-x86_64-netboot/vagrant.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Vagrant configuration - -date > /etc/vagrant_box_build_time - -# Installing vagrant keys -mkdir -pm 700 /home/vagrant/.ssh -wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys -chmod 0600 /home/vagrant/.ssh/authorized_keys -chown -R vagrant /home/vagrant/.ssh diff --git a/templates/CentOS-5.10-x86_64-netboot/virtualbox.sh b/templates/CentOS-5.10-x86_64-netboot/virtualbox.sh deleted file mode 100755 index bf64c760..00000000 --- a/templates/CentOS-5.10-x86_64-netboot/virtualbox.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Installing VirtualBox Guest Additions - -VBOX_VERSION=$(cat /home/vagrant/.vbox_version) -cd /tmp -mount -o loop /home/vagrant/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt -sh /mnt/VBoxLinuxAdditions.run -umount /mnt -rm -rf /home/vagrant/VBoxGuestAdditions_*.iso - diff --git a/templates/CentOS-5.10-x86_64/base.sh b/templates/CentOS-5.10-x86_64/base.sh deleted file mode 100755 index acd9c1cd..00000000 --- a/templates/CentOS-5.10-x86_64/base.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Base install - -sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers -sed -i "s/^\(.*env_keep = \"\)/\1PATH /" /etc/sudoers - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms bzip2 - -yum -y erase gtk2 libX11 hicolor-icon-theme freetype bitstream-vera-fonts diff --git a/templates/CentOS-5.10-x86_64/chef.sh b/templates/CentOS-5.10-x86_64/chef.sh deleted file mode 100755 index 9ea4fb83..00000000 --- a/templates/CentOS-5.10-x86_64/chef.sh +++ /dev/null @@ -1,3 +0,0 @@ -# Install Chef - -curl -L https://www.opscode.com/chef/install.sh | sudo bash diff --git a/templates/CentOS-5.10-x86_64/cleanup.sh b/templates/CentOS-5.10-x86_64/cleanup.sh deleted file mode 100755 index 8b3c3670..00000000 --- a/templates/CentOS-5.10-x86_64/cleanup.sh +++ /dev/null @@ -1,11 +0,0 @@ -# Clean up - -yum -y clean all -rm -rf /etc/yum.repos.d/puppetlabs.repo -rm -rf VBoxGuestAdditions_*.iso - -# Remove mac address from network configuration -sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 - -# Remove DHCP leases -rm /var/lib/dhclient/*.leases \ No newline at end of file diff --git a/templates/CentOS-5.10-x86_64/definition.rb b/templates/CentOS-5.10-x86_64/definition.rb deleted file mode 100755 index c35bfb30..00000000 --- a/templates/CentOS-5.10-x86_64/definition.rb +++ /dev/null @@ -1,42 +0,0 @@ -Veewee::Session.declare({ - :cpu_count => '1', - :memory_size=> '384', - :disk_size => '10140', - :disk_format => 'VDI', - :hostiocache => 'on', - :virtualbox => { - :vm_options => [ - "pae" => "on", - "ioapic" => "on", - ], - }, - :os_type_id => 'RedHat_64', - :iso_file => "CentOS-5.10-x86_64-bin-DVD-1of2.iso", - :iso_src => "http://mirrors.kernel.org/centos/5.10/isos/x86_64/CentOS-5.10-x86_64-bin-DVD-1of2.iso", - :iso_md5 => "715f7355074c00530cd6ee1d9f43cc3f", - :iso_download_timeout => 1000, - :boot_wait => "10", - :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", - :kickstart_timeout => 10000, - :kickstart_file => "ks.cfg", - :ssh_login_timeout => "10000", - :ssh_user => "vagrant", - :ssh_password => "vagrant", - :ssh_key => "", - :ssh_host_port => "7222", - :ssh_guest_port => "22", - :sudo_cmd => "echo '%p'|sudo -S sh '%f'", - :shutdown_cmd => "/sbin/halt -h -p", - :postinstall_files => [ - "base.sh", - "ruby.sh", - "chef.sh", - "puppet.sh", - "vagrant.sh", - "virtualbox.sh", - "cleanup.sh", - "zerodisk.sh" - ], - :postinstall_timeout => 10000 -}) diff --git a/templates/CentOS-5.10-x86_64/ks.cfg b/templates/CentOS-5.10-x86_64/ks.cfg deleted file mode 100755 index 5df289a7..00000000 --- a/templates/CentOS-5.10-x86_64/ks.cfg +++ /dev/null @@ -1,27 +0,0 @@ -install -cdrom -lang en_US.UTF-8 -langsupport --default=en_US.UTF-8 en_US.UTF-8 -keyboard us -text -skipx -zerombr -network --device eth0 --bootproto dhcp -rootpw vagrant -firewall --enabled --trust eth0 --ssh -selinux --disabled -authconfig --enableshadow --enablemd5 -timezone America/New_York -bootloader --location=mbr -clearpart --all --initlabel -autopart -reboot - -%packages -@ core -%post -/usr/sbin/groupadd vagrant -/usr/sbin/useradd vagrant -g vagrant -G wheel -echo "vagrant"|passwd --stdin vagrant -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -%end diff --git a/templates/CentOS-5.10-x86_64/puppet.sh b/templates/CentOS-5.10-x86_64/puppet.sh deleted file mode 100755 index d1e42973..00000000 --- a/templates/CentOS-5.10-x86_64/puppet.sh +++ /dev/null @@ -1,17 +0,0 @@ -# Install Puppet - -cat > /etc/yum.repos.d/puppetlabs.repo << EOM -[puppetlabs-dependencies] -name=puppetlabdsdependencies -baseurl=http://yum.puppetlabs.com/el/5/dependencies/\$basearch -enabled=1 -gpgcheck=0 - -[puppetlabs] -name=puppetlabs -baseurl=http://yum.puppetlabs.com/el/5/products/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install puppet facter ruby-shadow diff --git a/templates/CentOS-5.10-x86_64/ruby.sh b/templates/CentOS-5.10-x86_64/ruby.sh deleted file mode 100755 index 6158728d..00000000 --- a/templates/CentOS-5.10-x86_64/ruby.sh +++ /dev/null @@ -1,41 +0,0 @@ -# Install Ruby from sources - -# add epel repo for Ruby compile time dependencies -cat > /etc/yum.repos.d/epel.repo << EOM -[epel] -name=epel -baseurl=http://download.fedoraproject.org/pub/epel/5/\$basearch -enabled=1 -gpgcheck=0 -includepkgs=libffi* -EOM - -# Install required library packages -yum install -y gdbm-devel libffi-devel ncurses-devel - -# Install LibYAML (prerequisite for Ruby) -YAML_VERSION=0.1.4 -wget http://pyyaml.org/download/libyaml/yaml-$YAML_VERSION.tar.gz -tar xzvf yaml-$YAML_VERSION.tar.gz -cd yaml-$YAML_VERSION -./configure --prefix=/opt -make && make install -cd .. -rm -rf yaml-$YAML_VERSION -rm -f yaml-$YAML_VERSION.tar.gz - -# Install Ruby -RUBY_VERSION=1.9.3-p484 -wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-$RUBY_VERSION.tar.gz -tar xvzf ruby-$RUBY_VERSION.tar.gz -cd ruby-$RUBY_VERSION -# Fix: BSD compatibility arguments not supported by the installed version of sed -sed -i "s/sed -E/sed -e/" configure -./configure --prefix=/opt/ruby --disable-install-doc --with-opt-dir=/opt -make && make install -cd .. -rm -rf ruby-$RUBY_VERSION -rm -f ruby-$RUBY_VERSION.tar.gz - -# remove epel repo -rm -rf /etc/yum.repos.d/epel.repo \ No newline at end of file diff --git a/templates/CentOS-5.10-x86_64/vagrant.sh b/templates/CentOS-5.10-x86_64/vagrant.sh deleted file mode 100755 index 1183befc..00000000 --- a/templates/CentOS-5.10-x86_64/vagrant.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Vagrant configuration - -date > /etc/vagrant_box_build_time - -# Installing vagrant keys -mkdir -pm 700 /home/vagrant/.ssh -wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys -chmod 0600 /home/vagrant/.ssh/authorized_keys -chown -R vagrant /home/vagrant/.ssh diff --git a/templates/CentOS-5.10-x86_64/virtualbox.sh b/templates/CentOS-5.10-x86_64/virtualbox.sh deleted file mode 100755 index bf64c760..00000000 --- a/templates/CentOS-5.10-x86_64/virtualbox.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Installing VirtualBox Guest Additions - -VBOX_VERSION=$(cat /home/vagrant/.vbox_version) -cd /tmp -mount -o loop /home/vagrant/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt -sh /mnt/VBoxLinuxAdditions.run -umount /mnt -rm -rf /home/vagrant/VBoxGuestAdditions_*.iso - diff --git a/templates/CentOS-5.10-i386-netboot/base.sh b/templates/CentOS-5.10/base.sh similarity index 100% rename from templates/CentOS-5.10-i386-netboot/base.sh rename to templates/CentOS-5.10/base.sh diff --git a/templates/CentOS-5.10/centos_32_dvd.yml b/templates/CentOS-5.10/centos_32_dvd.yml new file mode 100644 index 00000000..4a23f125 --- /dev/null +++ b/templates/CentOS-5.10/centos_32_dvd.yml @@ -0,0 +1,6 @@ +--- +:os_type_id: 'RedHat' +:iso_file: "CentOS-5.10-i386-bin-DVD-1of2.iso" +:iso_src: "http://mirror.symnds.com/distributions/CentOS-vault/5.10/isos/i386/CentOS-5.10-i386-bin-DVD-1of2.iso" +--- for EU use: :iso_src: "http://mirror.nsc.liu.se/centos-store/5.10/isos/i386/CentOS-5.10-i386-bin-DVD-1of2.iso" +:iso_md5: "ec0acc2a4f6a813ea85bf1e36acb03f0" diff --git a/templates/CentOS-5.10/centos_32_net.yml b/templates/CentOS-5.10/centos_32_net.yml new file mode 100644 index 00000000..c7e7f3e9 --- /dev/null +++ b/templates/CentOS-5.10/centos_32_net.yml @@ -0,0 +1,6 @@ +--- +:os_type_id: 'RedHat' +:iso_file: "CentOS-5.10-i386-netinstall.iso" +:iso_src: "http://mirror.symnds.com/distributions/CentOS-vault/5.10/isos/i386/CentOS-5.10-i386-netinstall.iso" +--- for EU use: :iso_src: "http://mirror.nsc.liu.se/centos-store/5.10/isos/i386/CentOS-5.10-i386-netinstall.iso" +:iso_md5: "8d19b12cb5f65a4b5c2bc61a98abf80c" diff --git a/templates/CentOS-5.10/centos_64_dvd.yml b/templates/CentOS-5.10/centos_64_dvd.yml new file mode 100644 index 00000000..ac0566d5 --- /dev/null +++ b/templates/CentOS-5.10/centos_64_dvd.yml @@ -0,0 +1,6 @@ +--- +:os_type_id: 'RedHat_64' +:iso_file: "CentOS-5.10-x86_64-bin-DVD-1of2.iso" +:iso_src: "http://mirror.symnds.com/distributions/CentOS-vault/5.10/isos/x86_64/CentOS-5.10-x86_64-bin-DVD-1of2.iso" +--- for EU use: :iso_src: "http://mirror.nsc.liu.se/centos-store/5.10/isos/x86_64/CentOS-5.10-x86_64-bin-DVD-1of2.iso" +:iso_md5: "715f7355074c00530cd6ee1d9f43cc3f" diff --git a/templates/CentOS-5.10/centos_64_net.yml b/templates/CentOS-5.10/centos_64_net.yml new file mode 100644 index 00000000..c75d8176 --- /dev/null +++ b/templates/CentOS-5.10/centos_64_net.yml @@ -0,0 +1,6 @@ +--- +:os_type_id: 'RedHat_64' +:iso_file: "CentOS-5.10-x86_64-netinstall.iso" +:iso_src: "http://mirror.symnds.com/distributions/CentOS-vault/5.10/isos/x86_64/CentOS-5.10-x86_64-netinstall.iso" +--- for EU use: :iso_src: "http://mirror.nsc.liu.se/centos-store/5.10/isos/x86_64/CentOS-5.10-x86_64-netinstall.iso" +:iso_md5: "e09e44f04f0a4b97b04935e0ba88833f" diff --git a/templates/CentOS-5.10-i386-netboot/chef.sh b/templates/CentOS-5.10/chef.sh similarity index 100% rename from templates/CentOS-5.10-i386-netboot/chef.sh rename to templates/CentOS-5.10/chef.sh diff --git a/templates/CentOS-5.10-i386-netboot/cleanup.sh b/templates/CentOS-5.10/cleanup.sh similarity index 88% rename from templates/CentOS-5.10-i386-netboot/cleanup.sh rename to templates/CentOS-5.10/cleanup.sh index 8b3c3670..4373031b 100755 --- a/templates/CentOS-5.10-i386-netboot/cleanup.sh +++ b/templates/CentOS-5.10/cleanup.sh @@ -8,4 +8,4 @@ rm -rf VBoxGuestAdditions_*.iso sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 # Remove DHCP leases -rm /var/lib/dhclient/*.leases \ No newline at end of file +rm /var/lib/dhclient/*.leases diff --git a/templates/CentOS-5.10/definition.rb b/templates/CentOS-5.10/definition.rb new file mode 100755 index 00000000..70eab37c --- /dev/null +++ b/templates/CentOS-5.10/definition.rb @@ -0,0 +1,5 @@ +# +# change centos_64_dvd to one of configurations in *.yml in this directory +# use the yml files to configure +# +Veewee::Definition.declare_yaml('definition.yml', "centos_64_dvd.yml") diff --git a/templates/CentOS-5.10/definition.yml b/templates/CentOS-5.10/definition.yml new file mode 100644 index 00000000..4c166854 --- /dev/null +++ b/templates/CentOS-5.10/definition.yml @@ -0,0 +1,35 @@ +--- +:cpu_count: '1' +:memory_size: '384' +:disk_size: '10140' +:disk_format: 'VDI' +:hostiocache: 'on' +:virtualbox: + :vm_options: + "pae": "on" + "ioapic": "on" +:iso_download_timeout: 1000 +:boot_wait: "10" +:boot_cmd_sequence: + - 'linux text ks=http://%IP%:%PORT%/ks.cfg ' +:kickstart_port: "7122" +:kickstart_timeout: 300 +:kickstart_file: "ks.cfg.erb" +:ssh_login_timeout: "10000" +:ssh_user: "vagrant" +:ssh_password: "vagrant" +:ssh_key: "" +:ssh_host_port: "7222" +:ssh_guest_port: "22" +:sudo_cmd: "echo '%p'|sudo -S sh '%f'" +:shutdown_cmd: "/sbin/halt -h -p" +:postinstall_files: + - "base.sh" + - "ruby.sh" + - "chef.sh" + - "puppet.sh" + - "vagrant.sh" + - "virtualbox.sh" + - "cleanup.sh" + - "zerodisk.sh" +:postinstall_timeout: 10000 diff --git a/templates/CentOS-5.10-x86_64-netboot/ks.cfg b/templates/CentOS-5.10/ks.cfg.erb similarity index 78% rename from templates/CentOS-5.10-x86_64-netboot/ks.cfg rename to templates/CentOS-5.10/ks.cfg.erb index aba2bb5d..aafbf021 100755 --- a/templates/CentOS-5.10-x86_64-netboot/ks.cfg +++ b/templates/CentOS-5.10/ks.cfg.erb @@ -1,5 +1,11 @@ install +<% if definition.iso_file =~ /DVD/ %> +cdrom +<% elsif definition.os_type_id == "RedHat" %> +url --url=http://mirrors.kernel.org/centos/5.10/os/i386/ +<% else %> url --url=http://mirrors.kernel.org/centos/5.10/os/x86_64/ +<% end %> lang en_US.UTF-8 langsupport --default=en_US.UTF-8 en_US.UTF-8 keyboard us diff --git a/templates/CentOS-5.10-i386-netboot/puppet.sh b/templates/CentOS-5.10/puppet.sh similarity index 100% rename from templates/CentOS-5.10-i386-netboot/puppet.sh rename to templates/CentOS-5.10/puppet.sh diff --git a/templates/CentOS-5.10-x86_64-netboot/ruby.sh b/templates/CentOS-5.10/ruby.sh similarity index 96% rename from templates/CentOS-5.10-x86_64-netboot/ruby.sh rename to templates/CentOS-5.10/ruby.sh index 6158728d..d34fedcc 100755 --- a/templates/CentOS-5.10-x86_64-netboot/ruby.sh +++ b/templates/CentOS-5.10/ruby.sh @@ -38,4 +38,4 @@ rm -rf ruby-$RUBY_VERSION rm -f ruby-$RUBY_VERSION.tar.gz # remove epel repo -rm -rf /etc/yum.repos.d/epel.repo \ No newline at end of file +rm -rf /etc/yum.repos.d/epel.repo diff --git a/templates/CentOS-5.10-i386-netboot/vagrant.sh b/templates/CentOS-5.10/vagrant.sh similarity index 100% rename from templates/CentOS-5.10-i386-netboot/vagrant.sh rename to templates/CentOS-5.10/vagrant.sh diff --git a/templates/CentOS-5.10-i386-netboot/virtualbox.sh b/templates/CentOS-5.10/virtualbox.sh similarity index 100% rename from templates/CentOS-5.10-i386-netboot/virtualbox.sh rename to templates/CentOS-5.10/virtualbox.sh diff --git a/templates/CentOS-5.10-i386-netboot/zerodisk.sh b/templates/CentOS-5.10/zerodisk.sh similarity index 100% rename from templates/CentOS-5.10-i386-netboot/zerodisk.sh rename to templates/CentOS-5.10/zerodisk.sh diff --git a/templates/CentOS-5.5-i386-netboot/definition.rb b/templates/CentOS-5.5-i386-netboot/definition.rb index 12b53871..e53c70ec 100644 --- a/templates/CentOS-5.5-i386-netboot/definition.rb +++ b/templates/CentOS-5.5-i386-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "0172883a3039772165db073693debae5", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "600", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.5-x86_64-netboot/definition.rb b/templates/CentOS-5.5-x86_64-netboot/definition.rb index 3c73e7e5..86f3e512 100644 --- a/templates/CentOS-5.5-x86_64-netboot/definition.rb +++ b/templates/CentOS-5.5-x86_64-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "560a964657c92508ae110a35cb963632", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "600", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.6-i386-netboot/definition.rb b/templates/CentOS-5.6-i386-netboot/definition.rb index 656bc095..10a5cfe6 100644 --- a/templates/CentOS-5.6-i386-netboot/definition.rb +++ b/templates/CentOS-5.6-i386-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "a710105f7f9fe3516f08f6f8514ed2b0", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.6-i386/definition.rb b/templates/CentOS-5.6-i386/definition.rb index ea86c0d4..3af7c7e9 100644 --- a/templates/CentOS-5.6-i386/definition.rb +++ b/templates/CentOS-5.6-i386/definition.rb @@ -8,7 +8,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.6-i386/ks.cfg b/templates/CentOS-5.6-i386/ks.cfg index 65bd2faa..519c1b10 100644 --- a/templates/CentOS-5.6-i386/ks.cfg +++ b/templates/CentOS-5.6-i386/ks.cfg @@ -42,4 +42,4 @@ lvm2 /usr/sbin/groupadd vagrant /usr/sbin/useradd vagrant -g vagrant -G wheel echo "vagrant"|passwd --stdin vagrant -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ No newline at end of file +echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers diff --git a/templates/CentOS-5.6-x86_64-netboot-packages/definition.rb b/templates/CentOS-5.6-x86_64-netboot-packages/definition.rb index 81f6ddf6..6ef7f391 100644 --- a/templates/CentOS-5.6-x86_64-netboot-packages/definition.rb +++ b/templates/CentOS-5.6-x86_64-netboot-packages/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "02cf3a5e32aaa5eed27af775ad292beb", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.6-x86_64-netboot/definition.rb b/templates/CentOS-5.6-x86_64-netboot/definition.rb index 81f6ddf6..6ef7f391 100644 --- a/templates/CentOS-5.6-x86_64-netboot/definition.rb +++ b/templates/CentOS-5.6-x86_64-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "02cf3a5e32aaa5eed27af775ad292beb", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.7-i386-netboot/definition.rb b/templates/CentOS-5.7-i386-netboot/definition.rb index 9afe4ee4..86f0fa85 100644 --- a/templates/CentOS-5.7-i386-netboot/definition.rb +++ b/templates/CentOS-5.7-i386-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "11222d9134cdfc101f6f91fe544254c9", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.7-i386-netboot/ks.cfg b/templates/CentOS-5.7-i386-netboot/ks.cfg index 3717f892..26f674ef 100644 --- a/templates/CentOS-5.7-i386-netboot/ks.cfg +++ b/templates/CentOS-5.7-i386-netboot/ks.cfg @@ -44,4 +44,4 @@ kernel-headers /usr/sbin/groupadd vagrant /usr/sbin/useradd vagrant -g vagrant -G wheel echo "vagrant"|passwd --stdin vagrant -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ No newline at end of file +echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers diff --git a/templates/CentOS-5.7-x86_64-netboot/definition.rb b/templates/CentOS-5.7-x86_64-netboot/definition.rb index 3f920b88..d0c2f350 100644 --- a/templates/CentOS-5.7-x86_64-netboot/definition.rb +++ b/templates/CentOS-5.7-x86_64-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "5db3d49ba7a2c56810822914fadc1edf", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.8-i386-netboot/definition.rb b/templates/CentOS-5.8-i386-netboot/definition.rb index cf747b00..a881b06b 100644 --- a/templates/CentOS-5.8-i386-netboot/definition.rb +++ b/templates/CentOS-5.8-i386-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "3812865e426b55fde9a9931990e4a16c", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.8-i386-netboot/ks.cfg b/templates/CentOS-5.8-i386-netboot/ks.cfg index 45f579d5..861ff23d 100644 --- a/templates/CentOS-5.8-i386-netboot/ks.cfg +++ b/templates/CentOS-5.8-i386-netboot/ks.cfg @@ -44,4 +44,4 @@ kernel-headers /usr/sbin/groupadd vagrant /usr/sbin/useradd vagrant -g vagrant -G wheel echo "vagrant"|passwd --stdin vagrant -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ No newline at end of file +echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers diff --git a/templates/CentOS-5.8-i386/definition.rb b/templates/CentOS-5.8-i386/definition.rb index d768ea38..2cd2b9a3 100644 --- a/templates/CentOS-5.8-i386/definition.rb +++ b/templates/CentOS-5.8-i386/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "0fdd45c43b5d8fb9e05f4255c5855f9c", :iso_download_timeout => 10000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.8-i386/ks.cfg b/templates/CentOS-5.8-i386/ks.cfg index 270bd444..57a1c499 100644 --- a/templates/CentOS-5.8-i386/ks.cfg +++ b/templates/CentOS-5.8-i386/ks.cfg @@ -44,4 +44,4 @@ kernel-headers /usr/sbin/groupadd vagrant /usr/sbin/useradd vagrant -g vagrant -G wheel echo "vagrant"|passwd --stdin vagrant -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ No newline at end of file +echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers diff --git a/templates/CentOS-5.8-x86_64-netboot/definition.rb b/templates/CentOS-5.8-x86_64-netboot/definition.rb index b59fdb4c..a89c8ce5 100644 --- a/templates/CentOS-5.8-x86_64-netboot/definition.rb +++ b/templates/CentOS-5.8-x86_64-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "6425035e9adee4b8653a85f59877ac5b", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.8-x86_64-reallyminimal/definition.rb b/templates/CentOS-5.8-x86_64-reallyminimal/definition.rb index ab616ef2..d570c5b6 100644 --- a/templates/CentOS-5.8-x86_64-reallyminimal/definition.rb +++ b/templates/CentOS-5.8-x86_64-reallyminimal/definition.rb @@ -12,7 +12,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/CentOS-5.8-x86_64/definition.rb b/templates/CentOS-5.8-x86_64/definition.rb index 7c25ac09..aed649c8 100644 --- a/templates/CentOS-5.8-x86_64/definition.rb +++ b/templates/CentOS-5.8-x86_64/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "8a3bf0030f192022943f83fe6b2cf373", :iso_download_timeout => 10000, :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/CentOS-5.9-i386-netboot/cleanup.sh b/templates/CentOS-5.9-i386-netboot/cleanup.sh index 8b3c3670..4373031b 100644 --- a/templates/CentOS-5.9-i386-netboot/cleanup.sh +++ b/templates/CentOS-5.9-i386-netboot/cleanup.sh @@ -8,4 +8,4 @@ rm -rf VBoxGuestAdditions_*.iso sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 # Remove DHCP leases -rm /var/lib/dhclient/*.leases \ No newline at end of file +rm /var/lib/dhclient/*.leases diff --git a/templates/CentOS-5.9-i386-netboot/definition.rb b/templates/CentOS-5.9-i386-netboot/definition.rb index 0ac6eef5..127e0c2b 100644 --- a/templates/CentOS-5.9-i386-netboot/definition.rb +++ b/templates/CentOS-5.9-i386-netboot/definition.rb @@ -18,7 +18,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/CentOS-5.9-i386-netboot/ruby.sh b/templates/CentOS-5.9-i386-netboot/ruby.sh index 6158728d..d34fedcc 100644 --- a/templates/CentOS-5.9-i386-netboot/ruby.sh +++ b/templates/CentOS-5.9-i386-netboot/ruby.sh @@ -38,4 +38,4 @@ rm -rf ruby-$RUBY_VERSION rm -f ruby-$RUBY_VERSION.tar.gz # remove epel repo -rm -rf /etc/yum.repos.d/epel.repo \ No newline at end of file +rm -rf /etc/yum.repos.d/epel.repo diff --git a/templates/CentOS-5.9-i386/cleanup.sh b/templates/CentOS-5.9-i386/cleanup.sh index 8b3c3670..4373031b 100644 --- a/templates/CentOS-5.9-i386/cleanup.sh +++ b/templates/CentOS-5.9-i386/cleanup.sh @@ -8,4 +8,4 @@ rm -rf VBoxGuestAdditions_*.iso sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 # Remove DHCP leases -rm /var/lib/dhclient/*.leases \ No newline at end of file +rm /var/lib/dhclient/*.leases diff --git a/templates/CentOS-5.9-i386/definition.rb b/templates/CentOS-5.9-i386/definition.rb index ae721328..359c668f 100644 --- a/templates/CentOS-5.9-i386/definition.rb +++ b/templates/CentOS-5.9-i386/definition.rb @@ -18,7 +18,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/CentOS-5.9-i386/ruby.sh b/templates/CentOS-5.9-i386/ruby.sh index 6158728d..d34fedcc 100644 --- a/templates/CentOS-5.9-i386/ruby.sh +++ b/templates/CentOS-5.9-i386/ruby.sh @@ -38,4 +38,4 @@ rm -rf ruby-$RUBY_VERSION rm -f ruby-$RUBY_VERSION.tar.gz # remove epel repo -rm -rf /etc/yum.repos.d/epel.repo \ No newline at end of file +rm -rf /etc/yum.repos.d/epel.repo diff --git a/templates/CentOS-5.9-x86_64-netboot/cleanup.sh b/templates/CentOS-5.9-x86_64-netboot/cleanup.sh index 8b3c3670..4373031b 100644 --- a/templates/CentOS-5.9-x86_64-netboot/cleanup.sh +++ b/templates/CentOS-5.9-x86_64-netboot/cleanup.sh @@ -8,4 +8,4 @@ rm -rf VBoxGuestAdditions_*.iso sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 # Remove DHCP leases -rm /var/lib/dhclient/*.leases \ No newline at end of file +rm /var/lib/dhclient/*.leases diff --git a/templates/CentOS-5.9-x86_64-netboot/definition.rb b/templates/CentOS-5.9-x86_64-netboot/definition.rb index b5f65a5d..274d0d31 100644 --- a/templates/CentOS-5.9-x86_64-netboot/definition.rb +++ b/templates/CentOS-5.9-x86_64-netboot/definition.rb @@ -18,7 +18,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/CentOS-5.9-x86_64-netboot/ruby.sh b/templates/CentOS-5.9-x86_64-netboot/ruby.sh index 6158728d..d34fedcc 100644 --- a/templates/CentOS-5.9-x86_64-netboot/ruby.sh +++ b/templates/CentOS-5.9-x86_64-netboot/ruby.sh @@ -38,4 +38,4 @@ rm -rf ruby-$RUBY_VERSION rm -f ruby-$RUBY_VERSION.tar.gz # remove epel repo -rm -rf /etc/yum.repos.d/epel.repo \ No newline at end of file +rm -rf /etc/yum.repos.d/epel.repo diff --git a/templates/CentOS-5.9-x86_64/cleanup.sh b/templates/CentOS-5.9-x86_64/cleanup.sh index 8b3c3670..4373031b 100644 --- a/templates/CentOS-5.9-x86_64/cleanup.sh +++ b/templates/CentOS-5.9-x86_64/cleanup.sh @@ -8,4 +8,4 @@ rm -rf VBoxGuestAdditions_*.iso sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 # Remove DHCP leases -rm /var/lib/dhclient/*.leases \ No newline at end of file +rm /var/lib/dhclient/*.leases diff --git a/templates/CentOS-5.9-x86_64/definition.rb b/templates/CentOS-5.9-x86_64/definition.rb index 2deee749..e56e0e7c 100644 --- a/templates/CentOS-5.9-x86_64/definition.rb +++ b/templates/CentOS-5.9-x86_64/definition.rb @@ -18,7 +18,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/CentOS-5.9-x86_64/ruby.sh b/templates/CentOS-5.9-x86_64/ruby.sh index 6158728d..d34fedcc 100644 --- a/templates/CentOS-5.9-x86_64/ruby.sh +++ b/templates/CentOS-5.9-x86_64/ruby.sh @@ -38,4 +38,4 @@ rm -rf ruby-$RUBY_VERSION rm -f ruby-$RUBY_VERSION.tar.gz # remove epel repo -rm -rf /etc/yum.repos.d/epel.repo \ No newline at end of file +rm -rf /etc/yum.repos.d/epel.repo diff --git a/templates/CentOS-6.0-i386-netboot/chef.sh b/templates/CentOS-6.0-i386-netboot/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.0-i386-netboot/chef.sh +++ b/templates/CentOS-6.0-i386-netboot/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.0-i386-netboot/definition.rb b/templates/CentOS-6.0-i386-netboot/definition.rb index 13803bf1..433cd54a 100644 --- a/templates/CentOS-6.0-i386-netboot/definition.rb +++ b/templates/CentOS-6.0-i386-netboot/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.0-i386/chef.sh b/templates/CentOS-6.0-i386/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.0-i386/chef.sh +++ b/templates/CentOS-6.0-i386/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.0-i386/definition.rb b/templates/CentOS-6.0-i386/definition.rb index 2fbbc021..07e67654 100644 --- a/templates/CentOS-6.0-i386/definition.rb +++ b/templates/CentOS-6.0-i386/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.0-x86_64-minimal/chef.sh b/templates/CentOS-6.0-x86_64-minimal/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.0-x86_64-minimal/chef.sh +++ b/templates/CentOS-6.0-x86_64-minimal/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.0-x86_64-minimal/definition.rb b/templates/CentOS-6.0-x86_64-minimal/definition.rb index 805a9ce4..83543d0e 100644 --- a/templates/CentOS-6.0-x86_64-minimal/definition.rb +++ b/templates/CentOS-6.0-x86_64-minimal/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.0-x86_64-netboot/chef.sh b/templates/CentOS-6.0-x86_64-netboot/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.0-x86_64-netboot/chef.sh +++ b/templates/CentOS-6.0-x86_64-netboot/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.0-x86_64-netboot/definition.rb b/templates/CentOS-6.0-x86_64-netboot/definition.rb index e4b111e8..ba45fc9b 100644 --- a/templates/CentOS-6.0-x86_64-netboot/definition.rb +++ b/templates/CentOS-6.0-x86_64-netboot/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.0-x86_64/chef.sh b/templates/CentOS-6.0-x86_64/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.0-x86_64/chef.sh +++ b/templates/CentOS-6.0-x86_64/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.0-x86_64/definition.rb b/templates/CentOS-6.0-x86_64/definition.rb index a03d46eb..58ce851b 100644 --- a/templates/CentOS-6.0-x86_64/definition.rb +++ b/templates/CentOS-6.0-x86_64/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.1-x86_64-minimal/chef.sh b/templates/CentOS-6.1-x86_64-minimal/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.1-x86_64-minimal/chef.sh +++ b/templates/CentOS-6.1-x86_64-minimal/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.1-x86_64-minimal/definition.rb b/templates/CentOS-6.1-x86_64-minimal/definition.rb index c0902a43..27b45e19 100644 --- a/templates/CentOS-6.1-x86_64-minimal/definition.rb +++ b/templates/CentOS-6.1-x86_64-minimal/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.1-x86_64-netboot/chef.sh b/templates/CentOS-6.1-x86_64-netboot/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.1-x86_64-netboot/chef.sh +++ b/templates/CentOS-6.1-x86_64-netboot/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.1-x86_64-netboot/definition.rb b/templates/CentOS-6.1-x86_64-netboot/definition.rb index 53d9a381..f26024fe 100644 --- a/templates/CentOS-6.1-x86_64-netboot/definition.rb +++ b/templates/CentOS-6.1-x86_64-netboot/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.2-i386-minimal/definition.rb b/templates/CentOS-6.2-i386-minimal/definition.rb index 124cfcda..5d9f32e1 100644 --- a/templates/CentOS-6.2-i386-minimal/definition.rb +++ b/templates/CentOS-6.2-i386-minimal/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.2-x86_64-minimal/definition.rb b/templates/CentOS-6.2-x86_64-minimal/definition.rb index 48708e13..f458bf12 100644 --- a/templates/CentOS-6.2-x86_64-minimal/definition.rb +++ b/templates/CentOS-6.2-x86_64-minimal/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.2-x86_64-netboot/definition.rb b/templates/CentOS-6.2-x86_64-netboot/definition.rb index 6655a45e..a2c2168e 100644 --- a/templates/CentOS-6.2-x86_64-netboot/definition.rb +++ b/templates/CentOS-6.2-x86_64-netboot/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.3-i386-minimal/chef.sh b/templates/CentOS-6.3-i386-minimal/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.3-i386-minimal/chef.sh +++ b/templates/CentOS-6.3-i386-minimal/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.3-i386-minimal/definition.rb b/templates/CentOS-6.3-i386-minimal/definition.rb index bdc1baa0..c6b1df07 100644 --- a/templates/CentOS-6.3-i386-minimal/definition.rb +++ b/templates/CentOS-6.3-i386-minimal/definition.rb @@ -14,7 +14,7 @@ ] }, :iso_file => "CentOS-6.3-i386-minimal.iso", - :iso_src => "http://www.mirrorservice.org/sites/mirror.centos.org/6.3/isos/i386/CentOS-6.3-i386-minimal.iso", + :iso_src => "http://mirror.symnds.com/distributions/CentOS-vault/6.3/isos/i386/CentOS-6.3-i386-minimal.iso", :iso_md5 => "081ce8ba3e9f761a35d47f1c345562c1", :iso_download_timeout => 1000, :boot_wait => "10", @@ -22,7 +22,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/CentOS-6.3-x86_64-minimal/chef.sh b/templates/CentOS-6.3-x86_64-minimal/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.3-x86_64-minimal/chef.sh +++ b/templates/CentOS-6.3-x86_64-minimal/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.3-x86_64-minimal/definition.rb b/templates/CentOS-6.3-x86_64-minimal/definition.rb index 8ff400e8..908591d3 100644 --- a/templates/CentOS-6.3-x86_64-minimal/definition.rb +++ b/templates/CentOS-6.3-x86_64-minimal/definition.rb @@ -6,7 +6,7 @@ :hostiocache => 'off', :os_type_id => 'RedHat6_64', :iso_file => "CentOS-6.3-x86_64-minimal.iso", - :iso_src => "http://www.mirrorservice.org/sites/mirror.centos.org/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso", + :iso_src => "http://mirror.symnds.com/distributions/CentOS-vault/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso", :iso_md5 => "087713752fa88c03a5e8471c661ad1a2", :iso_download_timeout => 1000, :boot_wait => "10", @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.3-x86_64-netboot/chef.sh b/templates/CentOS-6.3-x86_64-netboot/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.3-x86_64-netboot/chef.sh +++ b/templates/CentOS-6.3-x86_64-netboot/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.3-x86_64-netboot/definition.rb b/templates/CentOS-6.3-x86_64-netboot/definition.rb index fca587b0..84ddae00 100644 --- a/templates/CentOS-6.3-x86_64-netboot/definition.rb +++ b/templates/CentOS-6.3-x86_64-netboot/definition.rb @@ -6,7 +6,7 @@ :hostiocache => 'off', :os_type_id => 'RedHat6_64', :iso_file => "CentOS-6.3-x86_64-netinstall.iso", - :iso_src => "http://www.mirrorservice.org/sites/mirror.centos.org/6.3/isos/x86_64/CentOS-6.3-x86_64-netinstall.iso", + :iso_src => "http://mirror.symnds.com/distributions/CentOS-vault/6.3/isos/x86_64/CentOS-6.3-x86_64-netinstall.iso", :iso_md5 => "690138908de516b6e5d7d180d085c3f3", :iso_download_timeout => 1000, :boot_wait => "15", @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.3-x86_64-reallyminimal/definition.rb b/templates/CentOS-6.3-x86_64-reallyminimal/definition.rb index f5523fc7..38746e6d 100644 --- a/templates/CentOS-6.3-x86_64-reallyminimal/definition.rb +++ b/templates/CentOS-6.3-x86_64-reallyminimal/definition.rb @@ -6,13 +6,13 @@ :hostiocache => 'off', :os_type_id => 'RedHat6_64', :iso_file => "CentOS-6.3-x86_64-minimal.iso", - :iso_src => "http://www.mirrorservice.org/sites/mirror.centos.org/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso", + :iso_src => "http://mirror.symnds.com/distributions/CentOS-vault/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso", :iso_md5 => "087713752fa88c03a5e8471c661ad1a2", :iso_download_timeout => 10000, :boot_wait => "10", :boot_cmd_sequence => [ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/CentOS-6.4-i386-minimal/chef.sh b/templates/CentOS-6.4-i386-minimal/chef.sh index cf2ddee0..0e2cfea5 100644 --- a/templates/CentOS-6.4-i386-minimal/chef.sh +++ b/templates/CentOS-6.4-i386-minimal/chef.sh @@ -1,2 +1,4 @@ # Install Chef -curl -L https://www.opscode.com/chef/install.sh | bash +gem install --no-ri --no-rdoc mime-types -v '1.16' +gem install --no-ri --no-rdoc chef + diff --git a/templates/CentOS-6.4-i386-minimal/definition.rb b/templates/CentOS-6.4-i386-minimal/definition.rb index 71cf1c41..63e31f60 100644 --- a/templates/CentOS-6.4-i386-minimal/definition.rb +++ b/templates/CentOS-6.4-i386-minimal/definition.rb @@ -6,7 +6,7 @@ :hostiocache => 'off', :os_type_id => 'RedHat', :iso_file => "CentOS-6.4-i386-minimal.iso", - :iso_src => "http://yum.singlehop.com/CentOS/6.4/isos/i386/CentOS-6.4-i386-minimal.iso", + :iso_src => "http://mirror.symnds.com/distributions/CentOS-vault/6.4/isos/i386/CentOS-6.4-i386-minimal.iso", :iso_md5 => "6b5c727fa76fcce7c9ab6213ad3df75a", :iso_download_timeout => 1000, :boot_wait => "10", @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.4-i386-netboot/chef.sh b/templates/CentOS-6.4-i386-netboot/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.4-i386-netboot/chef.sh +++ b/templates/CentOS-6.4-i386-netboot/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.4-i386-netboot/definition.rb b/templates/CentOS-6.4-i386-netboot/definition.rb index 3eb92ee3..d86f8ba9 100644 --- a/templates/CentOS-6.4-i386-netboot/definition.rb +++ b/templates/CentOS-6.4-i386-netboot/definition.rb @@ -6,7 +6,7 @@ :hostiocache => 'off', :os_type_id => 'RedHat', :iso_file => "CentOS-6.4-i386-netinstall.iso", - :iso_src => "http://www.mirrorservice.org/sites/mirror.centos.org/6.4/isos/i386/CentOS-6.4-i386-netinstall.iso", + :iso_src => "http://mirror.symnds.com/distributions/CentOS-vault/6.4/isos/i386/CentOS-6.4-i386-netinstall.iso", :iso_md5 => "7cde1479be934ad8463a35f2a3a48a2b", :iso_download_timeout => 1000, :boot_wait => "15", @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.4-i386-netboot/ks.cfg b/templates/CentOS-6.4-i386-netboot/ks.cfg index 0207d855..5e2f72de 100644 --- a/templates/CentOS-6.4-i386-netboot/ks.cfg +++ b/templates/CentOS-6.4-i386-netboot/ks.cfg @@ -1,5 +1,5 @@ install -url --url=http://www.mirrorservice.org/sites/mirror.centos.org/6.4/os/i386/ +url --url=http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/ lang en_US.UTF-8 keyboard us network --bootproto=dhcp diff --git a/templates/CentOS-6.4-x86_64-minimal/chef.sh b/templates/CentOS-6.4-x86_64-minimal/chef.sh index cf2ddee0..0e2cfea5 100644 --- a/templates/CentOS-6.4-x86_64-minimal/chef.sh +++ b/templates/CentOS-6.4-x86_64-minimal/chef.sh @@ -1,2 +1,4 @@ # Install Chef -curl -L https://www.opscode.com/chef/install.sh | bash +gem install --no-ri --no-rdoc mime-types -v '1.16' +gem install --no-ri --no-rdoc chef + diff --git a/templates/CentOS-6.4-x86_64-minimal/definition.rb b/templates/CentOS-6.4-x86_64-minimal/definition.rb index 047c57b3..ca0eae08 100644 --- a/templates/CentOS-6.4-x86_64-minimal/definition.rb +++ b/templates/CentOS-6.4-x86_64-minimal/definition.rb @@ -6,7 +6,7 @@ :hostiocache => 'off', :os_type_id => 'RedHat6_64', :iso_file => "CentOS-6.4-x86_64-minimal.iso", - :iso_src => "http://yum.singlehop.com/CentOS/6.4/isos/x86_64/CentOS-6.4-x86_64-minimal.iso", + :iso_src => "http://mirror.symnds.com/distributions/CentOS-vault/6.4/isos/x86_64/CentOS-6.4-x86_64-minimal.iso", :iso_md5 => "4a5fa01c81cc300f4729136e28ebe600", :iso_download_timeout => 1000, :boot_wait => "10", @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.4-x86_64-netboot/chef.sh b/templates/CentOS-6.4-x86_64-netboot/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.4-x86_64-netboot/chef.sh +++ b/templates/CentOS-6.4-x86_64-netboot/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.4-x86_64-netboot/definition.rb b/templates/CentOS-6.4-x86_64-netboot/definition.rb index 329782aa..a7841db1 100644 --- a/templates/CentOS-6.4-x86_64-netboot/definition.rb +++ b/templates/CentOS-6.4-x86_64-netboot/definition.rb @@ -6,7 +6,7 @@ :hostiocache => 'off', :os_type_id => 'RedHat6_64', :iso_file => "CentOS-6.4-x86_64-netinstall.iso", - :iso_src => "http://www.mirrorservice.org/sites/mirror.centos.org/6.4/isos/x86_64/CentOS-6.4-x86_64-netinstall.iso", + :iso_src => "http://mirror.symnds.com/distributions/CentOS-vault/6.4/isos/x86_64/CentOS-6.4-x86_64-netinstall.iso", :iso_md5 => "bb9af2aea1344597e11070abe6b1fcd3", :iso_download_timeout => 1000, :boot_wait => "15", @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-6.4-x86_64-netboot/ks.cfg b/templates/CentOS-6.4-x86_64-netboot/ks.cfg index 82550351..9f6baa4d 100644 --- a/templates/CentOS-6.4-x86_64-netboot/ks.cfg +++ b/templates/CentOS-6.4-x86_64-netboot/ks.cfg @@ -1,5 +1,5 @@ install -url --url=http://www.mirrorservice.org/sites/mirror.centos.org/6.4/os/x86_64/ +url --url=http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/x86_64/ lang en_US.UTF-8 keyboard us network --bootproto=dhcp diff --git a/templates/CentOS-6.5-i386-minimal/base.sh b/templates/CentOS-6.5-i386-minimal/base.sh deleted file mode 100644 index 2e0a793a..00000000 --- a/templates/CentOS-6.5-i386-minimal/base.sh +++ /dev/null @@ -1,16 +0,0 @@ -# Base install - -sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers - -cat > /etc/yum.repos.d/epel.repo << EOM -[epel] -name=epel -baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms nfs-utils - -# Make ssh faster by not waiting on DNS -echo "UseDNS no" >> /etc/ssh/sshd_config diff --git a/templates/CentOS-6.5-i386-minimal/chef.sh b/templates/CentOS-6.5-i386-minimal/chef.sh deleted file mode 100644 index cf2ddee0..00000000 --- a/templates/CentOS-6.5-i386-minimal/chef.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Install Chef -curl -L https://www.opscode.com/chef/install.sh | bash diff --git a/templates/CentOS-6.5-i386-minimal/definition.rb b/templates/CentOS-6.5-i386-minimal/definition.rb deleted file mode 100644 index 8cb79790..00000000 --- a/templates/CentOS-6.5-i386-minimal/definition.rb +++ /dev/null @@ -1,38 +0,0 @@ -Veewee::Session.declare({ - :cpu_count => '1', - :memory_size=> '480', - :disk_size => '10140', - :disk_format => 'VDI', - :hostiocache => 'off', - :os_type_id => 'RedHat', - :iso_file => "CentOS-6.5-i386-minimal.iso", - :iso_src => "http://yum.singlehop.com/CentOS/6.5/isos/i386/CentOS-6.5-i386-minimal.iso", - :iso_md5 => "a4f27ab51d0d2c9d36b68c56b39f752b", - :iso_download_timeout => 1000, - :boot_wait => "10", - :boot_cmd_sequence => [ - ' text ks=http://%IP%:%PORT%/ks.cfg ' - ], - :kickstart_port => "7122", - :kickstart_timeout => 10000, - :kickstart_file => "ks.cfg", - :ssh_login_timeout => "10000", - :ssh_user => "veewee", - :ssh_password => "veewee", - :ssh_key => "", - :ssh_host_port => "7222", - :ssh_guest_port => "22", - :sudo_cmd => "echo '%p'|sudo -S sh '%f'", - :shutdown_cmd => "/sbin/halt -h -p", - :postinstall_files => [ - "base.sh", - "chef.sh", - "puppet.sh", - "vagrant.sh", - #"vmfusion.sh", - "virtualbox.sh", - "cleanup.sh", - "zerodisk.sh" - ], - :postinstall_timeout => 10000 -}) diff --git a/templates/CentOS-6.5-i386-netboot/base.sh b/templates/CentOS-6.5-i386-netboot/base.sh deleted file mode 100644 index c1c1a84e..00000000 --- a/templates/CentOS-6.5-i386-netboot/base.sh +++ /dev/null @@ -1,16 +0,0 @@ -# Base install - -sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers - -cat > /etc/yum.repos.d/epel.repo << EOM -[epel] -name=epel -baseurl=https://download.fedoraproject.org/pub/epel/6/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms - -# Make ssh faster by not waiting on DNS -echo "UseDNS no" >> /etc/ssh/sshd_config diff --git a/templates/CentOS-6.5-i386-netboot/cfengine.sh b/templates/CentOS-6.5-i386-netboot/cfengine.sh deleted file mode 100755 index cebb4dc4..00000000 --- a/templates/CentOS-6.5-i386-netboot/cfengine.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -# Lets not install untrusted packages to manage our infrastructure -Trusted_GPG_Fingerprint="EF49F970C3D4AEF5E557FB6D8D5A7684F97E94BE" -GPGURL="http://cfengine.com/pub/gpg.key" -GPGKEY="/tmp/cfengine_gpg.key" -YUMREPO="http://cfengine.com/pub/yum" - - - -function main -{ - configure_repo - retrieve_GPGKEY - validate_GPGKEY - install_GPGKEY - install_cfengine -} - -function configure_repo -{ - # Install Yum Client Repository Definition - cat > /etc/yum.repos.d/cfengine.repo << EOM && return 0 || return 1 -[cfengine] -name=cfengine -baseurl=$YUMREPO -enabled=1 -gpgcheck=1 -EOM -} - -function retrieve_GPGKEY -{ - # Retrieve, validate, and install GPGKEY - curl --silent --output $GPGKEY $GPGURL - Found_GPG_Fingerprint=$(gpg --quiet --with-fingerprint $GPGKEY | grep fingerprint | cut -d "=" -f2 | sed 's/ //g') -} - -function validate_GPGKEY -{ - if [ "$Found_GPG_Fingerprint" = "$Trusted_GPG_Fingerprint" ]; then - echo "Trusting Retrieved Key: $GPGURL" - return 0 - else - return 1 - fi -} - -function install_GPGKEY -{ - # We want to avoid possibly importing keys unnecissarily if they are already installed - keyid=$(echo $(gpg --throw-keyids < $GPGKEY) | cut --characters=11-18 | tr [A-Z] [a-z]) - if ! rpm -q gpg-pubkey-$keyid > /dev/null 2>&1 ; then - echo "Installing GPG public key with ID $keyid from $GPGKEY..." - rpm --import $GPGKEY && return 0 || return 1 - else - # Found key already installed - return 0 - fi -} - -function install_cfengine -{ - yum -y install cfengine-community && return 0 || return 1 -} - -main - - diff --git a/templates/CentOS-6.5-i386-netboot/definition.rb b/templates/CentOS-6.5-i386-netboot/definition.rb deleted file mode 100644 index 4d926efb..00000000 --- a/templates/CentOS-6.5-i386-netboot/definition.rb +++ /dev/null @@ -1,40 +0,0 @@ -Veewee::Session.declare({ - :cpu_count => '1', - :memory_size=> '480', - :disk_size => '10140', - :disk_format => 'VDI', - :hostiocache => 'off', - :os_type_id => 'RedHat', - :iso_file => "CentOS-6.5-i386-netinstall.iso", - :iso_src => "http://yum.singlehop.com/CentOS/6.5/isos/i386/CentOS-6.5-i386-netinstall.iso", - :iso_md5 => "427309de36d518db9f72fc14d5d257df", - :iso_download_timeout => 1000, - :boot_wait => "15", - :boot_cmd_sequence => [ - ' text ks=http://%IP%:%PORT%/ks.cfg ' - ], - :kickstart_port => "7122", - :kickstart_timeout => 10000, - :kickstart_file => "ks.cfg", - :ssh_login_timeout => "10000", - :ssh_user => "veewee", - :ssh_password => "veewee", - :ssh_key => "", - :ssh_host_port => "7222", - :ssh_guest_port => "22", - :sudo_cmd => "echo '%p'|sudo -S sh '%f'", - :shutdown_cmd => "/sbin/halt -h -p", - :postinstall_files => [ - "base.sh", - "ruby.sh", - "chef.sh", - "puppet.sh", - "vagrant.sh", - "virtualbox.sh", - #"kvm.sh", - #"vmfusion.sh", - "cleanup.sh", - "zerodisk.sh" - ], - :postinstall_timeout => 10000 -}) diff --git a/templates/CentOS-6.5-i386-netboot/puppet.sh b/templates/CentOS-6.5-i386-netboot/puppet.sh deleted file mode 100644 index c17308ed..00000000 --- a/templates/CentOS-6.5-i386-netboot/puppet.sh +++ /dev/null @@ -1,18 +0,0 @@ -# Install Puppet - -cat > /etc/yum.repos.d/puppetlabs.repo << EOM -[puppetlabs-dependencies] -name=puppetlabdsdependencies -baseurl=http://yum.puppetlabs.com/el/6/dependencies/\$basearch -enabled=1 -gpgcheck=0 - -[puppetlabs] -name=puppetlabs -baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install puppet facter ruby-shadow - diff --git a/templates/CentOS-6.5-x86_64-minimal/cleanup.sh b/templates/CentOS-6.5-x86_64-minimal/cleanup.sh deleted file mode 100644 index 929e13f5..00000000 --- a/templates/CentOS-6.5-x86_64-minimal/cleanup.sh +++ /dev/null @@ -1,8 +0,0 @@ -yum -y erase gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts -yum -y clean all -rm -rf /etc/yum.repos.d/{puppetlabs,epel}.repo -rm -rf VBoxGuestAdditions_*.iso - -# Remove traces of mac address from network configuration -sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 -rm /etc/udev/rules.d/70-persistent-net.rules diff --git a/templates/CentOS-6.5-x86_64-minimal/ks.cfg b/templates/CentOS-6.5-x86_64-minimal/ks.cfg deleted file mode 100644 index 1607c81c..00000000 --- a/templates/CentOS-6.5-x86_64-minimal/ks.cfg +++ /dev/null @@ -1,36 +0,0 @@ -install -cdrom -lang en_US.UTF-8 -keyboard us -network --bootproto=dhcp -rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/ -firewall --enabled --service=ssh -authconfig --enableshadow --passalgo=sha512 -selinux --disabled -timezone UTC -bootloader --location=mbr - -text -skipx -zerombr - -clearpart --all --initlabel -autopart - -auth --useshadow --enablemd5 -firstboot --disabled -reboot - -%packages --nobase -@core -%end - -%post -/usr/bin/yum -y install sudo -/usr/sbin/groupadd veewee -/usr/sbin/useradd veewee -g veewee -G wheel -echo "veewee"|passwd --stdin veewee -echo "veewee ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/veewee -chmod 0440 /etc/sudoers.d/veewee -%end - diff --git a/templates/CentOS-6.5-x86_64-minimal/puppet.sh b/templates/CentOS-6.5-x86_64-minimal/puppet.sh deleted file mode 100644 index c17308ed..00000000 --- a/templates/CentOS-6.5-x86_64-minimal/puppet.sh +++ /dev/null @@ -1,18 +0,0 @@ -# Install Puppet - -cat > /etc/yum.repos.d/puppetlabs.repo << EOM -[puppetlabs-dependencies] -name=puppetlabdsdependencies -baseurl=http://yum.puppetlabs.com/el/6/dependencies/\$basearch -enabled=1 -gpgcheck=0 - -[puppetlabs] -name=puppetlabs -baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install puppet facter ruby-shadow - diff --git a/templates/CentOS-6.5-x86_64-netboot/base.sh b/templates/CentOS-6.5-x86_64-netboot/base.sh deleted file mode 100644 index 2e0a793a..00000000 --- a/templates/CentOS-6.5-x86_64-netboot/base.sh +++ /dev/null @@ -1,16 +0,0 @@ -# Base install - -sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers - -cat > /etc/yum.repos.d/epel.repo << EOM -[epel] -name=epel -baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms nfs-utils - -# Make ssh faster by not waiting on DNS -echo "UseDNS no" >> /etc/ssh/sshd_config diff --git a/templates/CentOS-6.5-x86_64-netboot/cleanup.sh b/templates/CentOS-6.5-x86_64-netboot/cleanup.sh deleted file mode 100644 index 929e13f5..00000000 --- a/templates/CentOS-6.5-x86_64-netboot/cleanup.sh +++ /dev/null @@ -1,8 +0,0 @@ -yum -y erase gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts -yum -y clean all -rm -rf /etc/yum.repos.d/{puppetlabs,epel}.repo -rm -rf VBoxGuestAdditions_*.iso - -# Remove traces of mac address from network configuration -sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 -rm /etc/udev/rules.d/70-persistent-net.rules diff --git a/templates/CentOS-6.5-x86_64-netboot/puppet.sh b/templates/CentOS-6.5-x86_64-netboot/puppet.sh deleted file mode 100644 index c17308ed..00000000 --- a/templates/CentOS-6.5-x86_64-netboot/puppet.sh +++ /dev/null @@ -1,18 +0,0 @@ -# Install Puppet - -cat > /etc/yum.repos.d/puppetlabs.repo << EOM -[puppetlabs-dependencies] -name=puppetlabdsdependencies -baseurl=http://yum.puppetlabs.com/el/6/dependencies/\$basearch -enabled=1 -gpgcheck=0 - -[puppetlabs] -name=puppetlabs -baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch -enabled=1 -gpgcheck=0 -EOM - -yum -y install puppet facter ruby-shadow - diff --git a/templates/CentOS-6.5-x86_64-netboot/virtualbox.sh b/templates/CentOS-6.5-x86_64-netboot/virtualbox.sh deleted file mode 100644 index 46658dc0..00000000 --- a/templates/CentOS-6.5-x86_64-netboot/virtualbox.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Installing the virtualbox guest additions -VBOX_VERSION=$(cat /home/veewee/.vbox_version) -cd /tmp -mount -o loop /home/veewee/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt -sh /mnt/VBoxLinuxAdditions.run -umount /mnt -rm -rf /home/veewee/VBoxGuestAdditions_*.iso - diff --git a/templates/CentOS-6.5-x86_64-minimal/base.sh b/templates/CentOS-6.5/base.sh similarity index 85% rename from templates/CentOS-6.5-x86_64-minimal/base.sh rename to templates/CentOS-6.5/base.sh index 2e0a793a..0af907ba 100644 --- a/templates/CentOS-6.5-x86_64-minimal/base.sh +++ b/templates/CentOS-6.5/base.sh @@ -5,7 +5,7 @@ sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers cat > /etc/yum.repos.d/epel.repo << EOM [epel] name=epel -baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch +baseurl=https://download.fedoraproject.org/pub/epel/6/\$basearch enabled=1 gpgcheck=0 EOM diff --git a/templates/CentOS-6.5/centos_32_minimal.yml b/templates/CentOS-6.5/centos_32_minimal.yml new file mode 100644 index 00000000..04337d9a --- /dev/null +++ b/templates/CentOS-6.5/centos_32_minimal.yml @@ -0,0 +1,4 @@ +:os_type_id: 'RedHat' +:iso_file: "CentOS-6.5-i386-minimal.iso" +:iso_src: "http://yum.singlehop.com/CentOS/6.5/isos/i386/CentOS-6.5-i386-minimal.iso" +:iso_md5: "a4f27ab51d0d2c9d36b68c56b39f752b" diff --git a/templates/CentOS-6.5/centos_32_netboot.yml b/templates/CentOS-6.5/centos_32_netboot.yml new file mode 100644 index 00000000..d30137e8 --- /dev/null +++ b/templates/CentOS-6.5/centos_32_netboot.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: 'RedHat' +:iso_file: "CentOS-6.5-i386-netinstall.iso" +:iso_src: "http://yum.singlehop.com/CentOS/6.5/isos/i386/CentOS-6.5-i386-netinstall.iso" +:iso_md5: "427309de36d518db9f72fc14d5d257df" diff --git a/templates/CentOS-6.5/centos_64_minimal.yml b/templates/CentOS-6.5/centos_64_minimal.yml new file mode 100644 index 00000000..d90228b3 --- /dev/null +++ b/templates/CentOS-6.5/centos_64_minimal.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: 'RedHat6_64' +:iso_file: "CentOS-6.5-x86_64-minimal.iso" +:iso_src: "http://yum.singlehop.com/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso" +:iso_md5: "0d9dc37b5dd4befa1c440d2174e88a87" diff --git a/templates/CentOS-6.5/centos_64_netboot.yml b/templates/CentOS-6.5/centos_64_netboot.yml new file mode 100644 index 00000000..f13d6811 --- /dev/null +++ b/templates/CentOS-6.5/centos_64_netboot.yml @@ -0,0 +1,5 @@ +--- +:os_type_id => 'RedHat6_64', +:iso_file => "CentOS-6.5-x86_64-netinstall.iso", +:iso_src => "http://yum.singlehop.com/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-netinstall.iso", +:iso_md5 => "939fd1d87c11ffe7795324438b85adfb", diff --git a/templates/CentOS-6.5-i386-netboot/chef.sh b/templates/CentOS-6.5/chef.sh similarity index 50% rename from templates/CentOS-6.5-i386-netboot/chef.sh rename to templates/CentOS-6.5/chef.sh index 754ea6d5..0e2cfea5 100644 --- a/templates/CentOS-6.5-i386-netboot/chef.sh +++ b/templates/CentOS-6.5/chef.sh @@ -1,3 +1,4 @@ # Install Chef +gem install --no-ri --no-rdoc mime-types -v '1.16' gem install --no-ri --no-rdoc chef diff --git a/templates/CentOS-6.5-i386-minimal/cleanup.sh b/templates/CentOS-6.5/cleanup.sh similarity index 100% rename from templates/CentOS-6.5-i386-minimal/cleanup.sh rename to templates/CentOS-6.5/cleanup.sh diff --git a/templates/CentOS-6.5/definition.rb b/templates/CentOS-6.5/definition.rb new file mode 100644 index 00000000..8aa73b3d --- /dev/null +++ b/templates/CentOS-6.5/definition.rb @@ -0,0 +1,5 @@ +# +# change centos_64_dvd to one of configurations in *.yml in this directory +# use the yml files to configure +# +Veewee::Definition.declare_yaml('definition.yml', "centos_64_minimal.yml") diff --git a/templates/CentOS-6.5/definition.yml b/templates/CentOS-6.5/definition.yml new file mode 100644 index 00000000..4edc4599 --- /dev/null +++ b/templates/CentOS-6.5/definition.yml @@ -0,0 +1,32 @@ +--- +:cpu_count: '1' +:memory_size: '480' +:disk_size: '10140' +:disk_format: 'VDI' +:hostiocache: 'off' +:iso_download_timeout: 1000 +:boot_wait: "15" +:boot_cmd_sequence: + - ' text ks=http://%IP%:%PORT%/ks.cfg ' +:kickstart_port: "7122" +:kickstart_timeout: 300 +:kickstart_file: "ks.cfg.erb" +:ssh_login_timeout: "10000" +:ssh_user: "veewee" +:ssh_password: "veewee" +:ssh_key: "" +:ssh_host_port: "7222" +:ssh_guest_port: "22" +:sudo_cmd: "echo '%p'|sudo -S sh '%f'" +:shutdown_cmd: "/sbin/halt -h -p" +:postinstall_files: + - "base.sh" + - "ruby.sh" + - "chef.sh" + - "puppet.sh" + - "vagrant.sh" + - "virtualbox.sh" + - "_vmfusion.sh" + - "cleanup.sh" + - "zerodisk.sh" +:postinstall_timeout: 10000 diff --git a/templates/CentOS-6.5-x86_64-netboot/ks.cfg b/templates/CentOS-6.5/ks.cfg.erb similarity index 71% rename from templates/CentOS-6.5-x86_64-netboot/ks.cfg rename to templates/CentOS-6.5/ks.cfg.erb index fd740ab0..634255d7 100644 --- a/templates/CentOS-6.5-x86_64-netboot/ks.cfg +++ b/templates/CentOS-6.5/ks.cfg.erb @@ -1,5 +1,12 @@ install -url --url=http://www.mirrorservice.org/sites/mirror.centos.org/6.5/os/x86_64/ +cdrom +<% if definition.iso_file =~ /minimal/ %> +cdrom +<% elsif definition.os_type_id == "RedHat" %> +url --url=http://mirror.symnds.com/distributions/CentOS-vault/6.5/os/i386/ +<% else %> +url --url=http://mirror.symnds.com/distributions/CentOS-vault/6.5/os/x86_64/ +<% end %> lang en_US.UTF-8 keyboard us network --bootproto=dhcp @@ -35,4 +42,3 @@ echo "veewee"|passwd --stdin veewee echo "veewee ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/veewee chmod 0440 /etc/sudoers.d/veewee %end - diff --git a/templates/CentOS-6.5-i386-minimal/puppet.sh b/templates/CentOS-6.5/puppet.sh similarity index 100% rename from templates/CentOS-6.5-i386-minimal/puppet.sh rename to templates/CentOS-6.5/puppet.sh diff --git a/templates/CentOS-6.5-i386-netboot/ruby.sh b/templates/CentOS-6.5/ruby.sh similarity index 100% rename from templates/CentOS-6.5-i386-netboot/ruby.sh rename to templates/CentOS-6.5/ruby.sh diff --git a/templates/CentOS-6.5-i386-minimal/vagrant.sh b/templates/CentOS-6.5/vagrant.sh similarity index 100% rename from templates/CentOS-6.5-i386-minimal/vagrant.sh rename to templates/CentOS-6.5/vagrant.sh diff --git a/templates/CentOS-6.5-i386-minimal/virtualbox.sh b/templates/CentOS-6.5/virtualbox.sh similarity index 100% rename from templates/CentOS-6.5-i386-minimal/virtualbox.sh rename to templates/CentOS-6.5/virtualbox.sh diff --git a/templates/CentOS-6.5-i386-minimal/vmfusion.sh b/templates/CentOS-6.5/vmfusion.sh similarity index 100% rename from templates/CentOS-6.5-i386-minimal/vmfusion.sh rename to templates/CentOS-6.5/vmfusion.sh diff --git a/templates/CentOS-6.5-i386-minimal/zerodisk.sh b/templates/CentOS-6.5/zerodisk.sh similarity index 100% rename from templates/CentOS-6.5-i386-minimal/zerodisk.sh rename to templates/CentOS-6.5/zerodisk.sh diff --git a/templates/CentOS-7.0-1406-x86_64-netinstall/base.sh b/templates/CentOS-7.0-1406-x86_64-netinstall/base.sh index b351ac5a..adf25d44 100644 --- a/templates/CentOS-7.0-1406-x86_64-netinstall/base.sh +++ b/templates/CentOS-7.0-1406-x86_64-netinstall/base.sh @@ -10,7 +10,7 @@ enabled=1 gpgcheck=0 EOM -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms nfs-utils +yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms nfs-utils bzip2 # Make ssh faster by not waiting on DNS echo "UseDNS no" >> /etc/ssh/sshd_config diff --git a/templates/CentOS-7.0-1406-x86_64-netinstall/definition.rb b/templates/CentOS-7.0-1406-x86_64-netinstall/definition.rb index 20386141..68ec95ba 100644 --- a/templates/CentOS-7.0-1406-x86_64-netinstall/definition.rb +++ b/templates/CentOS-7.0-1406-x86_64-netinstall/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/CentOS-7.0-1406-x86_64-netinstall/ks.cfg b/templates/CentOS-7.0-1406-x86_64-netinstall/ks.cfg index 71f52e61..3b0b0c89 100644 --- a/templates/CentOS-7.0-1406-x86_64-netinstall/ks.cfg +++ b/templates/CentOS-7.0-1406-x86_64-netinstall/ks.cfg @@ -23,6 +23,7 @@ reboot %packages --nobase @core +bzip2 openssh-clients openssh-server %end diff --git a/templates/Debian-5.0.10-amd64-netboot/base.sh b/templates/Debian-5.0.10-amd64-netboot/base.sh index 6a6d4810..4346fd7f 100644 --- a/templates/Debian-5.0.10-amd64-netboot/base.sh +++ b/templates/Debian-5.0.10-amd64-netboot/base.sh @@ -6,7 +6,7 @@ apt-get clean #Setting up sudo cp /etc/sudoers /etc/sudoers.orig -sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers +sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-5.0.10-amd64-netboot/definition.rb b/templates/Debian-5.0.10-amd64-netboot/definition.rb index d208c465..da4e55e8 100644 --- a/templates/Debian-5.0.10-amd64-netboot/definition.rb +++ b/templates/Debian-5.0.10-amd64-netboot/definition.rb @@ -24,7 +24,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-5.0.10-amd64-netboot/vagrant.sh b/templates/Debian-5.0.10-amd64-netboot/vagrant.sh index 28b97a25..994adb18 100644 --- a/templates/Debian-5.0.10-amd64-netboot/vagrant.sh +++ b/templates/Debian-5.0.10-amd64-netboot/vagrant.sh @@ -4,7 +4,7 @@ date > /etc/vagrant_box_build_time #Setting up sudo cp /etc/sudoers /etc/sudoers.orig -sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers +sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers #Installing vagrant keys mkdir /home/vagrant/.ssh diff --git a/templates/Debian-5.0.10-i386-netboot/base.sh b/templates/Debian-5.0.10-i386-netboot/base.sh index 6a6d4810..4346fd7f 100644 --- a/templates/Debian-5.0.10-i386-netboot/base.sh +++ b/templates/Debian-5.0.10-i386-netboot/base.sh @@ -6,7 +6,7 @@ apt-get clean #Setting up sudo cp /etc/sudoers /etc/sudoers.orig -sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers +sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-5.0.10-i386-netboot/definition.rb b/templates/Debian-5.0.10-i386-netboot/definition.rb index 734bc036..9dfa2cc2 100644 --- a/templates/Debian-5.0.10-i386-netboot/definition.rb +++ b/templates/Debian-5.0.10-i386-netboot/definition.rb @@ -24,7 +24,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-5.0.10-i386-netboot/vagrant.sh b/templates/Debian-5.0.10-i386-netboot/vagrant.sh index 28b97a25..994adb18 100644 --- a/templates/Debian-5.0.10-i386-netboot/vagrant.sh +++ b/templates/Debian-5.0.10-i386-netboot/vagrant.sh @@ -4,7 +4,7 @@ date > /etc/vagrant_box_build_time #Setting up sudo cp /etc/sudoers /etc/sudoers.orig -sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers +sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers #Installing vagrant keys mkdir /home/vagrant/.ssh diff --git a/templates/Debian-5.0.8-amd64-netboot/base.sh b/templates/Debian-5.0.8-amd64-netboot/base.sh index 6a6d4810..4346fd7f 100644 --- a/templates/Debian-5.0.8-amd64-netboot/base.sh +++ b/templates/Debian-5.0.8-amd64-netboot/base.sh @@ -6,7 +6,7 @@ apt-get clean #Setting up sudo cp /etc/sudoers /etc/sudoers.orig -sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers +sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-5.0.8-amd64-netboot/definition.rb b/templates/Debian-5.0.8-amd64-netboot/definition.rb index d89889aa..6acbb783 100644 --- a/templates/Debian-5.0.8-amd64-netboot/definition.rb +++ b/templates/Debian-5.0.8-amd64-netboot/definition.rb @@ -24,7 +24,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-5.0.8-amd64-netboot/vagrant.sh b/templates/Debian-5.0.8-amd64-netboot/vagrant.sh index 28b97a25..994adb18 100644 --- a/templates/Debian-5.0.8-amd64-netboot/vagrant.sh +++ b/templates/Debian-5.0.8-amd64-netboot/vagrant.sh @@ -4,7 +4,7 @@ date > /etc/vagrant_box_build_time #Setting up sudo cp /etc/sudoers /etc/sudoers.orig -sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers +sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers #Installing vagrant keys mkdir /home/vagrant/.ssh diff --git a/templates/Debian-5.0.8-i386-netboot/base.sh b/templates/Debian-5.0.8-i386-netboot/base.sh index 6a6d4810..4346fd7f 100644 --- a/templates/Debian-5.0.8-i386-netboot/base.sh +++ b/templates/Debian-5.0.8-i386-netboot/base.sh @@ -6,7 +6,7 @@ apt-get clean #Setting up sudo cp /etc/sudoers /etc/sudoers.orig -sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers +sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-5.0.8-i386-netboot/definition.rb b/templates/Debian-5.0.8-i386-netboot/definition.rb index 103b0f98..38fc68c3 100644 --- a/templates/Debian-5.0.8-i386-netboot/definition.rb +++ b/templates/Debian-5.0.8-i386-netboot/definition.rb @@ -24,7 +24,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-5.0.8-i386-netboot/vagrant.sh b/templates/Debian-5.0.8-i386-netboot/vagrant.sh index 28b97a25..994adb18 100644 --- a/templates/Debian-5.0.8-i386-netboot/vagrant.sh +++ b/templates/Debian-5.0.8-i386-netboot/vagrant.sh @@ -4,7 +4,7 @@ date > /etc/vagrant_box_build_time #Setting up sudo cp /etc/sudoers /etc/sudoers.orig -sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=NOPASSWD:ALL/g' /etc/sudoers +sed -i -e 's/vagrant ALL=(ALL) ALL/vagrant ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers #Installing vagrant keys mkdir /home/vagrant/.ssh diff --git a/templates/Debian-6.0.10-amd64-netboot/base.sh b/templates/Debian-6.0.10-amd64-netboot/base.sh new file mode 100644 index 00000000..f1ca1bd1 --- /dev/null +++ b/templates/Debian-6.0.10-amd64-netboot/base.sh @@ -0,0 +1,27 @@ +# Update the box +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline5-dev +apt-get -y install curl unzip +apt-get clean + +# Set up sudo +cp /etc/sudoers /etc/sudoers.orig +sed -i -e 's/%sudo ALL=(ALL) ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +echo < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-7.1.0-i386-netboot/chef.sh b/templates/Debian-6.0.10-amd64-netboot/chef.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/chef.sh rename to templates/Debian-6.0.10-amd64-netboot/chef.sh diff --git a/templates/Debian-7.1.0-amd64-netboot/cleanup-virtualbox.sh b/templates/Debian-6.0.10-amd64-netboot/cleanup-virtualbox.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/cleanup-virtualbox.sh rename to templates/Debian-6.0.10-amd64-netboot/cleanup-virtualbox.sh diff --git a/templates/Debian-7.1.0-i386-netboot/cleanup.sh b/templates/Debian-6.0.10-amd64-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/cleanup.sh rename to templates/Debian-6.0.10-amd64-netboot/cleanup.sh diff --git a/templates/Debian-6.0.10-amd64-netboot/definition.rb b/templates/Debian-6.0.10-amd64-netboot/definition.rb new file mode 100644 index 00000000..05fec500 --- /dev/null +++ b/templates/Debian-6.0.10-amd64-netboot/definition.rb @@ -0,0 +1,50 @@ +Veewee::Definition.declare({ + :cpu_count => '1', + :memory_size=> '256', + :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', + :os_type_id => 'Debian_64', + :iso_file => "debian-6.0.10-amd64-netinst.iso", + :iso_src => "http://cdimage.debian.org/cdimage/archive/6.0.10/amd64/iso-cd/debian-6.0.10-amd64-netinst.iso", + :iso_md5 => "7f82d341561035f65933da43f94d5b52", + :iso_download_timeout => "1000", + :boot_wait => "10", :boot_cmd_sequence => [ + ' ', + 'install ', + 'preseed/url=http://%IP%:%PORT%/preseed.cfg ', + 'debian-installer=en_US ', + 'auto ', + 'locale=en_US ', + 'kbd-chooser/method=us ', + 'netcfg/get_hostname=%NAME% ', + 'netcfg/get_domain=vagrantup.com ', + 'fb=false ', + 'debconf/frontend=noninteractive ', + 'console-setup/ask_detect=false ', + 'console-keymaps-at/keymap=us ', + ' ' + ], + :kickstart_port => "7122", + :kickstart_timeout => "300", + :kickstart_file => "preseed.cfg", + :ssh_login_timeout => "10000", + :ssh_user => "vagrant", + :ssh_password => "vagrant", + :ssh_key => "", + :ssh_host_port => "7222", + :ssh_guest_port => "22", + :sudo_cmd => "echo '%p'|sudo -S sh '%f'", + :shutdown_cmd => "halt -p", + :postinstall_files => [ + "base.sh", + "vagrant.sh", + "virtualbox.sh", + #"vmfusion.sh", + "ruby.sh", + "puppet.sh", + "chef.sh", + "cleanup-virtualbox.sh", + "cleanup.sh", + "zerodisk.sh" + ], + :postinstall_timeout => "10000" +}) diff --git a/templates/Debian-6.0.10-amd64-netboot/preseed.cfg b/templates/Debian-6.0.10-amd64-netboot/preseed.cfg new file mode 100644 index 00000000..812da6ce --- /dev/null +++ b/templates/Debian-6.0.10-amd64-netboot/preseed.cfg @@ -0,0 +1,315 @@ +#### Contents of the preconfiguration file (for squeeze) +### Localization +# Locale sets language and country. +d-i debian-installer/locale string en_US + +# Keyboard selection. +#d-i console-tools/archs select at +d-i console-keymaps-at/keymap select us +# Example for a different keyboard architecture +#d-i console-keymaps-usb/keymap select mac-usb-us + +### Network configuration +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_dhcp boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrant +d-i netcfg/get_domain string vagrantup.com + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.us.debian.org +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +# If the system has free space you can choose to only partition that space. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you can specify a disk to partition. The device name must +# be given in traditional non-devfs format. +# Note: A disk must be specified, unless the system has only one disk. +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: "regular", "lvm" and "crypto" +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true + +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + + +d-i partman/choose_partition select finish +d-i partman-auto-lvm/guided_size string max + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /usr, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic +d-i partman/default_filesystem string ext3 + +# Or provide a recipe of your own... +# The recipe format is documented in the file devel/partman-auto-recipe.txt. +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +#The preseed line that "selects finish" needs to be in a certain order in your preseed, the example-preseed does not follow this. +#http://ubuntuforums.org/archive/index.php/t-1504045.html + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +d-i partman/confirm_write_new_label boolean true +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + + +### Base system installation +# Select the initramfs generator used to generate the initrd for 2.6 kernels. +#d-i base-installer/kernel/linux/initramfs-generators string yaird + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-2.6-486 + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/root-password-crypted password [MD5 hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/user-password-crypted password [MD5 hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 +d-i user-setup/encrypt-home boolean false +d-i user-setup/allow-password-weak boolean true + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, volatile +#d-i apt-setup/security_host string security.debian.org +#d-i apt-setup/volatile_host string volatile.debian.org + + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated string true + +### Package selection +tasksel tasksel/first multiselect standard +# If the desktop task is selected, install the kde and xfce desktops +# instead of the default gnome desktop. +#tasksel tasksel/desktop multiselect kde, xfce + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync + +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,0) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages + +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. diff --git a/templates/Debian-6.0.10-amd64-netboot/puppet.sh b/templates/Debian-6.0.10-amd64-netboot/puppet.sh new file mode 100644 index 00000000..06ca041d --- /dev/null +++ b/templates/Debian-6.0.10-amd64-netboot/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-squeeze.deb +dpkg -i puppetlabs-release-squeeze.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-6.0.10-amd64-netboot/ruby.sh b/templates/Debian-6.0.10-amd64-netboot/ruby.sh new file mode 100644 index 00000000..08d443a9 --- /dev/null +++ b/templates/Debian-6.0.10-amd64-netboot/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libruby1.8 ri + +# Install Rubygems from source +rg_ver=1.6.2 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-7.6.0-i386-netboot/vagrant.sh b/templates/Debian-6.0.10-amd64-netboot/vagrant.sh similarity index 99% rename from templates/Debian-7.6.0-i386-netboot/vagrant.sh rename to templates/Debian-6.0.10-amd64-netboot/vagrant.sh index ee2bad4e..34e383cc 100644 --- a/templates/Debian-7.6.0-i386-netboot/vagrant.sh +++ b/templates/Debian-6.0.10-amd64-netboot/vagrant.sh @@ -21,3 +21,5 @@ echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd # Install NFS client apt-get -y install nfs-common + + diff --git a/templates/Debian-6.0.10-amd64-netboot/virtualbox.sh b/templates/Debian-6.0.10-amd64-netboot/virtualbox.sh new file mode 100644 index 00000000..158084c5 --- /dev/null +++ b/templates/Debian-6.0.10-amd64-netboot/virtualbox.sh @@ -0,0 +1,18 @@ +if test -f .vbox_version ; then + + # Without libdbus virtualbox would not start automatically after compile + apt-get -y install --no-install-recommends libdbus-1-3 + + # The netboot installs the VirtualBox support (old) so we have to remove it + /etc/init.d/virtualbox-ose-guest-utils stop + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + aptitude -y install dkms + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat /home/vagrant/.vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt +fi diff --git a/templates/Debian-7.1.0-amd64-netboot/vmfusion.sh b/templates/Debian-6.0.10-amd64-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/vmfusion.sh rename to templates/Debian-6.0.10-amd64-netboot/vmfusion.sh diff --git a/templates/CentOS-6.5-i386-netboot/zerodisk.sh b/templates/Debian-6.0.10-amd64-netboot/zerodisk.sh similarity index 100% rename from templates/CentOS-6.5-i386-netboot/zerodisk.sh rename to templates/Debian-6.0.10-amd64-netboot/zerodisk.sh diff --git a/templates/Debian-6.0.10-i386-netboot/base.sh b/templates/Debian-6.0.10-i386-netboot/base.sh new file mode 100644 index 00000000..f1ca1bd1 --- /dev/null +++ b/templates/Debian-6.0.10-i386-netboot/base.sh @@ -0,0 +1,27 @@ +# Update the box +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline5-dev +apt-get -y install curl unzip +apt-get clean + +# Set up sudo +cp /etc/sudoers /etc/sudoers.orig +sed -i -e 's/%sudo ALL=(ALL) ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +echo < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-7.2.0-i386-netboot/chef.sh b/templates/Debian-6.0.10-i386-netboot/chef.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/chef.sh rename to templates/Debian-6.0.10-i386-netboot/chef.sh diff --git a/templates/Debian-7.1.0-i386-netboot/cleanup-virtualbox.sh b/templates/Debian-6.0.10-i386-netboot/cleanup-virtualbox.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/cleanup-virtualbox.sh rename to templates/Debian-6.0.10-i386-netboot/cleanup-virtualbox.sh diff --git a/templates/Debian-7.2.0-i386-netboot/cleanup.sh b/templates/Debian-6.0.10-i386-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/cleanup.sh rename to templates/Debian-6.0.10-i386-netboot/cleanup.sh diff --git a/templates/Debian-6.0.10-i386-netboot/definition.rb b/templates/Debian-6.0.10-i386-netboot/definition.rb new file mode 100644 index 00000000..ab866234 --- /dev/null +++ b/templates/Debian-6.0.10-i386-netboot/definition.rb @@ -0,0 +1,50 @@ +Veewee::Definition.declare({ + :cpu_count => '1', + :memory_size=> '256', + :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', + :os_type_id => 'Debian_64', + :iso_file => "debian-6.0.10-i386-netinst.iso", + :iso_src => "http://cdimage.debian.org/cdimage/archive/6.0.10/i386/iso-cd/debian-6.0.10-i386-netinst.iso", + :iso_md5 => "574fad7c19d6522b2892c79781e3457a", + :iso_download_timeout => "1000", + :boot_wait => "10", :boot_cmd_sequence => [ + ' ', + 'install ', + 'preseed/url=http://%IP%:%PORT%/preseed.cfg ', + 'debian-installer=en_US ', + 'auto ', + 'locale=en_US ', + 'kbd-chooser/method=us ', + 'netcfg/get_hostname=%NAME% ', + 'netcfg/get_domain=vagrantup.com ', + 'fb=false ', + 'debconf/frontend=noninteractive ', + 'console-setup/ask_detect=false ', + 'console-keymaps-at/keymap=us ', + ' ' + ], + :kickstart_port => "7122", + :kickstart_timeout => "300", + :kickstart_file => "preseed.cfg", + :ssh_login_timeout => "10000", + :ssh_user => "vagrant", + :ssh_password => "vagrant", + :ssh_key => "", + :ssh_host_port => "7222", + :ssh_guest_port => "22", + :sudo_cmd => "echo '%p'|sudo -S sh '%f'", + :shutdown_cmd => "halt -p", + :postinstall_files => [ + "base.sh", + "vagrant.sh", + "virtualbox.sh", + #"vmfusion.sh", + "ruby.sh", + "puppet.sh", + "chef.sh", + "cleanup-virtualbox.sh", + "cleanup.sh", + "zerodisk.sh" + ], + :postinstall_timeout => "10000" +}) diff --git a/templates/Debian-6.0.10-i386-netboot/preseed.cfg b/templates/Debian-6.0.10-i386-netboot/preseed.cfg new file mode 100644 index 00000000..812da6ce --- /dev/null +++ b/templates/Debian-6.0.10-i386-netboot/preseed.cfg @@ -0,0 +1,315 @@ +#### Contents of the preconfiguration file (for squeeze) +### Localization +# Locale sets language and country. +d-i debian-installer/locale string en_US + +# Keyboard selection. +#d-i console-tools/archs select at +d-i console-keymaps-at/keymap select us +# Example for a different keyboard architecture +#d-i console-keymaps-usb/keymap select mac-usb-us + +### Network configuration +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_dhcp boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrant +d-i netcfg/get_domain string vagrantup.com + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.us.debian.org +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +# If the system has free space you can choose to only partition that space. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you can specify a disk to partition. The device name must +# be given in traditional non-devfs format. +# Note: A disk must be specified, unless the system has only one disk. +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: "regular", "lvm" and "crypto" +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true + +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + + +d-i partman/choose_partition select finish +d-i partman-auto-lvm/guided_size string max + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /usr, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic +d-i partman/default_filesystem string ext3 + +# Or provide a recipe of your own... +# The recipe format is documented in the file devel/partman-auto-recipe.txt. +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +#The preseed line that "selects finish" needs to be in a certain order in your preseed, the example-preseed does not follow this. +#http://ubuntuforums.org/archive/index.php/t-1504045.html + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +d-i partman/confirm_write_new_label boolean true +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + + +### Base system installation +# Select the initramfs generator used to generate the initrd for 2.6 kernels. +#d-i base-installer/kernel/linux/initramfs-generators string yaird + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-2.6-486 + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/root-password-crypted password [MD5 hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/user-password-crypted password [MD5 hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 +d-i user-setup/encrypt-home boolean false +d-i user-setup/allow-password-weak boolean true + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, volatile +#d-i apt-setup/security_host string security.debian.org +#d-i apt-setup/volatile_host string volatile.debian.org + + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated string true + +### Package selection +tasksel tasksel/first multiselect standard +# If the desktop task is selected, install the kde and xfce desktops +# instead of the default gnome desktop. +#tasksel tasksel/desktop multiselect kde, xfce + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync + +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,0) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages + +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. diff --git a/templates/Debian-6.0.10-i386-netboot/puppet.sh b/templates/Debian-6.0.10-i386-netboot/puppet.sh new file mode 100644 index 00000000..06ca041d --- /dev/null +++ b/templates/Debian-6.0.10-i386-netboot/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-squeeze.deb +dpkg -i puppetlabs-release-squeeze.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-6.0.10-i386-netboot/ruby.sh b/templates/Debian-6.0.10-i386-netboot/ruby.sh new file mode 100644 index 00000000..08d443a9 --- /dev/null +++ b/templates/Debian-6.0.10-i386-netboot/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libruby1.8 ri + +# Install Rubygems from source +rg_ver=1.6.2 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-6.0.10-i386-netboot/vagrant.sh b/templates/Debian-6.0.10-i386-netboot/vagrant.sh new file mode 100644 index 00000000..34e383cc --- /dev/null +++ b/templates/Debian-6.0.10-i386-netboot/vagrant.sh @@ -0,0 +1,25 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Add groups puppet and chef +groupadd puppet +groupadd chef + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -Lo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common + + diff --git a/templates/Debian-6.0.10-i386-netboot/virtualbox.sh b/templates/Debian-6.0.10-i386-netboot/virtualbox.sh new file mode 100644 index 00000000..158084c5 --- /dev/null +++ b/templates/Debian-6.0.10-i386-netboot/virtualbox.sh @@ -0,0 +1,18 @@ +if test -f .vbox_version ; then + + # Without libdbus virtualbox would not start automatically after compile + apt-get -y install --no-install-recommends libdbus-1-3 + + # The netboot installs the VirtualBox support (old) so we have to remove it + /etc/init.d/virtualbox-ose-guest-utils stop + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + aptitude -y install dkms + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat /home/vagrant/.vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt +fi diff --git a/templates/Debian-7.1.0-i386-netboot/vmfusion.sh b/templates/Debian-6.0.10-i386-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/vmfusion.sh rename to templates/Debian-6.0.10-i386-netboot/vmfusion.sh diff --git a/templates/CentOS-6.5-x86_64-minimal/zerodisk.sh b/templates/Debian-6.0.10-i386-netboot/zerodisk.sh similarity index 100% rename from templates/CentOS-6.5-x86_64-minimal/zerodisk.sh rename to templates/Debian-6.0.10-i386-netboot/zerodisk.sh diff --git a/templates/Debian-6.0.3-amd64-netboot/definition.rb b/templates/Debian-6.0.3-amd64-netboot/definition.rb index 7f569de3..efe36093 100644 --- a/templates/Debian-6.0.3-amd64-netboot/definition.rb +++ b/templates/Debian-6.0.3-amd64-netboot/definition.rb @@ -26,7 +26,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.3-i386-netboot/definition.rb b/templates/Debian-6.0.3-i386-netboot/definition.rb index 7bfba687..54d1f6c0 100644 --- a/templates/Debian-6.0.3-i386-netboot/definition.rb +++ b/templates/Debian-6.0.3-i386-netboot/definition.rb @@ -28,7 +28,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.4-amd64-netboot/definition.rb b/templates/Debian-6.0.4-amd64-netboot/definition.rb index 7ec2a29c..c0916692 100644 --- a/templates/Debian-6.0.4-amd64-netboot/definition.rb +++ b/templates/Debian-6.0.4-amd64-netboot/definition.rb @@ -26,7 +26,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.4-i386-netboot/definition.rb b/templates/Debian-6.0.4-i386-netboot/definition.rb index 238fedc5..6e3ff6a7 100644 --- a/templates/Debian-6.0.4-i386-netboot/definition.rb +++ b/templates/Debian-6.0.4-i386-netboot/definition.rb @@ -28,7 +28,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.5-amd64-netboot/definition.rb b/templates/Debian-6.0.5-amd64-netboot/definition.rb index 1ef5bae9..fb06ac44 100644 --- a/templates/Debian-6.0.5-amd64-netboot/definition.rb +++ b/templates/Debian-6.0.5-amd64-netboot/definition.rb @@ -26,7 +26,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.5-i386-netboot/definition.rb b/templates/Debian-6.0.5-i386-netboot/definition.rb index 02fce429..3b4dc3c2 100644 --- a/templates/Debian-6.0.5-i386-netboot/definition.rb +++ b/templates/Debian-6.0.5-i386-netboot/definition.rb @@ -28,7 +28,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.6-amd64-netboot/base.sh b/templates/Debian-6.0.6-amd64-netboot/base.sh index 048b7a09..0c531048 100644 --- a/templates/Debian-6.0.6-amd64-netboot/base.sh +++ b/templates/Debian-6.0.6-amd64-netboot/base.sh @@ -7,7 +7,7 @@ apt-get clean # Set up sudo ( cat <<'EOP' -%vagrant ALL=NOPASSWD:ALL +%vagrant ALL=(ALL) NOPASSWD: ALL EOP ) > /tmp/vagrant chmod 0440 /tmp/vagrant diff --git a/templates/Debian-6.0.6-amd64-netboot/definition.rb b/templates/Debian-6.0.6-amd64-netboot/definition.rb index 27b478b8..de06896f 100644 --- a/templates/Debian-6.0.6-amd64-netboot/definition.rb +++ b/templates/Debian-6.0.6-amd64-netboot/definition.rb @@ -26,7 +26,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.6-i386-netboot/definition.rb b/templates/Debian-6.0.6-i386-netboot/definition.rb index 447fd163..250e2019 100644 --- a/templates/Debian-6.0.6-i386-netboot/definition.rb +++ b/templates/Debian-6.0.6-i386-netboot/definition.rb @@ -34,7 +34,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.7-amd64-netboot/definition.rb b/templates/Debian-6.0.7-amd64-netboot/definition.rb index b6766201..1f865a3b 100644 --- a/templates/Debian-6.0.7-amd64-netboot/definition.rb +++ b/templates/Debian-6.0.7-amd64-netboot/definition.rb @@ -26,7 +26,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.7-i386-netboot/definition.rb b/templates/Debian-6.0.7-i386-netboot/definition.rb index ad5d780d..6176a0a3 100644 --- a/templates/Debian-6.0.7-i386-netboot/definition.rb +++ b/templates/Debian-6.0.7-i386-netboot/definition.rb @@ -34,7 +34,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.8-amd64-netboot/definition.rb b/templates/Debian-6.0.8-amd64-netboot/definition.rb index 853aa3ee..4d3c13f4 100644 --- a/templates/Debian-6.0.8-amd64-netboot/definition.rb +++ b/templates/Debian-6.0.8-amd64-netboot/definition.rb @@ -24,7 +24,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.8-i386-netboot/definition.rb b/templates/Debian-6.0.8-i386-netboot/definition.rb index d7c26272..1bc6d819 100644 --- a/templates/Debian-6.0.8-i386-netboot/definition.rb +++ b/templates/Debian-6.0.8-i386-netboot/definition.rb @@ -32,7 +32,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.9-amd64-netboot/definition.rb b/templates/Debian-6.0.9-amd64-netboot/definition.rb index 2565f73f..db08f907 100644 --- a/templates/Debian-6.0.9-amd64-netboot/definition.rb +++ b/templates/Debian-6.0.9-amd64-netboot/definition.rb @@ -24,7 +24,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-6.0.9-i386-netboot/definition.rb b/templates/Debian-6.0.9-i386-netboot/definition.rb index 95418860..52a9b16f 100644 --- a/templates/Debian-6.0.9-i386-netboot/definition.rb +++ b/templates/Debian-6.0.9-i386-netboot/definition.rb @@ -24,7 +24,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-7.0-amd64-netboot/base.sh b/templates/Debian-7.0-amd64-netboot/base.sh index 351daed9..aec65ad2 100644 --- a/templates/Debian-7.0-amd64-netboot/base.sh +++ b/templates/Debian-7.0-amd64-netboot/base.sh @@ -1,11 +1,12 @@ # Update the box +export DEBIAN_FRONTEND=noninteractive apt-get -y update apt-get -y install linux-headers-$(uname -r) build-essential apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev apt-get -y install curl unzip # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.0-amd64-netboot/definition.rb b/templates/Debian-7.0-amd64-netboot/definition.rb index 44fee194..2744adca 100644 --- a/templates/Debian-7.0-amd64-netboot/definition.rb +++ b/templates/Debian-7.0-amd64-netboot/definition.rb @@ -6,9 +6,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian_64', :iso_file => "debian-7.0.0-amd64-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.0.0/amd64/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.0.0/amd64/iso-cd/debian-7.0.0-amd64-netinst.iso", :iso_md5 => "6a55096340b5b1b7d335d5b559e13ea0", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -29,7 +27,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -47,6 +45,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup-virtualbox.sh", "cleanup.sh", "zerodisk.sh" diff --git a/templates/Debian-7.0-amd64-netboot/systemd.sh b/templates/Debian-7.0-amd64-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.0-amd64-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.0-i386-netboot/base.sh b/templates/Debian-7.0-i386-netboot/base.sh index a5489f5a..07f877f7 100644 --- a/templates/Debian-7.0-i386-netboot/base.sh +++ b/templates/Debian-7.0-i386-netboot/base.sh @@ -1,4 +1,5 @@ # Update the box +export DEBIAN_FRONTEND=noninteractive apt-get -y update apt-get -y install linux-headers-$(uname -r) build-essential apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev @@ -6,7 +7,7 @@ apt-get -y install curl unzip apt-get clean # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.0-i386-netboot/definition.rb b/templates/Debian-7.0-i386-netboot/definition.rb index e897e4e7..bbcd9cb9 100644 --- a/templates/Debian-7.0-i386-netboot/definition.rb +++ b/templates/Debian-7.0-i386-netboot/definition.rb @@ -7,9 +7,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-7.0.0-i386-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.0.0/i386/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.0.0/i386/iso-cd/debian-7.0.0-i386-netinst.iso", :iso_md5 => "a6b93666a5393334accb7ac4ee28d949", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -30,7 +28,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -48,6 +46,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup-virtualbox.sh", "cleanup.sh", "zerodisk.sh" diff --git a/templates/Debian-7.0-i386-netboot/systemd.sh b/templates/Debian-7.0-i386-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.0-i386-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.1-amd64-netboot/base.sh b/templates/Debian-7.1-amd64-netboot/base.sh new file mode 100644 index 00000000..aec65ad2 --- /dev/null +++ b/templates/Debian-7.1-amd64-netboot/base.sh @@ -0,0 +1,26 @@ +# Update the box +export DEBIAN_FRONTEND=noninteractive +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-7.1.0-amd64-netboot/chef.sh b/templates/Debian-7.1-amd64-netboot/chef.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/chef.sh rename to templates/Debian-7.1-amd64-netboot/chef.sh diff --git a/templates/Debian-7.2.0-amd64-netboot/cleanup-virtualbox.sh b/templates/Debian-7.1-amd64-netboot/cleanup-virtualbox.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/cleanup-virtualbox.sh rename to templates/Debian-7.1-amd64-netboot/cleanup-virtualbox.sh diff --git a/templates/Debian-7.1.0-amd64-netboot/cleanup.sh b/templates/Debian-7.1-amd64-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/cleanup.sh rename to templates/Debian-7.1-amd64-netboot/cleanup.sh diff --git a/templates/Debian-7.1.0-amd64-netboot/definition.rb b/templates/Debian-7.1-amd64-netboot/definition.rb similarity index 83% rename from templates/Debian-7.1.0-amd64-netboot/definition.rb rename to templates/Debian-7.1-amd64-netboot/definition.rb index 30346f26..2da39157 100644 --- a/templates/Debian-7.1.0-amd64-netboot/definition.rb +++ b/templates/Debian-7.1-amd64-netboot/definition.rb @@ -6,9 +6,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian_64', :iso_file => "debian-7.1.0-amd64-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.1.0/amd64/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.1.0/amd64/iso-cd/debian-7.1.0-amd64-netinst.iso", :iso_md5 => "80f498a1f9daa76bc911ae13692e4495", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -29,7 +27,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -47,6 +45,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup-virtualbox.sh", "cleanup.sh", "zerodisk.sh" diff --git a/templates/Debian-7.1.0-amd64-netboot/preseed.cfg b/templates/Debian-7.1-amd64-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/preseed.cfg rename to templates/Debian-7.1-amd64-netboot/preseed.cfg diff --git a/templates/Debian-7.1.0-amd64-netboot/puppet.sh b/templates/Debian-7.1-amd64-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/puppet.sh rename to templates/Debian-7.1-amd64-netboot/puppet.sh diff --git a/templates/Debian-7.1.0-amd64-netboot/ruby.sh b/templates/Debian-7.1-amd64-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/ruby.sh rename to templates/Debian-7.1-amd64-netboot/ruby.sh diff --git a/templates/Debian-7.1-amd64-netboot/systemd.sh b/templates/Debian-7.1-amd64-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.1-amd64-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.1.0-amd64-netboot/vagrant.sh b/templates/Debian-7.1-amd64-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/vagrant.sh rename to templates/Debian-7.1-amd64-netboot/vagrant.sh diff --git a/templates/Debian-7.1.0-amd64-netboot/virtualbox.sh b/templates/Debian-7.1-amd64-netboot/virtualbox.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/virtualbox.sh rename to templates/Debian-7.1-amd64-netboot/virtualbox.sh diff --git a/templates/CentOS-6.5-i386-netboot/vmfusion.sh b/templates/Debian-7.1-amd64-netboot/vmfusion.sh similarity index 50% rename from templates/CentOS-6.5-i386-netboot/vmfusion.sh rename to templates/Debian-7.1-amd64-netboot/vmfusion.sh index 3bd2e1b2..d654a02c 100644 --- a/templates/CentOS-6.5-i386-netboot/vmfusion.sh +++ b/templates/Debian-7.1-amd64-netboot/vmfusion.sh @@ -1,10 +1,7 @@ -# vmware-vmblock-fuse requires libfuse.so -yum -y install fuse-libs - cd /tmp mkdir -p /mnt/cdrom -mount -o loop /home/veewee/linux.iso /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom tar zxf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ /tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso umount /mnt/cdrom -rm /home/veewee/linux.iso diff --git a/templates/CentOS-6.5-x86_64-netboot/zerodisk.sh b/templates/Debian-7.1-amd64-netboot/zerodisk.sh similarity index 100% rename from templates/CentOS-6.5-x86_64-netboot/zerodisk.sh rename to templates/Debian-7.1-amd64-netboot/zerodisk.sh diff --git a/templates/Debian-7.4.0-i386-netboot/base.sh b/templates/Debian-7.1-i386-netboot/base.sh similarity index 86% rename from templates/Debian-7.4.0-i386-netboot/base.sh rename to templates/Debian-7.1-i386-netboot/base.sh index a5489f5a..07f877f7 100644 --- a/templates/Debian-7.4.0-i386-netboot/base.sh +++ b/templates/Debian-7.1-i386-netboot/base.sh @@ -1,4 +1,5 @@ # Update the box +export DEBIAN_FRONTEND=noninteractive apt-get -y update apt-get -y install linux-headers-$(uname -r) build-essential apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev @@ -6,7 +7,7 @@ apt-get -y install curl unzip apt-get clean # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.3.0-i386-netboot/chef.sh b/templates/Debian-7.1-i386-netboot/chef.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/chef.sh rename to templates/Debian-7.1-i386-netboot/chef.sh diff --git a/templates/Debian-7.2.0-i386-netboot/cleanup-virtualbox.sh b/templates/Debian-7.1-i386-netboot/cleanup-virtualbox.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/cleanup-virtualbox.sh rename to templates/Debian-7.1-i386-netboot/cleanup-virtualbox.sh diff --git a/templates/Debian-7.3.0-i386-netboot/cleanup.sh b/templates/Debian-7.1-i386-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/cleanup.sh rename to templates/Debian-7.1-i386-netboot/cleanup.sh diff --git a/templates/Debian-7.1.0-i386-netboot/definition.rb b/templates/Debian-7.1-i386-netboot/definition.rb similarity index 83% rename from templates/Debian-7.1.0-i386-netboot/definition.rb rename to templates/Debian-7.1-i386-netboot/definition.rb index 0eb76a80..e54c4743 100644 --- a/templates/Debian-7.1.0-i386-netboot/definition.rb +++ b/templates/Debian-7.1-i386-netboot/definition.rb @@ -4,9 +4,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-7.1.0-i386-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.1.0/i386/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.1.0/i386/iso-cd/debian-7.1.0-i386-netinst.iso", :iso_md5 => "a70efb67ca061175eabe7c5dc04ab323", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -27,7 +25,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -45,6 +43,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup-virtualbox.sh", "cleanup.sh", "zerodisk.sh" diff --git a/templates/Debian-7.1.0-i386-netboot/preseed.cfg b/templates/Debian-7.1-i386-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/preseed.cfg rename to templates/Debian-7.1-i386-netboot/preseed.cfg diff --git a/templates/Debian-7.1.0-i386-netboot/puppet.sh b/templates/Debian-7.1-i386-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/puppet.sh rename to templates/Debian-7.1-i386-netboot/puppet.sh diff --git a/templates/Debian-7.1.0-i386-netboot/ruby.sh b/templates/Debian-7.1-i386-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/ruby.sh rename to templates/Debian-7.1-i386-netboot/ruby.sh diff --git a/templates/Debian-7.1-i386-netboot/systemd.sh b/templates/Debian-7.1-i386-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.1-i386-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.1.0-i386-netboot/vagrant.sh b/templates/Debian-7.1-i386-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/vagrant.sh rename to templates/Debian-7.1-i386-netboot/vagrant.sh diff --git a/templates/Debian-7.1.0-i386-netboot/virtualbox.sh b/templates/Debian-7.1-i386-netboot/virtualbox.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/virtualbox.sh rename to templates/Debian-7.1-i386-netboot/virtualbox.sh diff --git a/templates/CentOS-6.5-x86_64-minimal/vmfusion.sh b/templates/Debian-7.1-i386-netboot/vmfusion.sh similarity index 50% rename from templates/CentOS-6.5-x86_64-minimal/vmfusion.sh rename to templates/Debian-7.1-i386-netboot/vmfusion.sh index 3bd2e1b2..d654a02c 100644 --- a/templates/CentOS-6.5-x86_64-minimal/vmfusion.sh +++ b/templates/Debian-7.1-i386-netboot/vmfusion.sh @@ -1,10 +1,7 @@ -# vmware-vmblock-fuse requires libfuse.so -yum -y install fuse-libs - cd /tmp mkdir -p /mnt/cdrom -mount -o loop /home/veewee/linux.iso /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom tar zxf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ /tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso umount /mnt/cdrom -rm /home/veewee/linux.iso diff --git a/templates/Debian-7.1.0-amd64-netboot/zerodisk.sh b/templates/Debian-7.1-i386-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.1.0-amd64-netboot/zerodisk.sh rename to templates/Debian-7.1-i386-netboot/zerodisk.sh diff --git a/templates/Debian-7.2-amd64-netboot/base.sh b/templates/Debian-7.2-amd64-netboot/base.sh new file mode 100644 index 00000000..aec65ad2 --- /dev/null +++ b/templates/Debian-7.2-amd64-netboot/base.sh @@ -0,0 +1,26 @@ +# Update the box +export DEBIAN_FRONTEND=noninteractive +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-7.2.0-amd64-netboot/chef.sh b/templates/Debian-7.2-amd64-netboot/chef.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/chef.sh rename to templates/Debian-7.2-amd64-netboot/chef.sh diff --git a/templates/Debian-7.3.0-amd64-netboot/cleanup-virtualbox.sh b/templates/Debian-7.2-amd64-netboot/cleanup-virtualbox.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/cleanup-virtualbox.sh rename to templates/Debian-7.2-amd64-netboot/cleanup-virtualbox.sh diff --git a/templates/Debian-7.2.0-amd64-netboot/cleanup.sh b/templates/Debian-7.2-amd64-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/cleanup.sh rename to templates/Debian-7.2-amd64-netboot/cleanup.sh diff --git a/templates/Debian-7.2.0-amd64-netboot/definition.rb b/templates/Debian-7.2-amd64-netboot/definition.rb similarity index 83% rename from templates/Debian-7.2.0-amd64-netboot/definition.rb rename to templates/Debian-7.2-amd64-netboot/definition.rb index 3d9b313e..a832d73c 100644 --- a/templates/Debian-7.2.0-amd64-netboot/definition.rb +++ b/templates/Debian-7.2-amd64-netboot/definition.rb @@ -6,9 +6,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian_64', :iso_file => "debian-7.2.0-amd64-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.2.0/amd64/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.2.0/amd64/iso-cd/debian-7.2.0-amd64-netinst.iso", :iso_md5 => "b86774fe4de88be6378ba3d71b8029bd", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -29,7 +27,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -47,6 +45,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup-virtualbox.sh", "cleanup.sh", "zerodisk.sh" diff --git a/templates/Debian-7.2.0-amd64-netboot/preseed.cfg b/templates/Debian-7.2-amd64-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/preseed.cfg rename to templates/Debian-7.2-amd64-netboot/preseed.cfg diff --git a/templates/Debian-7.2.0-amd64-netboot/puppet.sh b/templates/Debian-7.2-amd64-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/puppet.sh rename to templates/Debian-7.2-amd64-netboot/puppet.sh diff --git a/templates/Debian-7.2.0-amd64-netboot/ruby.sh b/templates/Debian-7.2-amd64-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/ruby.sh rename to templates/Debian-7.2-amd64-netboot/ruby.sh diff --git a/templates/Debian-7.2-amd64-netboot/systemd.sh b/templates/Debian-7.2-amd64-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.2-amd64-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.2-amd64-netboot/vagrant.sh b/templates/Debian-7.2-amd64-netboot/vagrant.sh new file mode 100644 index 00000000..822c40ac --- /dev/null +++ b/templates/Debian-7.2-amd64-netboot/vagrant.sh @@ -0,0 +1,22 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -fLo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' || + exit $? +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common + + diff --git a/templates/Debian-7.2.0-amd64-netboot/virtualbox.sh b/templates/Debian-7.2-amd64-netboot/virtualbox.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/virtualbox.sh rename to templates/Debian-7.2-amd64-netboot/virtualbox.sh diff --git a/templates/Debian-7.2.0-amd64-netboot/vmfusion.sh b/templates/Debian-7.2-amd64-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/vmfusion.sh rename to templates/Debian-7.2-amd64-netboot/vmfusion.sh diff --git a/templates/Debian-7.1.0-i386-netboot/zerodisk.sh b/templates/Debian-7.2-amd64-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.1.0-i386-netboot/zerodisk.sh rename to templates/Debian-7.2-amd64-netboot/zerodisk.sh diff --git a/templates/Debian-7.2.0-i386-netboot/base.sh b/templates/Debian-7.2-i386-netboot/base.sh similarity index 86% rename from templates/Debian-7.2.0-i386-netboot/base.sh rename to templates/Debian-7.2-i386-netboot/base.sh index a5489f5a..07f877f7 100644 --- a/templates/Debian-7.2.0-i386-netboot/base.sh +++ b/templates/Debian-7.2-i386-netboot/base.sh @@ -1,4 +1,5 @@ # Update the box +export DEBIAN_FRONTEND=noninteractive apt-get -y update apt-get -y install linux-headers-$(uname -r) build-essential apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev @@ -6,7 +7,7 @@ apt-get -y install curl unzip apt-get clean # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.4.0-i386-netboot/chef.sh b/templates/Debian-7.2-i386-netboot/chef.sh similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/chef.sh rename to templates/Debian-7.2-i386-netboot/chef.sh diff --git a/templates/Debian-7.3.0-i386-netboot/cleanup-virtualbox.sh b/templates/Debian-7.2-i386-netboot/cleanup-virtualbox.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/cleanup-virtualbox.sh rename to templates/Debian-7.2-i386-netboot/cleanup-virtualbox.sh diff --git a/templates/Debian-7.4.0-i386-netboot/cleanup.sh b/templates/Debian-7.2-i386-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/cleanup.sh rename to templates/Debian-7.2-i386-netboot/cleanup.sh diff --git a/templates/Debian-7.2.0-i386-netboot/definition.rb b/templates/Debian-7.2-i386-netboot/definition.rb similarity index 83% rename from templates/Debian-7.2.0-i386-netboot/definition.rb rename to templates/Debian-7.2-i386-netboot/definition.rb index fcbd2aa6..bd0578db 100644 --- a/templates/Debian-7.2.0-i386-netboot/definition.rb +++ b/templates/Debian-7.2-i386-netboot/definition.rb @@ -4,9 +4,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-7.2.0-i386-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.2.0/i386/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.2.0/i386/iso-cd/debian-7.2.0-i386-netinst.iso", :iso_md5 => "564282a81b5aef7015501e497fc63d81", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -27,7 +25,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -45,6 +43,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup-virtualbox.sh", "cleanup.sh", "zerodisk.sh" diff --git a/templates/Debian-7.2.0-i386-netboot/preseed.cfg b/templates/Debian-7.2-i386-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/preseed.cfg rename to templates/Debian-7.2-i386-netboot/preseed.cfg diff --git a/templates/Debian-7.2.0-i386-netboot/puppet.sh b/templates/Debian-7.2-i386-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/puppet.sh rename to templates/Debian-7.2-i386-netboot/puppet.sh diff --git a/templates/Debian-7.2.0-i386-netboot/ruby.sh b/templates/Debian-7.2-i386-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/ruby.sh rename to templates/Debian-7.2-i386-netboot/ruby.sh diff --git a/templates/Debian-7.2-i386-netboot/systemd.sh b/templates/Debian-7.2-i386-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.2-i386-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.2-i386-netboot/vagrant.sh b/templates/Debian-7.2-i386-netboot/vagrant.sh new file mode 100644 index 00000000..36c9a18a --- /dev/null +++ b/templates/Debian-7.2-i386-netboot/vagrant.sh @@ -0,0 +1,24 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Add groups puppet and chef +groupadd puppet +groupadd chef + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -fLo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' || + exit $? +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common diff --git a/templates/Debian-7.2.0-i386-netboot/virtualbox.sh b/templates/Debian-7.2-i386-netboot/virtualbox.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/virtualbox.sh rename to templates/Debian-7.2-i386-netboot/virtualbox.sh diff --git a/templates/Debian-7.2.0-i386-netboot/vmfusion.sh b/templates/Debian-7.2-i386-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/vmfusion.sh rename to templates/Debian-7.2-i386-netboot/vmfusion.sh diff --git a/templates/Debian-7.2.0-amd64-netboot/zerodisk.sh b/templates/Debian-7.2-i386-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/zerodisk.sh rename to templates/Debian-7.2-i386-netboot/zerodisk.sh diff --git a/templates/Debian-7.3-amd64-netboot/base.sh b/templates/Debian-7.3-amd64-netboot/base.sh new file mode 100644 index 00000000..aec65ad2 --- /dev/null +++ b/templates/Debian-7.3-amd64-netboot/base.sh @@ -0,0 +1,26 @@ +# Update the box +export DEBIAN_FRONTEND=noninteractive +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-7.3.0-amd64-netboot/chef.sh b/templates/Debian-7.3-amd64-netboot/chef.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/chef.sh rename to templates/Debian-7.3-amd64-netboot/chef.sh diff --git a/templates/Debian-7.3-amd64-netboot/cleanup-virtualbox.sh b/templates/Debian-7.3-amd64-netboot/cleanup-virtualbox.sh new file mode 100644 index 00000000..ccc6d5a6 --- /dev/null +++ b/templates/Debian-7.3-amd64-netboot/cleanup-virtualbox.sh @@ -0,0 +1,4 @@ +# Cleanup Virtualbox +VBOX_VERSION=$(cat .vbox_version) +VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso +rm $VBOX_ISO diff --git a/templates/Debian-7.3.0-amd64-netboot/cleanup.sh b/templates/Debian-7.3-amd64-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/cleanup.sh rename to templates/Debian-7.3-amd64-netboot/cleanup.sh diff --git a/templates/Debian-7.3.0-amd64-netboot/definition.rb b/templates/Debian-7.3-amd64-netboot/definition.rb similarity index 83% rename from templates/Debian-7.3.0-amd64-netboot/definition.rb rename to templates/Debian-7.3-amd64-netboot/definition.rb index 483fbb2b..199ac2bd 100644 --- a/templates/Debian-7.3.0-amd64-netboot/definition.rb +++ b/templates/Debian-7.3-amd64-netboot/definition.rb @@ -6,9 +6,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian_64', :iso_file => "debian-7.3.0-amd64-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.3.0/amd64/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.3.0/amd64/iso-cd/debian-7.3.0-amd64-netinst.iso", :iso_md5 => "72473e8a5e65b61acc7efde90d9f71d1", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -29,7 +27,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -47,6 +45,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup-virtualbox.sh", "cleanup.sh", "zerodisk.sh" diff --git a/templates/Debian-7.3.0-amd64-netboot/preseed.cfg b/templates/Debian-7.3-amd64-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/preseed.cfg rename to templates/Debian-7.3-amd64-netboot/preseed.cfg diff --git a/templates/Debian-7.3.0-amd64-netboot/puppet.sh b/templates/Debian-7.3-amd64-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/puppet.sh rename to templates/Debian-7.3-amd64-netboot/puppet.sh diff --git a/templates/Debian-7.3.0-amd64-netboot/ruby.sh b/templates/Debian-7.3-amd64-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/ruby.sh rename to templates/Debian-7.3-amd64-netboot/ruby.sh diff --git a/templates/Debian-7.3-amd64-netboot/systemd.sh b/templates/Debian-7.3-amd64-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.3-amd64-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.2.0-amd64-netboot/vagrant.sh b/templates/Debian-7.3-amd64-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.2.0-amd64-netboot/vagrant.sh rename to templates/Debian-7.3-amd64-netboot/vagrant.sh diff --git a/templates/Debian-7.3.0-amd64-netboot/virtualbox.sh b/templates/Debian-7.3-amd64-netboot/virtualbox.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/virtualbox.sh rename to templates/Debian-7.3-amd64-netboot/virtualbox.sh diff --git a/templates/Debian-7.3.0-amd64-netboot/vmfusion.sh b/templates/Debian-7.3-amd64-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/vmfusion.sh rename to templates/Debian-7.3-amd64-netboot/vmfusion.sh diff --git a/templates/Debian-7.2.0-i386-netboot/zerodisk.sh b/templates/Debian-7.3-amd64-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/zerodisk.sh rename to templates/Debian-7.3-amd64-netboot/zerodisk.sh diff --git a/templates/Debian-7.3-i386-netboot/base.sh b/templates/Debian-7.3-i386-netboot/base.sh new file mode 100644 index 00000000..07f877f7 --- /dev/null +++ b/templates/Debian-7.3-i386-netboot/base.sh @@ -0,0 +1,27 @@ +# Update the box +export DEBIAN_FRONTEND=noninteractive +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip +apt-get clean + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-7.5.0-i386-netboot/chef.sh b/templates/Debian-7.3-i386-netboot/chef.sh similarity index 100% rename from templates/Debian-7.5.0-i386-netboot/chef.sh rename to templates/Debian-7.3-i386-netboot/chef.sh diff --git a/templates/Debian-7.3-i386-netboot/cleanup-virtualbox.sh b/templates/Debian-7.3-i386-netboot/cleanup-virtualbox.sh new file mode 100644 index 00000000..ccc6d5a6 --- /dev/null +++ b/templates/Debian-7.3-i386-netboot/cleanup-virtualbox.sh @@ -0,0 +1,4 @@ +# Cleanup Virtualbox +VBOX_VERSION=$(cat .vbox_version) +VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso +rm $VBOX_ISO diff --git a/templates/Debian-7.5.0-i386-netboot/cleanup.sh b/templates/Debian-7.3-i386-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.5.0-i386-netboot/cleanup.sh rename to templates/Debian-7.3-i386-netboot/cleanup.sh diff --git a/templates/Debian-7.3.0-i386-netboot/definition.rb b/templates/Debian-7.3-i386-netboot/definition.rb similarity index 83% rename from templates/Debian-7.3.0-i386-netboot/definition.rb rename to templates/Debian-7.3-i386-netboot/definition.rb index 41069862..d48bb597 100644 --- a/templates/Debian-7.3.0-i386-netboot/definition.rb +++ b/templates/Debian-7.3-i386-netboot/definition.rb @@ -4,9 +4,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-7.3.0-i386-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.3.0/i386/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.3.0/i386/iso-cd/debian-7.3.0-i386-netinst.iso", :iso_md5 => "04c58f30744e64a0459caf7d7cace479", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -27,7 +25,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -45,6 +43,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup-virtualbox.sh", "cleanup.sh", "zerodisk.sh" diff --git a/templates/Debian-7.3.0-i386-netboot/preseed.cfg b/templates/Debian-7.3-i386-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/preseed.cfg rename to templates/Debian-7.3-i386-netboot/preseed.cfg diff --git a/templates/Debian-7.3.0-i386-netboot/puppet.sh b/templates/Debian-7.3-i386-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/puppet.sh rename to templates/Debian-7.3-i386-netboot/puppet.sh diff --git a/templates/Debian-7.3.0-i386-netboot/ruby.sh b/templates/Debian-7.3-i386-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/ruby.sh rename to templates/Debian-7.3-i386-netboot/ruby.sh diff --git a/templates/Debian-7.3-i386-netboot/systemd.sh b/templates/Debian-7.3-i386-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.3-i386-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.2.0-i386-netboot/vagrant.sh b/templates/Debian-7.3-i386-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.2.0-i386-netboot/vagrant.sh rename to templates/Debian-7.3-i386-netboot/vagrant.sh diff --git a/templates/Debian-7.3.0-i386-netboot/virtualbox.sh b/templates/Debian-7.3-i386-netboot/virtualbox.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/virtualbox.sh rename to templates/Debian-7.3-i386-netboot/virtualbox.sh diff --git a/templates/Debian-7.3.0-i386-netboot/vmfusion.sh b/templates/Debian-7.3-i386-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/vmfusion.sh rename to templates/Debian-7.3-i386-netboot/vmfusion.sh diff --git a/templates/Debian-7.3.0-amd64-netboot/zerodisk.sh b/templates/Debian-7.3-i386-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/zerodisk.sh rename to templates/Debian-7.3-i386-netboot/zerodisk.sh diff --git a/templates/Debian-7.4-amd64-netboot/base.sh b/templates/Debian-7.4-amd64-netboot/base.sh new file mode 100644 index 00000000..aec65ad2 --- /dev/null +++ b/templates/Debian-7.4-amd64-netboot/base.sh @@ -0,0 +1,26 @@ +# Update the box +export DEBIAN_FRONTEND=noninteractive +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-7.4.0-amd64-netboot/chef.sh b/templates/Debian-7.4-amd64-netboot/chef.sh similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/chef.sh rename to templates/Debian-7.4-amd64-netboot/chef.sh diff --git a/templates/Debian-7.4.0-amd64-netboot/cleanup.sh b/templates/Debian-7.4-amd64-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/cleanup.sh rename to templates/Debian-7.4-amd64-netboot/cleanup.sh diff --git a/templates/Debian-7.4.0-amd64-netboot/definition.rb b/templates/Debian-7.4-amd64-netboot/definition.rb similarity index 83% rename from templates/Debian-7.4.0-amd64-netboot/definition.rb rename to templates/Debian-7.4-amd64-netboot/definition.rb index b59458d9..bc0f3856 100644 --- a/templates/Debian-7.4.0-amd64-netboot/definition.rb +++ b/templates/Debian-7.4-amd64-netboot/definition.rb @@ -6,9 +6,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian_64', :iso_file => "debian-7.4.0-amd64-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.4.0/amd64/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.4.0/amd64/iso-cd/debian-7.4.0-amd64-netinst.iso", :iso_md5 => "e7e9433973f082a297793c3c5010b2c5", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -29,7 +27,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -47,6 +45,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup.sh", "zerodisk.sh" ], diff --git a/templates/Debian-7.4.0-amd64-netboot/preseed.cfg b/templates/Debian-7.4-amd64-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/preseed.cfg rename to templates/Debian-7.4-amd64-netboot/preseed.cfg diff --git a/templates/Debian-7.4.0-amd64-netboot/puppet.sh b/templates/Debian-7.4-amd64-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/puppet.sh rename to templates/Debian-7.4-amd64-netboot/puppet.sh diff --git a/templates/Debian-7.4.0-amd64-netboot/ruby.sh b/templates/Debian-7.4-amd64-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/ruby.sh rename to templates/Debian-7.4-amd64-netboot/ruby.sh diff --git a/templates/Debian-7.4-amd64-netboot/systemd.sh b/templates/Debian-7.4-amd64-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.4-amd64-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.3.0-amd64-netboot/vagrant.sh b/templates/Debian-7.4-amd64-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.3.0-amd64-netboot/vagrant.sh rename to templates/Debian-7.4-amd64-netboot/vagrant.sh diff --git a/templates/Debian-7.4.0-amd64-netboot/virtualbox.sh b/templates/Debian-7.4-amd64-netboot/virtualbox.sh similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/virtualbox.sh rename to templates/Debian-7.4-amd64-netboot/virtualbox.sh diff --git a/templates/Debian-7.4.0-amd64-netboot/vmfusion.sh b/templates/Debian-7.4-amd64-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/vmfusion.sh rename to templates/Debian-7.4-amd64-netboot/vmfusion.sh diff --git a/templates/Debian-7.3.0-i386-netboot/zerodisk.sh b/templates/Debian-7.4-amd64-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/zerodisk.sh rename to templates/Debian-7.4-amd64-netboot/zerodisk.sh diff --git a/templates/Debian-7.4-i386-netboot/base.sh b/templates/Debian-7.4-i386-netboot/base.sh new file mode 100644 index 00000000..07f877f7 --- /dev/null +++ b/templates/Debian-7.4-i386-netboot/base.sh @@ -0,0 +1,27 @@ +# Update the box +export DEBIAN_FRONTEND=noninteractive +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip +apt-get clean + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-7.6.0-i386-netboot/chef.sh b/templates/Debian-7.4-i386-netboot/chef.sh similarity index 100% rename from templates/Debian-7.6.0-i386-netboot/chef.sh rename to templates/Debian-7.4-i386-netboot/chef.sh diff --git a/templates/Debian-7.6.0-i386-netboot/cleanup.sh b/templates/Debian-7.4-i386-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.6.0-i386-netboot/cleanup.sh rename to templates/Debian-7.4-i386-netboot/cleanup.sh diff --git a/templates/Debian-7.4.0-i386-netboot/definition.rb b/templates/Debian-7.4-i386-netboot/definition.rb similarity index 82% rename from templates/Debian-7.4.0-i386-netboot/definition.rb rename to templates/Debian-7.4-i386-netboot/definition.rb index 84b99718..4a814b66 100644 --- a/templates/Debian-7.4.0-i386-netboot/definition.rb +++ b/templates/Debian-7.4-i386-netboot/definition.rb @@ -4,9 +4,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-7.4.0-i386-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.4.0/i386/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.4.0/i386/iso-cd/debian-7.4.0-i386-netinst.iso", :iso_md5 => "7339b668a81b417ac023d73739dc6a03", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -27,7 +25,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -45,6 +43,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup.sh", "zerodisk.sh" ], diff --git a/templates/Debian-7.4.0-i386-netboot/preseed.cfg b/templates/Debian-7.4-i386-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/preseed.cfg rename to templates/Debian-7.4-i386-netboot/preseed.cfg diff --git a/templates/Debian-7.4.0-i386-netboot/puppet.sh b/templates/Debian-7.4-i386-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/puppet.sh rename to templates/Debian-7.4-i386-netboot/puppet.sh diff --git a/templates/Debian-7.4.0-i386-netboot/ruby.sh b/templates/Debian-7.4-i386-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/ruby.sh rename to templates/Debian-7.4-i386-netboot/ruby.sh diff --git a/templates/Debian-7.4-i386-netboot/systemd.sh b/templates/Debian-7.4-i386-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.4-i386-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.3.0-i386-netboot/vagrant.sh b/templates/Debian-7.4-i386-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.3.0-i386-netboot/vagrant.sh rename to templates/Debian-7.4-i386-netboot/vagrant.sh diff --git a/templates/Debian-7.4.0-i386-netboot/virtualbox.sh b/templates/Debian-7.4-i386-netboot/virtualbox.sh similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/virtualbox.sh rename to templates/Debian-7.4-i386-netboot/virtualbox.sh diff --git a/templates/Debian-7.4.0-i386-netboot/vmfusion.sh b/templates/Debian-7.4-i386-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/vmfusion.sh rename to templates/Debian-7.4-i386-netboot/vmfusion.sh diff --git a/templates/Debian-7.4.0-amd64-netboot/zerodisk.sh b/templates/Debian-7.4-i386-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/zerodisk.sh rename to templates/Debian-7.4-i386-netboot/zerodisk.sh diff --git a/templates/Debian-7.3.0-amd64-netboot/base.sh b/templates/Debian-7.5-amd64-netboot/base.sh similarity index 91% rename from templates/Debian-7.3.0-amd64-netboot/base.sh rename to templates/Debian-7.5-amd64-netboot/base.sh index 351daed9..e3642f1c 100644 --- a/templates/Debian-7.3.0-amd64-netboot/base.sh +++ b/templates/Debian-7.5-amd64-netboot/base.sh @@ -5,7 +5,7 @@ apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev apt-get -y install curl unzip # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.5.0-amd64-netboot/chef.sh b/templates/Debian-7.5-amd64-netboot/chef.sh similarity index 100% rename from templates/Debian-7.5.0-amd64-netboot/chef.sh rename to templates/Debian-7.5-amd64-netboot/chef.sh diff --git a/templates/Debian-7.5.0-amd64-netboot/cleanup.sh b/templates/Debian-7.5-amd64-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.5.0-amd64-netboot/cleanup.sh rename to templates/Debian-7.5-amd64-netboot/cleanup.sh diff --git a/templates/Debian-7.5.0-amd64-netboot/definition.rb b/templates/Debian-7.5-amd64-netboot/definition.rb similarity index 83% rename from templates/Debian-7.5.0-amd64-netboot/definition.rb rename to templates/Debian-7.5-amd64-netboot/definition.rb index 448cf481..9145fb02 100644 --- a/templates/Debian-7.5.0-amd64-netboot/definition.rb +++ b/templates/Debian-7.5-amd64-netboot/definition.rb @@ -6,9 +6,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian_64', :iso_file => "debian-7.5.0-amd64-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.5.0/amd64/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.5.0/amd64/iso-cd/debian-7.5.0-amd64-netinst.iso", :iso_md5 => "8fdb6715228ea90faba58cb84644d296", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -29,7 +27,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -47,6 +45,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup.sh", "zerodisk.sh" ], diff --git a/templates/Debian-7.5.0-amd64-netboot/preseed.cfg b/templates/Debian-7.5-amd64-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.5.0-amd64-netboot/preseed.cfg rename to templates/Debian-7.5-amd64-netboot/preseed.cfg diff --git a/templates/Debian-7.5.0-amd64-netboot/puppet.sh b/templates/Debian-7.5-amd64-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.5.0-amd64-netboot/puppet.sh rename to templates/Debian-7.5-amd64-netboot/puppet.sh diff --git a/templates/Debian-7.5.0-amd64-netboot/ruby.sh b/templates/Debian-7.5-amd64-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.5.0-amd64-netboot/ruby.sh rename to templates/Debian-7.5-amd64-netboot/ruby.sh diff --git a/templates/Debian-7.5-amd64-netboot/systemd.sh b/templates/Debian-7.5-amd64-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.5-amd64-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.4.0-amd64-netboot/vagrant.sh b/templates/Debian-7.5-amd64-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.4.0-amd64-netboot/vagrant.sh rename to templates/Debian-7.5-amd64-netboot/vagrant.sh diff --git a/templates/Debian-7.5.0-amd64-netboot/virtualbox.sh b/templates/Debian-7.5-amd64-netboot/virtualbox.sh similarity index 83% rename from templates/Debian-7.5.0-amd64-netboot/virtualbox.sh rename to templates/Debian-7.5-amd64-netboot/virtualbox.sh index 1ee4acf1..4dad6492 100644 --- a/templates/Debian-7.5.0-amd64-netboot/virtualbox.sh +++ b/templates/Debian-7.5-amd64-netboot/virtualbox.sh @@ -32,4 +32,6 @@ if test -f .vbox_version ; then rm $VBOX_ISO + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions fi diff --git a/templates/Debian-7.5.0-amd64-netboot/vmfusion.sh b/templates/Debian-7.5-amd64-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.5.0-amd64-netboot/vmfusion.sh rename to templates/Debian-7.5-amd64-netboot/vmfusion.sh diff --git a/templates/Debian-7.4.0-i386-netboot/zerodisk.sh b/templates/Debian-7.5-amd64-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/zerodisk.sh rename to templates/Debian-7.5-amd64-netboot/zerodisk.sh diff --git a/templates/Debian-7.1.0-i386-netboot/base.sh b/templates/Debian-7.5-i386-netboot/base.sh similarity index 91% rename from templates/Debian-7.1.0-i386-netboot/base.sh rename to templates/Debian-7.5-i386-netboot/base.sh index a5489f5a..0dbd0803 100644 --- a/templates/Debian-7.1.0-i386-netboot/base.sh +++ b/templates/Debian-7.5-i386-netboot/base.sh @@ -6,7 +6,7 @@ apt-get -y install curl unzip apt-get clean # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.5-i386-netboot/chef.sh b/templates/Debian-7.5-i386-netboot/chef.sh new file mode 100644 index 00000000..76bfa5f3 --- /dev/null +++ b/templates/Debian-7.5-i386-netboot/chef.sh @@ -0,0 +1,2 @@ +# Install Chef +gem install chef --no-ri --no-rdoc diff --git a/templates/Debian-7.5-i386-netboot/cleanup.sh b/templates/Debian-7.5-i386-netboot/cleanup.sh new file mode 100644 index 00000000..bf8a6192 --- /dev/null +++ b/templates/Debian-7.5-i386-netboot/cleanup.sh @@ -0,0 +1,17 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-7.5.0-i386-netboot/definition.rb b/templates/Debian-7.5-i386-netboot/definition.rb similarity index 82% rename from templates/Debian-7.5.0-i386-netboot/definition.rb rename to templates/Debian-7.5-i386-netboot/definition.rb index b4734152..f76b9460 100644 --- a/templates/Debian-7.5.0-i386-netboot/definition.rb +++ b/templates/Debian-7.5-i386-netboot/definition.rb @@ -4,9 +4,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-7.5.0-i386-netinst.iso", - :iso_src => "", - :iso_download_instructions => "- You need to download this manually as the ISO is no longer directly downloadable.\n"+ - "Visit http://cdimage.debian.org/cdimage/archive/7.5.0/i386/ and download it via torrent or jigdo", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.5.0/i386/iso-cd/debian-7.5.0-i386-netinst.iso", :iso_md5 => "0e6eaacb5a5828473afe90f6df9c8f16", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -27,7 +25,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -45,6 +43,7 @@ "ruby.sh", "puppet.sh", "chef.sh", + "systemd.sh", "cleanup.sh", "zerodisk.sh" ], diff --git a/templates/Debian-7.5.0-i386-netboot/preseed.cfg b/templates/Debian-7.5-i386-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.5.0-i386-netboot/preseed.cfg rename to templates/Debian-7.5-i386-netboot/preseed.cfg diff --git a/templates/Debian-7.5.0-i386-netboot/puppet.sh b/templates/Debian-7.5-i386-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.5.0-i386-netboot/puppet.sh rename to templates/Debian-7.5-i386-netboot/puppet.sh diff --git a/templates/Debian-7.5.0-i386-netboot/ruby.sh b/templates/Debian-7.5-i386-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.5.0-i386-netboot/ruby.sh rename to templates/Debian-7.5-i386-netboot/ruby.sh diff --git a/templates/Debian-7.5-i386-netboot/systemd.sh b/templates/Debian-7.5-i386-netboot/systemd.sh new file mode 100644 index 00000000..2ac09634 --- /dev/null +++ b/templates/Debian-7.5-i386-netboot/systemd.sh @@ -0,0 +1,22 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to not installing systemd +if [ "$USE_SYSTEMD" = yes ]; then + apt-get install -y systemd + + cat > /etc/default/grub << EOF +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=Debian +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="init=/lib/systemd/systemd debian-installer=en_US" +EOF + + update-grub +fi diff --git a/templates/Debian-7.4.0-i386-netboot/vagrant.sh b/templates/Debian-7.5-i386-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.4.0-i386-netboot/vagrant.sh rename to templates/Debian-7.5-i386-netboot/vagrant.sh diff --git a/templates/Debian-7.6.0-i386-netboot/virtualbox.sh b/templates/Debian-7.5-i386-netboot/virtualbox.sh similarity index 84% rename from templates/Debian-7.6.0-i386-netboot/virtualbox.sh rename to templates/Debian-7.5-i386-netboot/virtualbox.sh index 961d9d12..c8e37c20 100644 --- a/templates/Debian-7.6.0-i386-netboot/virtualbox.sh +++ b/templates/Debian-7.5-i386-netboot/virtualbox.sh @@ -33,4 +33,6 @@ if test -f .vbox_version ; then # Implement old cleanup-virtualbox.sh rm $VBOX_ISO + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions fi diff --git a/templates/Debian-7.5.0-i386-netboot/vmfusion.sh b/templates/Debian-7.5-i386-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.5.0-i386-netboot/vmfusion.sh rename to templates/Debian-7.5-i386-netboot/vmfusion.sh diff --git a/templates/Debian-7.5.0-amd64-netboot/zerodisk.sh b/templates/Debian-7.5-i386-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.5.0-amd64-netboot/zerodisk.sh rename to templates/Debian-7.5-i386-netboot/zerodisk.sh diff --git a/templates/Debian-7.5.0-amd64-netboot/base.sh b/templates/Debian-7.5.0-amd64-netboot/base.sh deleted file mode 100644 index 351daed9..00000000 --- a/templates/Debian-7.5.0-amd64-netboot/base.sh +++ /dev/null @@ -1,25 +0,0 @@ -# Update the box -apt-get -y update -apt-get -y install linux-headers-$(uname -r) build-essential -apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev -apt-get -y install curl unzip - -# Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant - -# Tweak sshd to prevent DNS resolution (speed up logins) -echo 'UseDNS no' >> /etc/ssh/sshd_config - -# Remove 5s grub timeout to speed up booting -cat < /etc/default/grub -# If you change this file, run 'update-grub' afterwards to update -# /boot/grub/grub.cfg. - -GRUB_DEFAULT=0 -GRUB_TIMEOUT=0 -GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="quiet" -GRUB_CMDLINE_LINUX="debian-installer=en_US" -EOF - -update-grub diff --git a/templates/Debian-7.5.0-i386-netboot/base.sh b/templates/Debian-7.5.0-i386-netboot/base.sh deleted file mode 100644 index a5489f5a..00000000 --- a/templates/Debian-7.5.0-i386-netboot/base.sh +++ /dev/null @@ -1,26 +0,0 @@ -# Update the box -apt-get -y update -apt-get -y install linux-headers-$(uname -r) build-essential -apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev -apt-get -y install curl unzip -apt-get clean - -# Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant - -# Tweak sshd to prevent DNS resolution (speed up logins) -echo 'UseDNS no' >> /etc/ssh/sshd_config - -# Remove 5s grub timeout to speed up booting -cat < /etc/default/grub -# If you change this file, run 'update-grub' afterwards to update -# /boot/grub/grub.cfg. - -GRUB_DEFAULT=0 -GRUB_TIMEOUT=0 -GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="quiet" -GRUB_CMDLINE_LINUX="debian-installer=en_US" -EOF - -update-grub diff --git a/templates/Debian-7.1.0-amd64-netboot/base.sh b/templates/Debian-7.6-amd64-netboot/base.sh similarity index 91% rename from templates/Debian-7.1.0-amd64-netboot/base.sh rename to templates/Debian-7.6-amd64-netboot/base.sh index 351daed9..e3642f1c 100644 --- a/templates/Debian-7.1.0-amd64-netboot/base.sh +++ b/templates/Debian-7.6-amd64-netboot/base.sh @@ -5,7 +5,7 @@ apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev apt-get -y install curl unzip # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.6.0-amd64-netboot/chef.sh b/templates/Debian-7.6-amd64-netboot/chef.sh similarity index 100% rename from templates/Debian-7.6.0-amd64-netboot/chef.sh rename to templates/Debian-7.6-amd64-netboot/chef.sh diff --git a/templates/Debian-7.6.0-amd64-netboot/cleanup.sh b/templates/Debian-7.6-amd64-netboot/cleanup.sh similarity index 100% rename from templates/Debian-7.6.0-amd64-netboot/cleanup.sh rename to templates/Debian-7.6-amd64-netboot/cleanup.sh diff --git a/templates/Debian-7.6.0-amd64-netboot/definition.rb b/templates/Debian-7.6-amd64-netboot/definition.rb similarity index 93% rename from templates/Debian-7.6.0-amd64-netboot/definition.rb rename to templates/Debian-7.6-amd64-netboot/definition.rb index 81907c2c..13935525 100644 --- a/templates/Debian-7.6.0-amd64-netboot/definition.rb +++ b/templates/Debian-7.6-amd64-netboot/definition.rb @@ -6,7 +6,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian_64', :iso_file => "debian-7.6.0-amd64-netinst.iso", - :iso_src => "http://cdimage.debian.org/debian-cd/7.6.0/amd64/iso-cd/debian-7.6.0-amd64-netinst.iso", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.6.0/amd64/iso-cd/debian-7.6.0-amd64-netinst.iso", :iso_md5 => "8a3c2ad7fd7a9c4c7e9bcb5cae38c135", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -27,7 +27,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-7.6.0-amd64-netboot/preseed.cfg b/templates/Debian-7.6-amd64-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.6.0-amd64-netboot/preseed.cfg rename to templates/Debian-7.6-amd64-netboot/preseed.cfg diff --git a/templates/Debian-7.6.0-amd64-netboot/puppet.sh b/templates/Debian-7.6-amd64-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.6.0-amd64-netboot/puppet.sh rename to templates/Debian-7.6-amd64-netboot/puppet.sh diff --git a/templates/Debian-7.6.0-amd64-netboot/ruby.sh b/templates/Debian-7.6-amd64-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.6.0-amd64-netboot/ruby.sh rename to templates/Debian-7.6-amd64-netboot/ruby.sh diff --git a/templates/Debian-7.5.0-amd64-netboot/vagrant.sh b/templates/Debian-7.6-amd64-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.5.0-amd64-netboot/vagrant.sh rename to templates/Debian-7.6-amd64-netboot/vagrant.sh diff --git a/templates/Debian-7.6.0-amd64-netboot/virtualbox.sh b/templates/Debian-7.6-amd64-netboot/virtualbox.sh similarity index 83% rename from templates/Debian-7.6.0-amd64-netboot/virtualbox.sh rename to templates/Debian-7.6-amd64-netboot/virtualbox.sh index 1ee4acf1..4dad6492 100644 --- a/templates/Debian-7.6.0-amd64-netboot/virtualbox.sh +++ b/templates/Debian-7.6-amd64-netboot/virtualbox.sh @@ -32,4 +32,6 @@ if test -f .vbox_version ; then rm $VBOX_ISO + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions fi diff --git a/templates/Debian-7.6.0-amd64-netboot/vmfusion.sh b/templates/Debian-7.6-amd64-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.6.0-amd64-netboot/vmfusion.sh rename to templates/Debian-7.6-amd64-netboot/vmfusion.sh diff --git a/templates/Debian-7.5.0-i386-netboot/zerodisk.sh b/templates/Debian-7.6-amd64-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.5.0-i386-netboot/zerodisk.sh rename to templates/Debian-7.6-amd64-netboot/zerodisk.sh diff --git a/templates/Debian-7.3.0-i386-netboot/base.sh b/templates/Debian-7.6-i386-netboot/base.sh similarity index 91% rename from templates/Debian-7.3.0-i386-netboot/base.sh rename to templates/Debian-7.6-i386-netboot/base.sh index a5489f5a..0dbd0803 100644 --- a/templates/Debian-7.3.0-i386-netboot/base.sh +++ b/templates/Debian-7.6-i386-netboot/base.sh @@ -6,7 +6,7 @@ apt-get -y install curl unzip apt-get clean # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.6-i386-netboot/chef.sh b/templates/Debian-7.6-i386-netboot/chef.sh new file mode 100644 index 00000000..76bfa5f3 --- /dev/null +++ b/templates/Debian-7.6-i386-netboot/chef.sh @@ -0,0 +1,2 @@ +# Install Chef +gem install chef --no-ri --no-rdoc diff --git a/templates/Debian-7.6-i386-netboot/cleanup.sh b/templates/Debian-7.6-i386-netboot/cleanup.sh new file mode 100644 index 00000000..bf8a6192 --- /dev/null +++ b/templates/Debian-7.6-i386-netboot/cleanup.sh @@ -0,0 +1,17 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-7.6.0-i386-netboot/definition.rb b/templates/Debian-7.6-i386-netboot/definition.rb similarity index 93% rename from templates/Debian-7.6.0-i386-netboot/definition.rb rename to templates/Debian-7.6-i386-netboot/definition.rb index 8e8047ce..7f9a7aaf 100644 --- a/templates/Debian-7.6.0-i386-netboot/definition.rb +++ b/templates/Debian-7.6-i386-netboot/definition.rb @@ -4,7 +4,7 @@ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-7.6.0-i386-netinst.iso", - :iso_src => "http://cdimage.debian.org/debian-cd/7.6.0/i386/iso-cd/debian-7.6.0-i386-netinst.iso", + :iso_src => "http://mirror.i3d.net/pub/debian-cd/7.6.0/i386/iso-cd/debian-7.6.0-i386-netinst.iso", :iso_md5 => "528e1a7315da1bbf50bd4d187880a519", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ @@ -25,7 +25,7 @@ ' ' ], :kickstart_port => "7122", - :kickstart_timeout => "10000", + :kickstart_timeout => "300", :kickstart_file => "preseed.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Debian-7.6.0-i386-netboot/preseed.cfg b/templates/Debian-7.6-i386-netboot/preseed.cfg similarity index 100% rename from templates/Debian-7.6.0-i386-netboot/preseed.cfg rename to templates/Debian-7.6-i386-netboot/preseed.cfg diff --git a/templates/Debian-7.6.0-i386-netboot/puppet.sh b/templates/Debian-7.6-i386-netboot/puppet.sh similarity index 100% rename from templates/Debian-7.6.0-i386-netboot/puppet.sh rename to templates/Debian-7.6-i386-netboot/puppet.sh diff --git a/templates/Debian-7.6.0-i386-netboot/ruby.sh b/templates/Debian-7.6-i386-netboot/ruby.sh similarity index 100% rename from templates/Debian-7.6.0-i386-netboot/ruby.sh rename to templates/Debian-7.6-i386-netboot/ruby.sh diff --git a/templates/Debian-7.5.0-i386-netboot/vagrant.sh b/templates/Debian-7.6-i386-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.5.0-i386-netboot/vagrant.sh rename to templates/Debian-7.6-i386-netboot/vagrant.sh diff --git a/templates/Debian-7.5.0-i386-netboot/virtualbox.sh b/templates/Debian-7.6-i386-netboot/virtualbox.sh similarity index 84% rename from templates/Debian-7.5.0-i386-netboot/virtualbox.sh rename to templates/Debian-7.6-i386-netboot/virtualbox.sh index 961d9d12..c8e37c20 100644 --- a/templates/Debian-7.5.0-i386-netboot/virtualbox.sh +++ b/templates/Debian-7.6-i386-netboot/virtualbox.sh @@ -33,4 +33,6 @@ if test -f .vbox_version ; then # Implement old cleanup-virtualbox.sh rm $VBOX_ISO + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions fi diff --git a/templates/Debian-7.6.0-i386-netboot/vmfusion.sh b/templates/Debian-7.6-i386-netboot/vmfusion.sh similarity index 100% rename from templates/Debian-7.6.0-i386-netboot/vmfusion.sh rename to templates/Debian-7.6-i386-netboot/vmfusion.sh diff --git a/templates/Debian-7.6.0-amd64-netboot/zerodisk.sh b/templates/Debian-7.6-i386-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.6.0-amd64-netboot/zerodisk.sh rename to templates/Debian-7.6-i386-netboot/zerodisk.sh diff --git a/templates/Debian-7.6.0-amd64-netboot/base.sh b/templates/Debian-7.6.0-amd64-netboot/base.sh deleted file mode 100644 index 351daed9..00000000 --- a/templates/Debian-7.6.0-amd64-netboot/base.sh +++ /dev/null @@ -1,25 +0,0 @@ -# Update the box -apt-get -y update -apt-get -y install linux-headers-$(uname -r) build-essential -apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev -apt-get -y install curl unzip - -# Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant - -# Tweak sshd to prevent DNS resolution (speed up logins) -echo 'UseDNS no' >> /etc/ssh/sshd_config - -# Remove 5s grub timeout to speed up booting -cat < /etc/default/grub -# If you change this file, run 'update-grub' afterwards to update -# /boot/grub/grub.cfg. - -GRUB_DEFAULT=0 -GRUB_TIMEOUT=0 -GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="quiet" -GRUB_CMDLINE_LINUX="debian-installer=en_US" -EOF - -update-grub diff --git a/templates/Debian-7.6.0-i386-netboot/base.sh b/templates/Debian-7.6.0-i386-netboot/base.sh deleted file mode 100644 index a5489f5a..00000000 --- a/templates/Debian-7.6.0-i386-netboot/base.sh +++ /dev/null @@ -1,26 +0,0 @@ -# Update the box -apt-get -y update -apt-get -y install linux-headers-$(uname -r) build-essential -apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev -apt-get -y install curl unzip -apt-get clean - -# Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant - -# Tweak sshd to prevent DNS resolution (speed up logins) -echo 'UseDNS no' >> /etc/ssh/sshd_config - -# Remove 5s grub timeout to speed up booting -cat < /etc/default/grub -# If you change this file, run 'update-grub' afterwards to update -# /boot/grub/grub.cfg. - -GRUB_DEFAULT=0 -GRUB_TIMEOUT=0 -GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="quiet" -GRUB_CMDLINE_LINUX="debian-installer=en_US" -EOF - -update-grub diff --git a/templates/Debian-7.2.0-amd64-netboot/base.sh b/templates/Debian-7.7-amd64-netboot/base.sh similarity index 91% rename from templates/Debian-7.2.0-amd64-netboot/base.sh rename to templates/Debian-7.7-amd64-netboot/base.sh index 351daed9..e3642f1c 100644 --- a/templates/Debian-7.2.0-amd64-netboot/base.sh +++ b/templates/Debian-7.7-amd64-netboot/base.sh @@ -5,7 +5,7 @@ apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev apt-get -y install curl unzip # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7.7-amd64-netboot/chef.sh b/templates/Debian-7.7-amd64-netboot/chef.sh new file mode 100644 index 00000000..cd119586 --- /dev/null +++ b/templates/Debian-7.7-amd64-netboot/chef.sh @@ -0,0 +1,49 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to Gem install +if [ -z "$CHEF_INSTALLMETHOD" ]; then + export CHEF_INSTALLMETHOD="gems" +fi + +# Installing chef +case $CHEF_INSTALLMETHOD in + "gems") + # Using gems + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + gem install chef --no-ri --no-rdoc + else + gem install chef --no-ri --no-rdoc --version $CHEF_VERSION + fi + ;; + + "omnibus") + # Using omnibus + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + wget -O - http://opscode.com/chef/install.sh | sudo bash -s + else + wget -O - http://opscode.com/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION + fi + ;; + + "package") + # Using packages + apt-get install -y debconf-utils + echo "chef chef/chef_server_url string $CHEF_SERVER_URL" | debconf-set-selections + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + apt-get install -y chef + else + apt-get install -y chef=$CHEF_VERSION + fi + ;; + + *) + echo "Unsupported method for installing chef" + exit -1 + ;; +esac diff --git a/templates/Debian-7.7-amd64-netboot/cleanup.sh b/templates/Debian-7.7-amd64-netboot/cleanup.sh new file mode 100644 index 00000000..f6953e16 --- /dev/null +++ b/templates/Debian-7.7-amd64-netboot/cleanup.sh @@ -0,0 +1,18 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove +apt-get -y clean + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-7.7-amd64-netboot/definition.rb b/templates/Debian-7.7-amd64-netboot/definition.rb new file mode 100644 index 00000000..f2a27671 --- /dev/null +++ b/templates/Debian-7.7-amd64-netboot/definition.rb @@ -0,0 +1,52 @@ +#Thanks to Fletcher Nichol - https://github.com/fnichol + +Veewee::Definition.declare({ + :cpu_count => '1', + :memory_size=> '256', + :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', + :os_type_id => 'Debian_64', + :iso_file => "debian-7.7.0-amd64-netinst.iso", + :iso_src => "http://cdimage.debian.org/cdimage/archive/7.7.0/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso", + :iso_md5 => "0b31bccccb048d20b551f70830bb7ad0", + :iso_download_timeout => "1000", + :boot_wait => "10", :boot_cmd_sequence => [ + ' ', + 'install ', + 'preseed/url=http://%IP%:%PORT%/preseed.cfg ', + 'debian-installer=en_US ', + 'auto ', + 'locale=en_US ', + 'kbd-chooser/method=us ', + 'netcfg/get_hostname=%NAME% ', + 'netcfg/get_domain=vagrantup.com ', + 'fb=false ', + 'debconf/frontend=noninteractive ', + 'console-setup/ask_detect=false ', + 'console-keymaps-at/keymap=us ', + 'keyboard-configuration/xkb-keymap=us ', + ' ' + ], + :kickstart_port => "7122", + :kickstart_timeout => "300", + :kickstart_file => "preseed.cfg", + :ssh_login_timeout => "10000", + :ssh_user => "vagrant", + :ssh_password => "vagrant", + :ssh_key => "", + :ssh_host_port => "7222", + :ssh_guest_port => "22", + :sudo_cmd => "echo '%p'|sudo -S bash '%f'", + :shutdown_cmd => "halt -p", + :postinstall_files => [ + "base.sh", + "vagrant.sh", + "virtualbox.sh", + #"vmfusion.sh", + "ruby.sh", + "puppet.sh", + "chef.sh", + "cleanup.sh", + "zerodisk.sh" + ], + :postinstall_timeout => "10000" +}) diff --git a/templates/Debian-7.7-amd64-netboot/preseed.cfg b/templates/Debian-7.7-amd64-netboot/preseed.cfg new file mode 100644 index 00000000..97d00769 --- /dev/null +++ b/templates/Debian-7.7-amd64-netboot/preseed.cfg @@ -0,0 +1,313 @@ +#### Contents of the preconfiguration file (for wheezy) +### Localization +# Locale sets language and country. +d-i debian-installer/locale string en_US.UTF-8 + +# Keyboard selection. +#d-i keymap select us +d-i keyboard-configuration/xkb-keymap select us + +### Network configuration +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_dhcp boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrant +d-i netcfg/get_domain string vagrantup.com + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.debian.net +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +# If the system has free space you can choose to only partition that space. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you can specify a disk to partition. The device name must +# be given in traditional non-devfs format. +# Note: A disk must be specified, unless the system has only one disk. +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: "regular", "lvm" and "crypto" +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true + +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + + +d-i partman/choose_partition select finish +d-i partman-auto-lvm/guided_size string max + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /usr, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic +d-i partman/default_filesystem string ext3 + +# Or provide a recipe of your own... +# The recipe format is documented in the file devel/partman-auto-recipe.txt. +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +#The preseed line that "selects finish" needs to be in a certain order in your preseed, the example-preseed does not follow this. +#http://ubuntuforums.org/archive/index.php/t-1504045.html + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +d-i partman/confirm_write_new_label boolean true +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + + +### Base system installation +# Select the initramfs generator used to generate the initrd for 2.6 kernels. +#d-i base-installer/kernel/linux/initramfs-generators string yaird + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-2.6-486 + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/root-password-crypted password [MD5 hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/user-password-crypted password [MD5 hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 +d-i user-setup/encrypt-home boolean false +d-i user-setup/allow-password-weak boolean true + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, volatile +#d-i apt-setup/security_host string security.debian.org +#d-i apt-setup/volatile_host string volatile.debian.org + + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated string true + +### Package selection +tasksel tasksel/first multiselect standard +# If the desktop task is selected, install the kde and xfce desktops +# instead of the default gnome desktop. +#tasksel tasksel/desktop multiselect kde, xfce + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync + +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,0) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages + +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. diff --git a/templates/Debian-7.7-amd64-netboot/puppet.sh b/templates/Debian-7.7-amd64-netboot/puppet.sh new file mode 100644 index 00000000..107b2361 --- /dev/null +++ b/templates/Debian-7.7-amd64-netboot/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb +dpkg -i puppetlabs-release-wheezy.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-7.7-amd64-netboot/ruby.sh b/templates/Debian-7.7-amd64-netboot/ruby.sh new file mode 100644 index 00000000..e44d60d2 --- /dev/null +++ b/templates/Debian-7.7-amd64-netboot/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libopenssl-ruby1.8 irb ri rdoc + +# Install Rubygems from source +rg_ver=1.8.22 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-7.6.0-amd64-netboot/vagrant.sh b/templates/Debian-7.7-amd64-netboot/vagrant.sh similarity index 100% rename from templates/Debian-7.6.0-amd64-netboot/vagrant.sh rename to templates/Debian-7.7-amd64-netboot/vagrant.sh diff --git a/templates/Debian-7.7-amd64-netboot/virtualbox.sh b/templates/Debian-7.7-amd64-netboot/virtualbox.sh new file mode 100644 index 00000000..4dad6492 --- /dev/null +++ b/templates/Debian-7.7-amd64-netboot/virtualbox.sh @@ -0,0 +1,37 @@ +if test -f .vbox_version ; then + # The netboot installs the VirtualBox support (old) so we have to remove it + if test -f /etc/init.d/virtualbox-ose-guest-utils ; then + /etc/init.d/virtualbox-ose-guest-utils stop + fi + + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + + # Install dkms for dynamic compiles + + apt-get install -y dkms + + # If libdbus is not installed, virtualbox will not autostart + apt-get -y install --no-install-recommends libdbus-1-3 + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat .vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt + + # Start the newly build driver + /etc/init.d/vboxadd start + + # Make a temporary mount point + mkdir /tmp/veewee-validation + + # Test mount the veewee-validation + mount -t vboxsf veewee-validation /tmp/veewee-validation + + rm $VBOX_ISO + + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions +fi diff --git a/templates/Debian-7.7-amd64-netboot/vmfusion.sh b/templates/Debian-7.7-amd64-netboot/vmfusion.sh new file mode 100644 index 00000000..3ced7e44 --- /dev/null +++ b/templates/Debian-7.7-amd64-netboot/vmfusion.sh @@ -0,0 +1,7 @@ +cd /tmp +mkdir -p /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom +tar zxvf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ +/tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso +umount /mnt/cdrom diff --git a/templates/Debian-7.6.0-i386-netboot/zerodisk.sh b/templates/Debian-7.7-amd64-netboot/zerodisk.sh similarity index 100% rename from templates/Debian-7.6.0-i386-netboot/zerodisk.sh rename to templates/Debian-7.7-amd64-netboot/zerodisk.sh diff --git a/templates/Debian-7/7.10.yml b/templates/Debian-7/7.10.yml new file mode 100644 index 00000000..5b11ee24 --- /dev/null +++ b/templates/Debian-7/7.10.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: Debian_64 +:iso_file: debian-7.10.0-amd64-netinst.iso +:iso_src: http://cdimage.debian.org/cdimage/archive/7.10.0/amd64/iso-cd/debian-7.10.0-amd64-netinst.iso +:iso_md5: 7b6e0ec52a8290b2746fe8707c20815c diff --git a/templates/Debian-7/7.9.yml b/templates/Debian-7/7.9.yml new file mode 100644 index 00000000..9160919e --- /dev/null +++ b/templates/Debian-7/7.9.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: Debian_64 +:iso_file: debian-7.9.0-amd64-netinst.iso +:iso_src: http://cdimage.debian.org/cdimage/archive/7.9.0/amd64/iso-cd/debian-7.9.0-amd64-netinst.iso +:iso_md5: 774d1fc8c5364e63b22242c33a89c1a3 diff --git a/templates/Debian-7.4.0-amd64-netboot/base.sh b/templates/Debian-7/base.sh similarity index 91% rename from templates/Debian-7.4.0-amd64-netboot/base.sh rename to templates/Debian-7/base.sh index 351daed9..e3642f1c 100644 --- a/templates/Debian-7.4.0-amd64-netboot/base.sh +++ b/templates/Debian-7/base.sh @@ -5,7 +5,7 @@ apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev apt-get -y install curl unzip # Set up sudo -echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config diff --git a/templates/Debian-7/chef.sh b/templates/Debian-7/chef.sh new file mode 100644 index 00000000..cd119586 --- /dev/null +++ b/templates/Debian-7/chef.sh @@ -0,0 +1,49 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to Gem install +if [ -z "$CHEF_INSTALLMETHOD" ]; then + export CHEF_INSTALLMETHOD="gems" +fi + +# Installing chef +case $CHEF_INSTALLMETHOD in + "gems") + # Using gems + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + gem install chef --no-ri --no-rdoc + else + gem install chef --no-ri --no-rdoc --version $CHEF_VERSION + fi + ;; + + "omnibus") + # Using omnibus + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + wget -O - http://opscode.com/chef/install.sh | sudo bash -s + else + wget -O - http://opscode.com/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION + fi + ;; + + "package") + # Using packages + apt-get install -y debconf-utils + echo "chef chef/chef_server_url string $CHEF_SERVER_URL" | debconf-set-selections + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + apt-get install -y chef + else + apt-get install -y chef=$CHEF_VERSION + fi + ;; + + *) + echo "Unsupported method for installing chef" + exit -1 + ;; +esac diff --git a/templates/Debian-7/cleanup.sh b/templates/Debian-7/cleanup.sh new file mode 100644 index 00000000..f6953e16 --- /dev/null +++ b/templates/Debian-7/cleanup.sh @@ -0,0 +1,18 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove +apt-get -y clean + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-7/definition.rb b/templates/Debian-7/definition.rb new file mode 100644 index 00000000..247719fe --- /dev/null +++ b/templates/Debian-7/definition.rb @@ -0,0 +1 @@ +Veewee::Definition.declare_yaml('definition.yml', "7.10.yml") diff --git a/templates/Debian-7/definition.yml b/templates/Debian-7/definition.yml new file mode 100644 index 00000000..bf00a531 --- /dev/null +++ b/templates/Debian-7/definition.yml @@ -0,0 +1,47 @@ +--- +# Thanks to Fletcher Nichol - https://github.com/fnichol +:cpu_count: '1' +:memory_size: '256' +:disk_size: '10140' +:disk_format: 'VDI' +:hostiocache: 'off' +:iso_download_timeout: '1000' +:boot_wait: '10' +:boot_cmd_sequence: + - ' ' + - 'install ' + - 'preseed/url=http://%IP%:%PORT%/preseed.cfg ' + - 'debian-installer=en_US ' + - 'auto ' + - 'locale=en_US ' + - 'kbd-chooser/method=us ' + - 'netcfg/get_hostname=%NAME% ' + - 'netcfg/get_domain=vagrantup.com ' + - 'fb=false ' + - 'debconf/frontend=noninteractive ' + - 'console-setup/ask_detect=false ' + - 'console-keymaps-at/keymap=us ' + - 'keyboard-configuration/xkb-keymap=us ' + - ' ' +:kickstart_port: '7122' +:kickstart_timeout: '300' +:kickstart_file: 'preseed.cfg' +:ssh_login_timeout: '10000' +:ssh_user: 'vagrant' +:ssh_password: 'vagrant' +:ssh_key: '' +:ssh_host_port: '7222' +:ssh_guest_port: '22' +:sudo_cmd: "echo '%p' | sudo -S bash '%f'" +:shutdown_cmd: 'halt -p' +:postinstall_files: + - 'base.sh' + - 'vagrant.sh' + - 'virtualbox.sh' + #- 'vmfusion.sh' + #- 'ruby.sh' + #- 'puppet.sh' + #- 'chef.sh' + - 'cleanup.sh' + - 'zerodisk.sh' +:postinstall_timeout: '10000' diff --git a/templates/Debian-7/preseed.cfg b/templates/Debian-7/preseed.cfg new file mode 100644 index 00000000..97d00769 --- /dev/null +++ b/templates/Debian-7/preseed.cfg @@ -0,0 +1,313 @@ +#### Contents of the preconfiguration file (for wheezy) +### Localization +# Locale sets language and country. +d-i debian-installer/locale string en_US.UTF-8 + +# Keyboard selection. +#d-i keymap select us +d-i keyboard-configuration/xkb-keymap select us + +### Network configuration +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_dhcp boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrant +d-i netcfg/get_domain string vagrantup.com + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.debian.net +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +# If the system has free space you can choose to only partition that space. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you can specify a disk to partition. The device name must +# be given in traditional non-devfs format. +# Note: A disk must be specified, unless the system has only one disk. +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: "regular", "lvm" and "crypto" +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true + +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + + +d-i partman/choose_partition select finish +d-i partman-auto-lvm/guided_size string max + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /usr, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic +d-i partman/default_filesystem string ext3 + +# Or provide a recipe of your own... +# The recipe format is documented in the file devel/partman-auto-recipe.txt. +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +#The preseed line that "selects finish" needs to be in a certain order in your preseed, the example-preseed does not follow this. +#http://ubuntuforums.org/archive/index.php/t-1504045.html + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +d-i partman/confirm_write_new_label boolean true +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + + +### Base system installation +# Select the initramfs generator used to generate the initrd for 2.6 kernels. +#d-i base-installer/kernel/linux/initramfs-generators string yaird + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-2.6-486 + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/root-password-crypted password [MD5 hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/user-password-crypted password [MD5 hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 +d-i user-setup/encrypt-home boolean false +d-i user-setup/allow-password-weak boolean true + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, volatile +#d-i apt-setup/security_host string security.debian.org +#d-i apt-setup/volatile_host string volatile.debian.org + + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated string true + +### Package selection +tasksel tasksel/first multiselect standard +# If the desktop task is selected, install the kde and xfce desktops +# instead of the default gnome desktop. +#tasksel tasksel/desktop multiselect kde, xfce + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync + +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,0) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages + +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. diff --git a/templates/Debian-7/puppet.sh b/templates/Debian-7/puppet.sh new file mode 100644 index 00000000..107b2361 --- /dev/null +++ b/templates/Debian-7/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb +dpkg -i puppetlabs-release-wheezy.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-7/ruby.sh b/templates/Debian-7/ruby.sh new file mode 100644 index 00000000..e44d60d2 --- /dev/null +++ b/templates/Debian-7/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libopenssl-ruby1.8 irb ri rdoc + +# Install Rubygems from source +rg_ver=1.8.22 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-7/vagrant.sh b/templates/Debian-7/vagrant.sh new file mode 100644 index 00000000..54c2a71e --- /dev/null +++ b/templates/Debian-7/vagrant.sh @@ -0,0 +1,21 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -Lo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common + + diff --git a/templates/Debian-7/virtualbox.sh b/templates/Debian-7/virtualbox.sh new file mode 100644 index 00000000..4dad6492 --- /dev/null +++ b/templates/Debian-7/virtualbox.sh @@ -0,0 +1,37 @@ +if test -f .vbox_version ; then + # The netboot installs the VirtualBox support (old) so we have to remove it + if test -f /etc/init.d/virtualbox-ose-guest-utils ; then + /etc/init.d/virtualbox-ose-guest-utils stop + fi + + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + + # Install dkms for dynamic compiles + + apt-get install -y dkms + + # If libdbus is not installed, virtualbox will not autostart + apt-get -y install --no-install-recommends libdbus-1-3 + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat .vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt + + # Start the newly build driver + /etc/init.d/vboxadd start + + # Make a temporary mount point + mkdir /tmp/veewee-validation + + # Test mount the veewee-validation + mount -t vboxsf veewee-validation /tmp/veewee-validation + + rm $VBOX_ISO + + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions +fi diff --git a/templates/Debian-7/vmfusion.sh b/templates/Debian-7/vmfusion.sh new file mode 100644 index 00000000..3ced7e44 --- /dev/null +++ b/templates/Debian-7/vmfusion.sh @@ -0,0 +1,7 @@ +cd /tmp +mkdir -p /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom +tar zxvf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ +/tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso +umount /mnt/cdrom diff --git a/templates/CentOS-5.10-i386/zerodisk.sh b/templates/Debian-7/zerodisk.sh old mode 100755 new mode 100644 similarity index 99% rename from templates/CentOS-5.10-i386/zerodisk.sh rename to templates/Debian-7/zerodisk.sh index ee72201f..938075a3 --- a/templates/CentOS-5.10-i386/zerodisk.sh +++ b/templates/Debian-7/zerodisk.sh @@ -1,4 +1,3 @@ # Zero out the free space to save space in the final image: - dd if=/dev/zero of=/EMPTY bs=1M rm -f /EMPTY diff --git a/templates/Debian-8.0/base.sh b/templates/Debian-8.0/base.sh new file mode 100644 index 00000000..e3642f1c --- /dev/null +++ b/templates/Debian-8.0/base.sh @@ -0,0 +1,25 @@ +# Update the box +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-8.0/chef.sh b/templates/Debian-8.0/chef.sh new file mode 100644 index 00000000..cd119586 --- /dev/null +++ b/templates/Debian-8.0/chef.sh @@ -0,0 +1,49 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to Gem install +if [ -z "$CHEF_INSTALLMETHOD" ]; then + export CHEF_INSTALLMETHOD="gems" +fi + +# Installing chef +case $CHEF_INSTALLMETHOD in + "gems") + # Using gems + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + gem install chef --no-ri --no-rdoc + else + gem install chef --no-ri --no-rdoc --version $CHEF_VERSION + fi + ;; + + "omnibus") + # Using omnibus + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + wget -O - http://opscode.com/chef/install.sh | sudo bash -s + else + wget -O - http://opscode.com/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION + fi + ;; + + "package") + # Using packages + apt-get install -y debconf-utils + echo "chef chef/chef_server_url string $CHEF_SERVER_URL" | debconf-set-selections + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + apt-get install -y chef + else + apt-get install -y chef=$CHEF_VERSION + fi + ;; + + *) + echo "Unsupported method for installing chef" + exit -1 + ;; +esac diff --git a/templates/Debian-8.0/cleanup.sh b/templates/Debian-8.0/cleanup.sh new file mode 100644 index 00000000..f6953e16 --- /dev/null +++ b/templates/Debian-8.0/cleanup.sh @@ -0,0 +1,18 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove +apt-get -y clean + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-8.0/debian_32_net.yml b/templates/Debian-8.0/debian_32_net.yml new file mode 100644 index 00000000..383b125b --- /dev/null +++ b/templates/Debian-8.0/debian_32_net.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: 'Debian' +:iso_file: "debian-8.0.0-i386-netinst.iso" +:iso_src: "http://cdimage.debian.org/debian-cd/8.0.0/i386/iso-cd/debian-8.0.0-i386-netinst.iso" +:iso_md5: "72045f21b78824023ad665c2ef387c26" diff --git a/templates/Debian-8.0/debian_64_net.yml b/templates/Debian-8.0/debian_64_net.yml new file mode 100644 index 00000000..6dbec5ce --- /dev/null +++ b/templates/Debian-8.0/debian_64_net.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: 'Debian_64' +:iso_file: "debian-8.0.0-amd64-netinst.iso" +:iso_src: "http://cdimage.debian.org/debian-cd/8.0.0/amd64/iso-cd/debian-8.0.0-amd64-netinst.iso" +:iso_md5: "d9209f355449fe13db3963571b1f52d4" diff --git a/templates/Debian-8.0/definition.rb b/templates/Debian-8.0/definition.rb new file mode 100644 index 00000000..7d172c2f --- /dev/null +++ b/templates/Debian-8.0/definition.rb @@ -0,0 +1,5 @@ +# +# change debian_64_netinst to one of configurations in *.yml in this directory +# use the yml files to configure +# +Veewee::Definition.declare_yaml('definition.yml', "debian_64_net.yml") diff --git a/templates/Debian-8.0/definition.yml b/templates/Debian-8.0/definition.yml new file mode 100644 index 00000000..ed15f6b2 --- /dev/null +++ b/templates/Debian-8.0/definition.yml @@ -0,0 +1,46 @@ +--- +:cpu_count: '1' +:memory_size: '256' +:disk_size: '10140' +:disk_format: 'VDI' +:hostiocache: 'off' +:iso_download_timeout: "1000" +:boot_wait: "10" +:boot_cmd_sequence: + - ' ' + - 'install ' + - 'preseed/url=http://%IP%:%PORT%/preseed.cfg ' + - 'debian-installer=en_US ' + - 'auto ' + - 'locale=en_US ' + - 'kbd-chooser/method=us ' + - 'netcfg/get_hostname=%NAME% ' + - 'netcfg/get_domain=vagrantup.com ' + - 'fb=false ' + - 'debconf/frontend=noninteractive ' + - 'console-setup/ask_detect=false ' + - 'console-keymaps-at/keymap=us ' + - 'keyboard-configuration/xkb-keymap=us ' + - ' ' +:kickstart_port: "7122" +:kickstart_timeout: "300" +:kickstart_file: "preseed.cfg" +:ssh_login_timeout: "10000" +:ssh_user: "vagrant" +:ssh_password: "vagrant" +:ssh_key: "" +:ssh_host_port: "7222" +:ssh_guest_port: "22" +:sudo_cmd: "echo '%p'|sudo -S bash '%f'" +:shutdown_cmd: "halt -p" +:postinstall_files: + - "base.sh" + - "vagrant.sh" + - "virtualbox.sh" + #- "vmfusion.sh" + - "ruby.sh" + - "puppet.sh" + - "chef.sh" + - "cleanup.sh" + - "zerodisk.sh" +:postinstall_timeout: "10000" diff --git a/templates/Debian-8.0/preseed.cfg b/templates/Debian-8.0/preseed.cfg new file mode 100644 index 00000000..3c013fc4 --- /dev/null +++ b/templates/Debian-8.0/preseed.cfg @@ -0,0 +1,429 @@ +#### Contents of the preconfiguration file (for jessie) +### Localization +# Preseeding only locale sets language, country and locale. +d-i debian-installer/locale string en_US.UTF-8 + +# The values can also be preseeded individually for greater flexibility. +#d-i debian-installer/language string en +#d-i debian-installer/country string NL +#d-i debian-installer/locale string en_GB.UTF-8 +# Optionally specify additional locales to be generated. +#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 + +# Keyboard selection. +d-i keyboard-configuration/xkb-keymap select us +# d-i keyboard-configuration/toggle select No toggling + +### Network configuration +# Disable network configuration entirely. This is useful for cdrom +# installations on non-networked devices where the network questions, +# warning and long timeouts are a nuisance. +#d-i netcfg/enable boolean false + +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# To set a different link detection timeout (default is 3 seconds). +# Values are interpreted as seconds. +#d-i netcfg/link_wait_timeout string 10 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 +#d-i netcfg/dhcpv6_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_autoconfig boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +# +# IPv4 example +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/confirm_static boolean true +# +# IPv6 example +#d-i netcfg/get_ipaddress string fc00::2 +#d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: +#d-i netcfg/get_gateway string fc00::1 +#d-i netcfg/get_nameservers string fc00::1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrant +d-i netcfg/get_domain string vagrantup.com + +# If you want to force a hostname, regardless of what either the DHCP +# server returns or what the reverse DNS entry for the IP is, uncomment +# and adjust the following line. +#d-i netcfg/hostname string somehost + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.debian.net +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +## Partitioning example +# If the system has free space you can choose to only partition that space. +# This is only honoured if partman-auto/method (below) is not set. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you may specify a disk to partition. If the system has only +# one disk the installer will default to using that, but otherwise the device +# name must be given in traditional, non-devfs format (so e.g. /dev/sda +# and not e.g. /dev/discs/disc0/disc). +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: +# - regular: use the usual partition types for your architecture +# - lvm: use LVM to partition the disk +# - crypto: use LVM within an encrypted partition +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + + +d-i partman/choose_partition select finish +d-i partman-auto-lvm/guided_size string max + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic + +# Or provide a recipe of your own... +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +# The full recipe format is documented in the file partman-auto-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. This also documents how to specify settings such as file +# system labels, volume group names and which physical devices to include +# in a volume group. + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +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 + +## Partitioning using RAID +# The method should be set to "raid". +#d-i partman-auto/method string raid +# Specify the disks to be partitioned. They will all get the same layout, +# so this will only work if the disks are the same size. +#d-i partman-auto/disk string /dev/sda /dev/sdb + +# Next you need to specify the physical partitions that will be used. +#d-i partman-auto/expert_recipe string \ +# multiraid :: \ +# 1000 5000 4000 raid \ +# $primary{ } method{ raid } \ +# . \ +# 64 512 300% raid \ +# method{ raid } \ +# . \ +# 500 10000 1000000000 raid \ +# method{ raid } \ +# . + +# Last you need to specify how the previously defined partitions will be +# used in the RAID setup. Remember to use the correct partition numbers +# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; +# devices are separated using "#". +# Parameters are: +# \ +# + +#d-i partman-auto-raid/recipe string \ +# 1 2 0 ext3 / \ +# /dev/sda1#/dev/sdb1 \ +# . \ +# 1 2 0 swap - \ +# /dev/sda5#/dev/sdb5 \ +# . \ +# 0 2 0 ext3 /home \ +# /dev/sda6#/dev/sdb6 \ +# . + +# For additional information see the file partman-auto-raid-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. + +# This makes partman automatically partition without confirmation. +d-i partman-md/confirm boolean true +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 + +## Controlling how partitions are mounted +# The default is to mount by UUID, but you can also choose "traditional" to +# use traditional device names, or "label" to try filesystem labels before +# falling back to UUIDs. +#d-i partman/mount_style select uuid + +### Base system installation +# Configure APT to not install recommended packages by default. Use of this +# option can result in an incomplete system and should only be used by very +# experienced users. +#d-i base-installer/install-recommends boolean false + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-586 + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/root-password-crypted password [MD5 hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/user-password-crypted password [MD5 hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/security_host string security.debian.org + +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/repository string \ +# http://local.server/debian stable main +#d-i apt-setup/local0/comment string local server +# Enable deb-src lines +#d-i apt-setup/local0/source boolean true +# URL to the public key of the local repository; you must provide a key or +# apt will complain about the unauthenticated repository and so the +# sources.list line will be left commented out +#d-i apt-setup/local0/key string http://local.server/key + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated boolean true + +### Package selection +tasksel tasksel/first multiselect standard + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Due notably to potential USB sticks, the location of the MBR can not be +# determined safely in general, so this needs to be specified: +#d-i grub-installer/bootdev string /dev/sda +# To install to the first device (assuming it is not a USB stick): +d-i grub-installer/bootdev string default + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,1) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +#d-i debian-installer/add-kernel-opts string nousb + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages +# This command is run immediately before the partitioner starts. It may be +# useful to apply dynamic partitioner preseeding that depends on the state +# of the disks (which may not be visible when preseed/early_command runs). +#d-i partman/early_command \ +# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh diff --git a/templates/Debian-8.0/puppet.sh b/templates/Debian-8.0/puppet.sh new file mode 100644 index 00000000..107b2361 --- /dev/null +++ b/templates/Debian-8.0/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb +dpkg -i puppetlabs-release-wheezy.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-8.0/ruby.sh b/templates/Debian-8.0/ruby.sh new file mode 100644 index 00000000..e44d60d2 --- /dev/null +++ b/templates/Debian-8.0/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libopenssl-ruby1.8 irb ri rdoc + +# Install Rubygems from source +rg_ver=1.8.22 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-8.0/vagrant.sh b/templates/Debian-8.0/vagrant.sh new file mode 100644 index 00000000..54c2a71e --- /dev/null +++ b/templates/Debian-8.0/vagrant.sh @@ -0,0 +1,21 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -Lo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common + + diff --git a/templates/Debian-8.0/virtualbox.sh b/templates/Debian-8.0/virtualbox.sh new file mode 100644 index 00000000..4dad6492 --- /dev/null +++ b/templates/Debian-8.0/virtualbox.sh @@ -0,0 +1,37 @@ +if test -f .vbox_version ; then + # The netboot installs the VirtualBox support (old) so we have to remove it + if test -f /etc/init.d/virtualbox-ose-guest-utils ; then + /etc/init.d/virtualbox-ose-guest-utils stop + fi + + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + + # Install dkms for dynamic compiles + + apt-get install -y dkms + + # If libdbus is not installed, virtualbox will not autostart + apt-get -y install --no-install-recommends libdbus-1-3 + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat .vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt + + # Start the newly build driver + /etc/init.d/vboxadd start + + # Make a temporary mount point + mkdir /tmp/veewee-validation + + # Test mount the veewee-validation + mount -t vboxsf veewee-validation /tmp/veewee-validation + + rm $VBOX_ISO + + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions +fi diff --git a/templates/Debian-8.0/vmfusion.sh b/templates/Debian-8.0/vmfusion.sh new file mode 100644 index 00000000..3ced7e44 --- /dev/null +++ b/templates/Debian-8.0/vmfusion.sh @@ -0,0 +1,7 @@ +cd /tmp +mkdir -p /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom +tar zxvf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ +/tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso +umount /mnt/cdrom diff --git a/templates/CentOS-5.10-x86_64-netboot/zerodisk.sh b/templates/Debian-8.0/zerodisk.sh old mode 100755 new mode 100644 similarity index 99% rename from templates/CentOS-5.10-x86_64-netboot/zerodisk.sh rename to templates/Debian-8.0/zerodisk.sh index ee72201f..938075a3 --- a/templates/CentOS-5.10-x86_64-netboot/zerodisk.sh +++ b/templates/Debian-8.0/zerodisk.sh @@ -1,4 +1,3 @@ # Zero out the free space to save space in the final image: - dd if=/dev/zero of=/EMPTY bs=1M rm -f /EMPTY diff --git a/templates/Debian-8.1-amd64-netboot/base.sh b/templates/Debian-8.1-amd64-netboot/base.sh new file mode 100644 index 00000000..e3642f1c --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/base.sh @@ -0,0 +1,25 @@ +# Update the box +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-8.1-amd64-netboot/chef.sh b/templates/Debian-8.1-amd64-netboot/chef.sh new file mode 100644 index 00000000..cd119586 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/chef.sh @@ -0,0 +1,49 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to Gem install +if [ -z "$CHEF_INSTALLMETHOD" ]; then + export CHEF_INSTALLMETHOD="gems" +fi + +# Installing chef +case $CHEF_INSTALLMETHOD in + "gems") + # Using gems + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + gem install chef --no-ri --no-rdoc + else + gem install chef --no-ri --no-rdoc --version $CHEF_VERSION + fi + ;; + + "omnibus") + # Using omnibus + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + wget -O - http://opscode.com/chef/install.sh | sudo bash -s + else + wget -O - http://opscode.com/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION + fi + ;; + + "package") + # Using packages + apt-get install -y debconf-utils + echo "chef chef/chef_server_url string $CHEF_SERVER_URL" | debconf-set-selections + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + apt-get install -y chef + else + apt-get install -y chef=$CHEF_VERSION + fi + ;; + + *) + echo "Unsupported method for installing chef" + exit -1 + ;; +esac diff --git a/templates/Debian-8.1-amd64-netboot/cleanup.sh b/templates/Debian-8.1-amd64-netboot/cleanup.sh new file mode 100644 index 00000000..f6953e16 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/cleanup.sh @@ -0,0 +1,18 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove +apt-get -y clean + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-8.1-amd64-netboot/debian_64_net.yml b/templates/Debian-8.1-amd64-netboot/debian_64_net.yml new file mode 100644 index 00000000..6d0550f9 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/debian_64_net.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: 'Debian_64' +:iso_file: "debian-8.1.0-amd64-netinst.iso" +:iso_src: "http://cdimage.debian.org/debian-cd/8.1.0/amd64/iso-cd/debian-8.1.0-amd64-netinst.iso" +:iso_md5: "1a311f9afb68d6365211b13b4342c40b" diff --git a/templates/Debian-8.1-amd64-netboot/definition.rb b/templates/Debian-8.1-amd64-netboot/definition.rb new file mode 100644 index 00000000..7d172c2f --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/definition.rb @@ -0,0 +1,5 @@ +# +# change debian_64_netinst to one of configurations in *.yml in this directory +# use the yml files to configure +# +Veewee::Definition.declare_yaml('definition.yml', "debian_64_net.yml") diff --git a/templates/Debian-8.1-amd64-netboot/definition.yml b/templates/Debian-8.1-amd64-netboot/definition.yml new file mode 100644 index 00000000..ed15f6b2 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/definition.yml @@ -0,0 +1,46 @@ +--- +:cpu_count: '1' +:memory_size: '256' +:disk_size: '10140' +:disk_format: 'VDI' +:hostiocache: 'off' +:iso_download_timeout: "1000" +:boot_wait: "10" +:boot_cmd_sequence: + - ' ' + - 'install ' + - 'preseed/url=http://%IP%:%PORT%/preseed.cfg ' + - 'debian-installer=en_US ' + - 'auto ' + - 'locale=en_US ' + - 'kbd-chooser/method=us ' + - 'netcfg/get_hostname=%NAME% ' + - 'netcfg/get_domain=vagrantup.com ' + - 'fb=false ' + - 'debconf/frontend=noninteractive ' + - 'console-setup/ask_detect=false ' + - 'console-keymaps-at/keymap=us ' + - 'keyboard-configuration/xkb-keymap=us ' + - ' ' +:kickstart_port: "7122" +:kickstart_timeout: "300" +:kickstart_file: "preseed.cfg" +:ssh_login_timeout: "10000" +:ssh_user: "vagrant" +:ssh_password: "vagrant" +:ssh_key: "" +:ssh_host_port: "7222" +:ssh_guest_port: "22" +:sudo_cmd: "echo '%p'|sudo -S bash '%f'" +:shutdown_cmd: "halt -p" +:postinstall_files: + - "base.sh" + - "vagrant.sh" + - "virtualbox.sh" + #- "vmfusion.sh" + - "ruby.sh" + - "puppet.sh" + - "chef.sh" + - "cleanup.sh" + - "zerodisk.sh" +:postinstall_timeout: "10000" diff --git a/templates/Debian-8.1-amd64-netboot/preseed.cfg b/templates/Debian-8.1-amd64-netboot/preseed.cfg new file mode 100644 index 00000000..3c013fc4 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/preseed.cfg @@ -0,0 +1,429 @@ +#### Contents of the preconfiguration file (for jessie) +### Localization +# Preseeding only locale sets language, country and locale. +d-i debian-installer/locale string en_US.UTF-8 + +# The values can also be preseeded individually for greater flexibility. +#d-i debian-installer/language string en +#d-i debian-installer/country string NL +#d-i debian-installer/locale string en_GB.UTF-8 +# Optionally specify additional locales to be generated. +#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 + +# Keyboard selection. +d-i keyboard-configuration/xkb-keymap select us +# d-i keyboard-configuration/toggle select No toggling + +### Network configuration +# Disable network configuration entirely. This is useful for cdrom +# installations on non-networked devices where the network questions, +# warning and long timeouts are a nuisance. +#d-i netcfg/enable boolean false + +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# To set a different link detection timeout (default is 3 seconds). +# Values are interpreted as seconds. +#d-i netcfg/link_wait_timeout string 10 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 +#d-i netcfg/dhcpv6_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_autoconfig boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +# +# IPv4 example +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/confirm_static boolean true +# +# IPv6 example +#d-i netcfg/get_ipaddress string fc00::2 +#d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: +#d-i netcfg/get_gateway string fc00::1 +#d-i netcfg/get_nameservers string fc00::1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrant +d-i netcfg/get_domain string vagrantup.com + +# If you want to force a hostname, regardless of what either the DHCP +# server returns or what the reverse DNS entry for the IP is, uncomment +# and adjust the following line. +#d-i netcfg/hostname string somehost + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.debian.net +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +## Partitioning example +# If the system has free space you can choose to only partition that space. +# This is only honoured if partman-auto/method (below) is not set. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you may specify a disk to partition. If the system has only +# one disk the installer will default to using that, but otherwise the device +# name must be given in traditional, non-devfs format (so e.g. /dev/sda +# and not e.g. /dev/discs/disc0/disc). +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: +# - regular: use the usual partition types for your architecture +# - lvm: use LVM to partition the disk +# - crypto: use LVM within an encrypted partition +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + + +d-i partman/choose_partition select finish +d-i partman-auto-lvm/guided_size string max + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic + +# Or provide a recipe of your own... +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +# The full recipe format is documented in the file partman-auto-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. This also documents how to specify settings such as file +# system labels, volume group names and which physical devices to include +# in a volume group. + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +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 + +## Partitioning using RAID +# The method should be set to "raid". +#d-i partman-auto/method string raid +# Specify the disks to be partitioned. They will all get the same layout, +# so this will only work if the disks are the same size. +#d-i partman-auto/disk string /dev/sda /dev/sdb + +# Next you need to specify the physical partitions that will be used. +#d-i partman-auto/expert_recipe string \ +# multiraid :: \ +# 1000 5000 4000 raid \ +# $primary{ } method{ raid } \ +# . \ +# 64 512 300% raid \ +# method{ raid } \ +# . \ +# 500 10000 1000000000 raid \ +# method{ raid } \ +# . + +# Last you need to specify how the previously defined partitions will be +# used in the RAID setup. Remember to use the correct partition numbers +# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; +# devices are separated using "#". +# Parameters are: +# \ +# + +#d-i partman-auto-raid/recipe string \ +# 1 2 0 ext3 / \ +# /dev/sda1#/dev/sdb1 \ +# . \ +# 1 2 0 swap - \ +# /dev/sda5#/dev/sdb5 \ +# . \ +# 0 2 0 ext3 /home \ +# /dev/sda6#/dev/sdb6 \ +# . + +# For additional information see the file partman-auto-raid-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. + +# This makes partman automatically partition without confirmation. +d-i partman-md/confirm boolean true +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 + +## Controlling how partitions are mounted +# The default is to mount by UUID, but you can also choose "traditional" to +# use traditional device names, or "label" to try filesystem labels before +# falling back to UUIDs. +#d-i partman/mount_style select uuid + +### Base system installation +# Configure APT to not install recommended packages by default. Use of this +# option can result in an incomplete system and should only be used by very +# experienced users. +#d-i base-installer/install-recommends boolean false + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-586 + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/root-password-crypted password [MD5 hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/user-password-crypted password [MD5 hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/security_host string security.debian.org + +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/repository string \ +# http://local.server/debian stable main +#d-i apt-setup/local0/comment string local server +# Enable deb-src lines +#d-i apt-setup/local0/source boolean true +# URL to the public key of the local repository; you must provide a key or +# apt will complain about the unauthenticated repository and so the +# sources.list line will be left commented out +#d-i apt-setup/local0/key string http://local.server/key + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated boolean true + +### Package selection +tasksel tasksel/first multiselect standard + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Due notably to potential USB sticks, the location of the MBR can not be +# determined safely in general, so this needs to be specified: +#d-i grub-installer/bootdev string /dev/sda +# To install to the first device (assuming it is not a USB stick): +d-i grub-installer/bootdev string default + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,1) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +#d-i debian-installer/add-kernel-opts string nousb + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages +# This command is run immediately before the partitioner starts. It may be +# useful to apply dynamic partitioner preseeding that depends on the state +# of the disks (which may not be visible when preseed/early_command runs). +#d-i partman/early_command \ +# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh diff --git a/templates/Debian-8.1-amd64-netboot/puppet.sh b/templates/Debian-8.1-amd64-netboot/puppet.sh new file mode 100644 index 00000000..107b2361 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb +dpkg -i puppetlabs-release-wheezy.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-8.1-amd64-netboot/ruby.sh b/templates/Debian-8.1-amd64-netboot/ruby.sh new file mode 100644 index 00000000..e44d60d2 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libopenssl-ruby1.8 irb ri rdoc + +# Install Rubygems from source +rg_ver=1.8.22 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-8.1-amd64-netboot/vagrant.sh b/templates/Debian-8.1-amd64-netboot/vagrant.sh new file mode 100644 index 00000000..54c2a71e --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/vagrant.sh @@ -0,0 +1,21 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -Lo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common + + diff --git a/templates/Debian-8.1-amd64-netboot/virtualbox.sh b/templates/Debian-8.1-amd64-netboot/virtualbox.sh new file mode 100644 index 00000000..4dad6492 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/virtualbox.sh @@ -0,0 +1,37 @@ +if test -f .vbox_version ; then + # The netboot installs the VirtualBox support (old) so we have to remove it + if test -f /etc/init.d/virtualbox-ose-guest-utils ; then + /etc/init.d/virtualbox-ose-guest-utils stop + fi + + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + + # Install dkms for dynamic compiles + + apt-get install -y dkms + + # If libdbus is not installed, virtualbox will not autostart + apt-get -y install --no-install-recommends libdbus-1-3 + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat .vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt + + # Start the newly build driver + /etc/init.d/vboxadd start + + # Make a temporary mount point + mkdir /tmp/veewee-validation + + # Test mount the veewee-validation + mount -t vboxsf veewee-validation /tmp/veewee-validation + + rm $VBOX_ISO + + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions +fi diff --git a/templates/Debian-8.1-amd64-netboot/vmfusion.sh b/templates/Debian-8.1-amd64-netboot/vmfusion.sh new file mode 100644 index 00000000..3ced7e44 --- /dev/null +++ b/templates/Debian-8.1-amd64-netboot/vmfusion.sh @@ -0,0 +1,7 @@ +cd /tmp +mkdir -p /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom +tar zxvf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ +/tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso +umount /mnt/cdrom diff --git a/templates/CentOS-5.10-x86_64/zerodisk.sh b/templates/Debian-8.1-amd64-netboot/zerodisk.sh old mode 100755 new mode 100644 similarity index 99% rename from templates/CentOS-5.10-x86_64/zerodisk.sh rename to templates/Debian-8.1-amd64-netboot/zerodisk.sh index ee72201f..938075a3 --- a/templates/CentOS-5.10-x86_64/zerodisk.sh +++ b/templates/Debian-8.1-amd64-netboot/zerodisk.sh @@ -1,4 +1,3 @@ # Zero out the free space to save space in the final image: - dd if=/dev/zero of=/EMPTY bs=1M rm -f /EMPTY diff --git a/templates/Debian-8.2-amd64-netboot/base.sh b/templates/Debian-8.2-amd64-netboot/base.sh new file mode 100644 index 00000000..e3642f1c --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/base.sh @@ -0,0 +1,25 @@ +# Update the box +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-8.2-amd64-netboot/chef.sh b/templates/Debian-8.2-amd64-netboot/chef.sh new file mode 100644 index 00000000..cd119586 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/chef.sh @@ -0,0 +1,49 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to Gem install +if [ -z "$CHEF_INSTALLMETHOD" ]; then + export CHEF_INSTALLMETHOD="gems" +fi + +# Installing chef +case $CHEF_INSTALLMETHOD in + "gems") + # Using gems + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + gem install chef --no-ri --no-rdoc + else + gem install chef --no-ri --no-rdoc --version $CHEF_VERSION + fi + ;; + + "omnibus") + # Using omnibus + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + wget -O - http://opscode.com/chef/install.sh | sudo bash -s + else + wget -O - http://opscode.com/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION + fi + ;; + + "package") + # Using packages + apt-get install -y debconf-utils + echo "chef chef/chef_server_url string $CHEF_SERVER_URL" | debconf-set-selections + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + apt-get install -y chef + else + apt-get install -y chef=$CHEF_VERSION + fi + ;; + + *) + echo "Unsupported method for installing chef" + exit -1 + ;; +esac diff --git a/templates/Debian-8.2-amd64-netboot/cleanup.sh b/templates/Debian-8.2-amd64-netboot/cleanup.sh new file mode 100644 index 00000000..f6953e16 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/cleanup.sh @@ -0,0 +1,18 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove +apt-get -y clean + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-8.2-amd64-netboot/debian_64_net.yml b/templates/Debian-8.2-amd64-netboot/debian_64_net.yml new file mode 100644 index 00000000..df22b11e --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/debian_64_net.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: 'Debian_64' +:iso_file: "debian-8.2.0-amd64-netinst.iso" +:iso_src: "http://cdimage.debian.org/debian-cd/8.2.0/amd64/iso-cd/debian-8.2.0-amd64-netinst.iso" +:iso_md5: "762eb3dfc22f85faf659001ebf270b4f" diff --git a/templates/Debian-8.2-amd64-netboot/definition.rb b/templates/Debian-8.2-amd64-netboot/definition.rb new file mode 100644 index 00000000..7d172c2f --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/definition.rb @@ -0,0 +1,5 @@ +# +# change debian_64_netinst to one of configurations in *.yml in this directory +# use the yml files to configure +# +Veewee::Definition.declare_yaml('definition.yml', "debian_64_net.yml") diff --git a/templates/Debian-8.2-amd64-netboot/definition.yml b/templates/Debian-8.2-amd64-netboot/definition.yml new file mode 100644 index 00000000..ed15f6b2 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/definition.yml @@ -0,0 +1,46 @@ +--- +:cpu_count: '1' +:memory_size: '256' +:disk_size: '10140' +:disk_format: 'VDI' +:hostiocache: 'off' +:iso_download_timeout: "1000" +:boot_wait: "10" +:boot_cmd_sequence: + - ' ' + - 'install ' + - 'preseed/url=http://%IP%:%PORT%/preseed.cfg ' + - 'debian-installer=en_US ' + - 'auto ' + - 'locale=en_US ' + - 'kbd-chooser/method=us ' + - 'netcfg/get_hostname=%NAME% ' + - 'netcfg/get_domain=vagrantup.com ' + - 'fb=false ' + - 'debconf/frontend=noninteractive ' + - 'console-setup/ask_detect=false ' + - 'console-keymaps-at/keymap=us ' + - 'keyboard-configuration/xkb-keymap=us ' + - ' ' +:kickstart_port: "7122" +:kickstart_timeout: "300" +:kickstart_file: "preseed.cfg" +:ssh_login_timeout: "10000" +:ssh_user: "vagrant" +:ssh_password: "vagrant" +:ssh_key: "" +:ssh_host_port: "7222" +:ssh_guest_port: "22" +:sudo_cmd: "echo '%p'|sudo -S bash '%f'" +:shutdown_cmd: "halt -p" +:postinstall_files: + - "base.sh" + - "vagrant.sh" + - "virtualbox.sh" + #- "vmfusion.sh" + - "ruby.sh" + - "puppet.sh" + - "chef.sh" + - "cleanup.sh" + - "zerodisk.sh" +:postinstall_timeout: "10000" diff --git a/templates/Debian-8.2-amd64-netboot/preseed.cfg b/templates/Debian-8.2-amd64-netboot/preseed.cfg new file mode 100644 index 00000000..3c013fc4 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/preseed.cfg @@ -0,0 +1,429 @@ +#### Contents of the preconfiguration file (for jessie) +### Localization +# Preseeding only locale sets language, country and locale. +d-i debian-installer/locale string en_US.UTF-8 + +# The values can also be preseeded individually for greater flexibility. +#d-i debian-installer/language string en +#d-i debian-installer/country string NL +#d-i debian-installer/locale string en_GB.UTF-8 +# Optionally specify additional locales to be generated. +#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 + +# Keyboard selection. +d-i keyboard-configuration/xkb-keymap select us +# d-i keyboard-configuration/toggle select No toggling + +### Network configuration +# Disable network configuration entirely. This is useful for cdrom +# installations on non-networked devices where the network questions, +# warning and long timeouts are a nuisance. +#d-i netcfg/enable boolean false + +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# To set a different link detection timeout (default is 3 seconds). +# Values are interpreted as seconds. +#d-i netcfg/link_wait_timeout string 10 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 +#d-i netcfg/dhcpv6_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_autoconfig boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +# +# IPv4 example +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/confirm_static boolean true +# +# IPv6 example +#d-i netcfg/get_ipaddress string fc00::2 +#d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: +#d-i netcfg/get_gateway string fc00::1 +#d-i netcfg/get_nameservers string fc00::1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrant +d-i netcfg/get_domain string vagrantup.com + +# If you want to force a hostname, regardless of what either the DHCP +# server returns or what the reverse DNS entry for the IP is, uncomment +# and adjust the following line. +#d-i netcfg/hostname string somehost + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.debian.net +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +## Partitioning example +# If the system has free space you can choose to only partition that space. +# This is only honoured if partman-auto/method (below) is not set. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you may specify a disk to partition. If the system has only +# one disk the installer will default to using that, but otherwise the device +# name must be given in traditional, non-devfs format (so e.g. /dev/sda +# and not e.g. /dev/discs/disc0/disc). +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: +# - regular: use the usual partition types for your architecture +# - lvm: use LVM to partition the disk +# - crypto: use LVM within an encrypted partition +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + + +d-i partman/choose_partition select finish +d-i partman-auto-lvm/guided_size string max + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic + +# Or provide a recipe of your own... +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +# The full recipe format is documented in the file partman-auto-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. This also documents how to specify settings such as file +# system labels, volume group names and which physical devices to include +# in a volume group. + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +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 + +## Partitioning using RAID +# The method should be set to "raid". +#d-i partman-auto/method string raid +# Specify the disks to be partitioned. They will all get the same layout, +# so this will only work if the disks are the same size. +#d-i partman-auto/disk string /dev/sda /dev/sdb + +# Next you need to specify the physical partitions that will be used. +#d-i partman-auto/expert_recipe string \ +# multiraid :: \ +# 1000 5000 4000 raid \ +# $primary{ } method{ raid } \ +# . \ +# 64 512 300% raid \ +# method{ raid } \ +# . \ +# 500 10000 1000000000 raid \ +# method{ raid } \ +# . + +# Last you need to specify how the previously defined partitions will be +# used in the RAID setup. Remember to use the correct partition numbers +# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; +# devices are separated using "#". +# Parameters are: +# \ +# + +#d-i partman-auto-raid/recipe string \ +# 1 2 0 ext3 / \ +# /dev/sda1#/dev/sdb1 \ +# . \ +# 1 2 0 swap - \ +# /dev/sda5#/dev/sdb5 \ +# . \ +# 0 2 0 ext3 /home \ +# /dev/sda6#/dev/sdb6 \ +# . + +# For additional information see the file partman-auto-raid-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. + +# This makes partman automatically partition without confirmation. +d-i partman-md/confirm boolean true +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 + +## Controlling how partitions are mounted +# The default is to mount by UUID, but you can also choose "traditional" to +# use traditional device names, or "label" to try filesystem labels before +# falling back to UUIDs. +#d-i partman/mount_style select uuid + +### Base system installation +# Configure APT to not install recommended packages by default. Use of this +# option can result in an incomplete system and should only be used by very +# experienced users. +#d-i base-installer/install-recommends boolean false + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-586 + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/root-password-crypted password [MD5 hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/user-password-crypted password [MD5 hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/security_host string security.debian.org + +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/repository string \ +# http://local.server/debian stable main +#d-i apt-setup/local0/comment string local server +# Enable deb-src lines +#d-i apt-setup/local0/source boolean true +# URL to the public key of the local repository; you must provide a key or +# apt will complain about the unauthenticated repository and so the +# sources.list line will be left commented out +#d-i apt-setup/local0/key string http://local.server/key + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated boolean true + +### Package selection +tasksel tasksel/first multiselect standard + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Due notably to potential USB sticks, the location of the MBR can not be +# determined safely in general, so this needs to be specified: +#d-i grub-installer/bootdev string /dev/sda +# To install to the first device (assuming it is not a USB stick): +d-i grub-installer/bootdev string default + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,1) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +#d-i debian-installer/add-kernel-opts string nousb + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages +# This command is run immediately before the partitioner starts. It may be +# useful to apply dynamic partitioner preseeding that depends on the state +# of the disks (which may not be visible when preseed/early_command runs). +#d-i partman/early_command \ +# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh diff --git a/templates/Debian-8.2-amd64-netboot/puppet.sh b/templates/Debian-8.2-amd64-netboot/puppet.sh new file mode 100644 index 00000000..107b2361 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb +dpkg -i puppetlabs-release-wheezy.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-8.2-amd64-netboot/ruby.sh b/templates/Debian-8.2-amd64-netboot/ruby.sh new file mode 100644 index 00000000..e44d60d2 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libopenssl-ruby1.8 irb ri rdoc + +# Install Rubygems from source +rg_ver=1.8.22 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-8.2-amd64-netboot/vagrant.sh b/templates/Debian-8.2-amd64-netboot/vagrant.sh new file mode 100644 index 00000000..54c2a71e --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/vagrant.sh @@ -0,0 +1,21 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -Lo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common + + diff --git a/templates/Debian-8.2-amd64-netboot/virtualbox.sh b/templates/Debian-8.2-amd64-netboot/virtualbox.sh new file mode 100644 index 00000000..4dad6492 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/virtualbox.sh @@ -0,0 +1,37 @@ +if test -f .vbox_version ; then + # The netboot installs the VirtualBox support (old) so we have to remove it + if test -f /etc/init.d/virtualbox-ose-guest-utils ; then + /etc/init.d/virtualbox-ose-guest-utils stop + fi + + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + + # Install dkms for dynamic compiles + + apt-get install -y dkms + + # If libdbus is not installed, virtualbox will not autostart + apt-get -y install --no-install-recommends libdbus-1-3 + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat .vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt + + # Start the newly build driver + /etc/init.d/vboxadd start + + # Make a temporary mount point + mkdir /tmp/veewee-validation + + # Test mount the veewee-validation + mount -t vboxsf veewee-validation /tmp/veewee-validation + + rm $VBOX_ISO + + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions +fi diff --git a/templates/Debian-8.2-amd64-netboot/vmfusion.sh b/templates/Debian-8.2-amd64-netboot/vmfusion.sh new file mode 100644 index 00000000..3ced7e44 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/vmfusion.sh @@ -0,0 +1,7 @@ +cd /tmp +mkdir -p /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom +tar zxvf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ +/tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso +umount /mnt/cdrom diff --git a/templates/Debian-8.2-amd64-netboot/zerodisk.sh b/templates/Debian-8.2-amd64-netboot/zerodisk.sh new file mode 100644 index 00000000..938075a3 --- /dev/null +++ b/templates/Debian-8.2-amd64-netboot/zerodisk.sh @@ -0,0 +1,3 @@ +# Zero out the free space to save space in the final image: +dd if=/dev/zero of=/EMPTY bs=1M +rm -f /EMPTY diff --git a/templates/Debian-8/8.3.yml b/templates/Debian-8/8.3.yml new file mode 100644 index 00000000..57009323 --- /dev/null +++ b/templates/Debian-8/8.3.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: Debian_64 +:iso_file: debian-8.3.0-amd64-netinst.iso +:iso_src: http://cdimage.debian.org/cdimage/archive/8.3.0/amd64/iso-cd/debian-8.3.0-amd64-netinst.iso +:iso_md5: a9b490b4215d1e72e876b031dafa7184 diff --git a/templates/Debian-8/8.4.yml b/templates/Debian-8/8.4.yml new file mode 100644 index 00000000..98b2ccdc --- /dev/null +++ b/templates/Debian-8/8.4.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: Debian_64 +:iso_file: debian-8.4.0-amd64-netinst.iso +:iso_src: http://cdimage.debian.org/debian-cd/8.4.0/amd64/iso-cd/debian-8.4.0-amd64-netinst.iso +:iso_md5: 8d52d1b7789cd5a464aae719f05299ec diff --git a/templates/Debian-8/8.5.yml b/templates/Debian-8/8.5.yml new file mode 100644 index 00000000..236551df --- /dev/null +++ b/templates/Debian-8/8.5.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: Debian_64 +:iso_file: debian-8.5.0-amd64-netinst.iso +:iso_src: http://cdimage.debian.org/debian-cd/8.5.0/amd64/iso-cd/debian-8.5.0-amd64-netinst.iso +:iso_md5: 3e1b9029a0cf188730646c379d15073f diff --git a/templates/Debian-8/8.6.yml b/templates/Debian-8/8.6.yml new file mode 100644 index 00000000..4832e6ef --- /dev/null +++ b/templates/Debian-8/8.6.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: Debian_64 +:iso_file: debian-8.6.0-amd64-netinst.iso +:iso_src: http://cdimage.debian.org/debian-cd/8.6.0/amd64/iso-cd/debian-8.6.0-amd64-netinst.iso +:iso_md5: e9f61bf327db6d8f7cee05a99f2353cc diff --git a/templates/Debian-8/base.sh b/templates/Debian-8/base.sh new file mode 100644 index 00000000..e3642f1c --- /dev/null +++ b/templates/Debian-8/base.sh @@ -0,0 +1,25 @@ +# Update the box +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-8/chef.sh b/templates/Debian-8/chef.sh new file mode 100644 index 00000000..cd119586 --- /dev/null +++ b/templates/Debian-8/chef.sh @@ -0,0 +1,49 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to Gem install +if [ -z "$CHEF_INSTALLMETHOD" ]; then + export CHEF_INSTALLMETHOD="gems" +fi + +# Installing chef +case $CHEF_INSTALLMETHOD in + "gems") + # Using gems + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + gem install chef --no-ri --no-rdoc + else + gem install chef --no-ri --no-rdoc --version $CHEF_VERSION + fi + ;; + + "omnibus") + # Using omnibus + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + wget -O - http://opscode.com/chef/install.sh | sudo bash -s + else + wget -O - http://opscode.com/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION + fi + ;; + + "package") + # Using packages + apt-get install -y debconf-utils + echo "chef chef/chef_server_url string $CHEF_SERVER_URL" | debconf-set-selections + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + apt-get install -y chef + else + apt-get install -y chef=$CHEF_VERSION + fi + ;; + + *) + echo "Unsupported method for installing chef" + exit -1 + ;; +esac diff --git a/templates/Debian-8/cleanup.sh b/templates/Debian-8/cleanup.sh new file mode 100644 index 00000000..f6953e16 --- /dev/null +++ b/templates/Debian-8/cleanup.sh @@ -0,0 +1,18 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove +apt-get -y clean + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-8/definition.rb b/templates/Debian-8/definition.rb new file mode 100644 index 00000000..186a9f78 --- /dev/null +++ b/templates/Debian-8/definition.rb @@ -0,0 +1 @@ +Veewee::Definition.declare_yaml('definition.yml', '8.6.yml') diff --git a/templates/Debian-8/definition.yml b/templates/Debian-8/definition.yml new file mode 100644 index 00000000..ea59d3f8 --- /dev/null +++ b/templates/Debian-8/definition.yml @@ -0,0 +1,46 @@ +--- +:cpu_count: '1' +:memory_size: '256' +:disk_size: '10140' +:disk_format: 'VDI' +:hostiocache: 'off' +:iso_download_timeout: '1000' +:boot_wait: '10' +:boot_cmd_sequence: + - ' ' + - 'install ' + - 'preseed/url=http://%IP%:%PORT%/preseed.cfg ' + - 'debian-installer=en_US ' + - 'auto ' + - 'locale=en_US ' + - 'kbd-chooser/method=us ' + - 'netcfg/get_hostname=%NAME% ' + - 'netcfg/get_domain=vagrantup.com ' + - 'fb=false ' + - 'debconf/frontend=noninteractive ' + - 'console-setup/ask_detect=false ' + - 'console-keymaps-at/keymap=us ' + - 'keyboard-configuration/xkb-keymap=us ' + - ' ' +:kickstart_port: '7122' +:kickstart_timeout: '300' +:kickstart_file: 'preseed.cfg' +:ssh_login_timeout: '10000' +:ssh_user: 'vagrant' +:ssh_password: 'vagrant' +:ssh_key: '' +:ssh_host_port: '7222' +:ssh_guest_port: '22' +:sudo_cmd: "echo '%p'|sudo -S bash '%f'" +:shutdown_cmd: 'halt -p' +:postinstall_files: + - 'base.sh' + - 'vagrant.sh' + - 'virtualbox.sh' + #- 'vmfusion.sh' + #- 'ruby.sh' + #- 'puppet.sh' + #- 'chef.sh' + - 'cleanup.sh' + - 'zerodisk.sh' +:postinstall_timeout: '10000' diff --git a/templates/Debian-8/preseed.cfg b/templates/Debian-8/preseed.cfg new file mode 100644 index 00000000..3c013fc4 --- /dev/null +++ b/templates/Debian-8/preseed.cfg @@ -0,0 +1,429 @@ +#### Contents of the preconfiguration file (for jessie) +### Localization +# Preseeding only locale sets language, country and locale. +d-i debian-installer/locale string en_US.UTF-8 + +# The values can also be preseeded individually for greater flexibility. +#d-i debian-installer/language string en +#d-i debian-installer/country string NL +#d-i debian-installer/locale string en_GB.UTF-8 +# Optionally specify additional locales to be generated. +#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 + +# Keyboard selection. +d-i keyboard-configuration/xkb-keymap select us +# d-i keyboard-configuration/toggle select No toggling + +### Network configuration +# Disable network configuration entirely. This is useful for cdrom +# installations on non-networked devices where the network questions, +# warning and long timeouts are a nuisance. +#d-i netcfg/enable boolean false + +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# To set a different link detection timeout (default is 3 seconds). +# Values are interpreted as seconds. +#d-i netcfg/link_wait_timeout string 10 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 +#d-i netcfg/dhcpv6_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_autoconfig boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +# +# IPv4 example +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/confirm_static boolean true +# +# IPv6 example +#d-i netcfg/get_ipaddress string fc00::2 +#d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: +#d-i netcfg/get_gateway string fc00::1 +#d-i netcfg/get_nameservers string fc00::1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrant +d-i netcfg/get_domain string vagrantup.com + +# If you want to force a hostname, regardless of what either the DHCP +# server returns or what the reverse DNS entry for the IP is, uncomment +# and adjust the following line. +#d-i netcfg/hostname string somehost + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.debian.net +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +## Partitioning example +# If the system has free space you can choose to only partition that space. +# This is only honoured if partman-auto/method (below) is not set. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you may specify a disk to partition. If the system has only +# one disk the installer will default to using that, but otherwise the device +# name must be given in traditional, non-devfs format (so e.g. /dev/sda +# and not e.g. /dev/discs/disc0/disc). +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: +# - regular: use the usual partition types for your architecture +# - lvm: use LVM to partition the disk +# - crypto: use LVM within an encrypted partition +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + + +d-i partman/choose_partition select finish +d-i partman-auto-lvm/guided_size string max + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic + +# Or provide a recipe of your own... +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +# The full recipe format is documented in the file partman-auto-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. This also documents how to specify settings such as file +# system labels, volume group names and which physical devices to include +# in a volume group. + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +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 + +## Partitioning using RAID +# The method should be set to "raid". +#d-i partman-auto/method string raid +# Specify the disks to be partitioned. They will all get the same layout, +# so this will only work if the disks are the same size. +#d-i partman-auto/disk string /dev/sda /dev/sdb + +# Next you need to specify the physical partitions that will be used. +#d-i partman-auto/expert_recipe string \ +# multiraid :: \ +# 1000 5000 4000 raid \ +# $primary{ } method{ raid } \ +# . \ +# 64 512 300% raid \ +# method{ raid } \ +# . \ +# 500 10000 1000000000 raid \ +# method{ raid } \ +# . + +# Last you need to specify how the previously defined partitions will be +# used in the RAID setup. Remember to use the correct partition numbers +# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; +# devices are separated using "#". +# Parameters are: +# \ +# + +#d-i partman-auto-raid/recipe string \ +# 1 2 0 ext3 / \ +# /dev/sda1#/dev/sdb1 \ +# . \ +# 1 2 0 swap - \ +# /dev/sda5#/dev/sdb5 \ +# . \ +# 0 2 0 ext3 /home \ +# /dev/sda6#/dev/sdb6 \ +# . + +# For additional information see the file partman-auto-raid-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. + +# This makes partman automatically partition without confirmation. +d-i partman-md/confirm boolean true +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 + +## Controlling how partitions are mounted +# The default is to mount by UUID, but you can also choose "traditional" to +# use traditional device names, or "label" to try filesystem labels before +# falling back to UUIDs. +#d-i partman/mount_style select uuid + +### Base system installation +# Configure APT to not install recommended packages by default. Use of this +# option can result in an incomplete system and should only be used by very +# experienced users. +#d-i base-installer/install-recommends boolean false + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-586 + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/root-password-crypted password [MD5 hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using an MD5 hash. +#d-i passwd/user-password-crypted password [MD5 hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/security_host string security.debian.org + +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/repository string \ +# http://local.server/debian stable main +#d-i apt-setup/local0/comment string local server +# Enable deb-src lines +#d-i apt-setup/local0/source boolean true +# URL to the public key of the local repository; you must provide a key or +# apt will complain about the unauthenticated repository and so the +# sources.list line will be left commented out +#d-i apt-setup/local0/key string http://local.server/key + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated boolean true + +### Package selection +tasksel tasksel/first multiselect standard + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Due notably to potential USB sticks, the location of the MBR can not be +# determined safely in general, so this needs to be specified: +#d-i grub-installer/bootdev string /dev/sda +# To install to the first device (assuming it is not a USB stick): +d-i grub-installer/bootdev string default + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,1) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +#d-i debian-installer/add-kernel-opts string nousb + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages +# This command is run immediately before the partitioner starts. It may be +# useful to apply dynamic partitioner preseeding that depends on the state +# of the disks (which may not be visible when preseed/early_command runs). +#d-i partman/early_command \ +# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh diff --git a/templates/Debian-8/puppet.sh b/templates/Debian-8/puppet.sh new file mode 100644 index 00000000..107b2361 --- /dev/null +++ b/templates/Debian-8/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb +dpkg -i puppetlabs-release-wheezy.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-8/ruby.sh b/templates/Debian-8/ruby.sh new file mode 100644 index 00000000..e44d60d2 --- /dev/null +++ b/templates/Debian-8/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libopenssl-ruby1.8 irb ri rdoc + +# Install Rubygems from source +rg_ver=1.8.22 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-8/vagrant.sh b/templates/Debian-8/vagrant.sh new file mode 100644 index 00000000..54c2a71e --- /dev/null +++ b/templates/Debian-8/vagrant.sh @@ -0,0 +1,21 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -Lo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common + + diff --git a/templates/Debian-8/virtualbox.sh b/templates/Debian-8/virtualbox.sh new file mode 100644 index 00000000..4dad6492 --- /dev/null +++ b/templates/Debian-8/virtualbox.sh @@ -0,0 +1,37 @@ +if test -f .vbox_version ; then + # The netboot installs the VirtualBox support (old) so we have to remove it + if test -f /etc/init.d/virtualbox-ose-guest-utils ; then + /etc/init.d/virtualbox-ose-guest-utils stop + fi + + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + + # Install dkms for dynamic compiles + + apt-get install -y dkms + + # If libdbus is not installed, virtualbox will not autostart + apt-get -y install --no-install-recommends libdbus-1-3 + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat .vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt + + # Start the newly build driver + /etc/init.d/vboxadd start + + # Make a temporary mount point + mkdir /tmp/veewee-validation + + # Test mount the veewee-validation + mount -t vboxsf veewee-validation /tmp/veewee-validation + + rm $VBOX_ISO + + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions +fi diff --git a/templates/Debian-8/vmfusion.sh b/templates/Debian-8/vmfusion.sh new file mode 100644 index 00000000..3ced7e44 --- /dev/null +++ b/templates/Debian-8/vmfusion.sh @@ -0,0 +1,7 @@ +cd /tmp +mkdir -p /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom +tar zxvf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ +/tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso +umount /mnt/cdrom diff --git a/templates/Debian-8/zerodisk.sh b/templates/Debian-8/zerodisk.sh new file mode 100644 index 00000000..938075a3 --- /dev/null +++ b/templates/Debian-8/zerodisk.sh @@ -0,0 +1,3 @@ +# Zero out the free space to save space in the final image: +dd if=/dev/zero of=/EMPTY bs=1M +rm -f /EMPTY diff --git a/templates/Debian-9.1-amd64-netboot/base.sh b/templates/Debian-9.1-amd64-netboot/base.sh new file mode 100644 index 00000000..e3642f1c --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/base.sh @@ -0,0 +1,25 @@ +# Update the box +apt-get -y update +apt-get -y install linux-headers-$(uname -r) build-essential +apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev +apt-get -y install curl unzip + +# Set up sudo +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant + +# Tweak sshd to prevent DNS resolution (speed up logins) +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Remove 5s grub timeout to speed up booting +cat < /etc/default/grub +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="debian-installer=en_US" +EOF + +update-grub diff --git a/templates/Debian-9.1-amd64-netboot/chef.sh b/templates/Debian-9.1-amd64-netboot/chef.sh new file mode 100644 index 00000000..cd119586 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/chef.sh @@ -0,0 +1,49 @@ +if [ -f .veewee_params ] +then + . .veewee_params +fi + +# Default to Gem install +if [ -z "$CHEF_INSTALLMETHOD" ]; then + export CHEF_INSTALLMETHOD="gems" +fi + +# Installing chef +case $CHEF_INSTALLMETHOD in + "gems") + # Using gems + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + gem install chef --no-ri --no-rdoc + else + gem install chef --no-ri --no-rdoc --version $CHEF_VERSION + fi + ;; + + "omnibus") + # Using omnibus + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + wget -O - http://opscode.com/chef/install.sh | sudo bash -s + else + wget -O - http://opscode.com/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION + fi + ;; + + "package") + # Using packages + apt-get install -y debconf-utils + echo "chef chef/chef_server_url string $CHEF_SERVER_URL" | debconf-set-selections + if [ -z "$CHEF_VERSION" ]; then + # Default to latest + apt-get install -y chef + else + apt-get install -y chef=$CHEF_VERSION + fi + ;; + + *) + echo "Unsupported method for installing chef" + exit -1 + ;; +esac diff --git a/templates/Debian-9.1-amd64-netboot/cleanup.sh b/templates/Debian-9.1-amd64-netboot/cleanup.sh new file mode 100644 index 00000000..f6953e16 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/cleanup.sh @@ -0,0 +1,18 @@ +# Clean up +apt-get -y remove linux-headers-$(uname -r) build-essential +apt-get -y autoremove +apt-get -y clean + +# Removing leftover leases and persistent rules +echo "cleaning up dhcp leases" +rm /var/lib/dhcp/* + +# Make sure Udev doesn't block our network +echo "cleaning up udev rules" +rm /etc/udev/rules.d/70-persistent-net.rules +mkdir /etc/udev/rules.d/70-persistent-net.rules +rm -rf /dev/.udev/ +rm /lib/udev/rules.d/75-persistent-net-generator.rules + +echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/templates/Debian-9.1-amd64-netboot/debian_64_net.yml b/templates/Debian-9.1-amd64-netboot/debian_64_net.yml new file mode 100644 index 00000000..19c207fa --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/debian_64_net.yml @@ -0,0 +1,5 @@ +--- +:os_type_id: 'Debian_64' +:iso_file: "debian-9.1.0-amd64-netinst.iso" +:iso_src: "http://cdimage.debian.org/debian-cd/9.1.0/amd64/iso-cd/debian-9.1.0-amd64-netinst.iso" +:iso_md5: "ddd8f6542dae8baf410e90b9ae0fe986" diff --git a/templates/Debian-9.1-amd64-netboot/definition.rb b/templates/Debian-9.1-amd64-netboot/definition.rb new file mode 100644 index 00000000..7d172c2f --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/definition.rb @@ -0,0 +1,5 @@ +# +# change debian_64_netinst to one of configurations in *.yml in this directory +# use the yml files to configure +# +Veewee::Definition.declare_yaml('definition.yml', "debian_64_net.yml") diff --git a/templates/Debian-9.1-amd64-netboot/definition.yml b/templates/Debian-9.1-amd64-netboot/definition.yml new file mode 100644 index 00000000..ed15f6b2 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/definition.yml @@ -0,0 +1,46 @@ +--- +:cpu_count: '1' +:memory_size: '256' +:disk_size: '10140' +:disk_format: 'VDI' +:hostiocache: 'off' +:iso_download_timeout: "1000" +:boot_wait: "10" +:boot_cmd_sequence: + - ' ' + - 'install ' + - 'preseed/url=http://%IP%:%PORT%/preseed.cfg ' + - 'debian-installer=en_US ' + - 'auto ' + - 'locale=en_US ' + - 'kbd-chooser/method=us ' + - 'netcfg/get_hostname=%NAME% ' + - 'netcfg/get_domain=vagrantup.com ' + - 'fb=false ' + - 'debconf/frontend=noninteractive ' + - 'console-setup/ask_detect=false ' + - 'console-keymaps-at/keymap=us ' + - 'keyboard-configuration/xkb-keymap=us ' + - ' ' +:kickstart_port: "7122" +:kickstart_timeout: "300" +:kickstart_file: "preseed.cfg" +:ssh_login_timeout: "10000" +:ssh_user: "vagrant" +:ssh_password: "vagrant" +:ssh_key: "" +:ssh_host_port: "7222" +:ssh_guest_port: "22" +:sudo_cmd: "echo '%p'|sudo -S bash '%f'" +:shutdown_cmd: "halt -p" +:postinstall_files: + - "base.sh" + - "vagrant.sh" + - "virtualbox.sh" + #- "vmfusion.sh" + - "ruby.sh" + - "puppet.sh" + - "chef.sh" + - "cleanup.sh" + - "zerodisk.sh" +:postinstall_timeout: "10000" diff --git a/templates/Debian-9.1-amd64-netboot/preseed.cfg b/templates/Debian-9.1-amd64-netboot/preseed.cfg new file mode 100644 index 00000000..f42d4f42 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/preseed.cfg @@ -0,0 +1,435 @@ +#### Contents of the preconfiguration file (for stretch) +### Localization +# Preseeding only locale sets language, country and locale. +d-i debian-installer/locale string en_US.UTF-8 + +# The values can also be preseeded individually for greater flexibility. +#d-i debian-installer/language string en +#d-i debian-installer/country string NL +#d-i debian-installer/locale string en_GB.UTF-8 +# Optionally specify additional locales to be generated. +#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 + +# Keyboard selection. +d-i keyboard-configuration/xkb-keymap select us +# d-i keyboard-configuration/toggle select No toggling + +### Network configuration +# Disable network configuration entirely. This is useful for cdrom +# installations on non-networked devices where the network questions, +# warning and long timeouts are a nuisance. +#d-i netcfg/enable boolean false + +# 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 + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# To set a different link detection timeout (default is 3 seconds). +# Values are interpreted as seconds. +#d-i netcfg/link_wait_timeout string 10 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 +#d-i netcfg/dhcpv6_timeout string 60 + +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_autoconfig boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +# +# IPv4 example +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/confirm_static boolean true +# +# IPv6 example +#d-i netcfg/get_ipaddress string fc00::2 +#d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: +#d-i netcfg/get_gateway string fc00::1 +#d-i netcfg/get_nameservers string fc00::1 +#d-i netcfg/confirm_static boolean true + +# 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 vagrantup.com + +# If you want to force a hostname, regardless of what either the DHCP +# server returns or what the reverse DNS entry for the IP is, uncomment +# and adjust the following line. +#d-i netcfg/hostname string somehost + +# Disable that annoying WEP key dialog. +d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +d-i mirror/http/hostname string http.debian.net +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +d-i passwd/root-password password vagrant +d-i passwd/root-password-again password vagrant +# or encrypted using a crypt(3) hash. +#d-i passwd/root-password-crypted password [crypt(3) hash] + +# To create a normal user account. +d-i passwd/user-fullname string Vagrant User +d-i passwd/username string vagrant +# Normal user's password, either in clear text +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +# or encrypted using a crypt(3) hash. +#d-i passwd/user-password-crypted password [crypt(3) hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 + +# The user account will be added to some standard initial groups. To +# override that, use this. +d-i passwd/user-default-groups string audio cdrom video admin + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +d-i time/zone string UTC + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +## Partitioning example +# If the system has free space you can choose to only partition that space. +# This is only honoured if partman-auto/method (below) is not set. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you may specify a disk to partition. If the system has only +# one disk the installer will default to using that, but otherwise the device +# name must be given in traditional, non-devfs format (so e.g. /dev/sda +# and not e.g. /dev/discs/disc0/disc). +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: +# - regular: use the usual partition types for your architecture +# - lvm: use LVM to partition the disk +# - crypto: use LVM within an encrypted partition +d-i partman-auto/method string lvm + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +d-i partman-md/device_remove_md boolean true +# And the same goes for the confirmation to write the lvm partitions. +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /var, and /tmp partitions +d-i partman-auto/choose_recipe select atomic + +# Or provide a recipe of your own... +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +# The full recipe format is documented in the file partman-auto-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. This also documents how to specify settings such as file +# system labels, volume group names and which physical devices to include +# in a volume group. + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +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 + +# When disk encryption is enabled, skip wiping the partitions beforehand. +#d-i partman-auto-crypto/erase_disks boolean false + +## Partitioning using RAID +# The method should be set to "raid". +#d-i partman-auto/method string raid +# Specify the disks to be partitioned. They will all get the same layout, +# so this will only work if the disks are the same size. +#d-i partman-auto/disk string /dev/sda /dev/sdb + +# Next you need to specify the physical partitions that will be used. +#d-i partman-auto/expert_recipe string \ +# multiraid :: \ +# 1000 5000 4000 raid \ +# $primary{ } method{ raid } \ +# . \ +# 64 512 300% raid \ +# method{ raid } \ +# . \ +# 500 10000 1000000000 raid \ +# method{ raid } \ +# . + +# Last you need to specify how the previously defined partitions will be +# used in the RAID setup. Remember to use the correct partition numbers +# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; +# devices are separated using "#". +# Parameters are: +# \ +# + +#d-i partman-auto-raid/recipe string \ +# 1 2 0 ext3 / \ +# /dev/sda1#/dev/sdb1 \ +# . \ +# 1 2 0 swap - \ +# /dev/sda5#/dev/sdb5 \ +# . \ +# 0 2 0 ext3 /home \ +# /dev/sda6#/dev/sdb6 \ +# . + +# For additional information see the file partman-auto-raid-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. + +# This makes partman automatically partition without confirmation. +d-i partman-md/confirm boolean true +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 + +## Controlling how partitions are mounted +# The default is to mount by UUID, but you can also choose "traditional" to +# use traditional device names, or "label" to try filesystem labels before +# falling back to UUIDs. +#d-i partman/mount_style select uuid + +### Base system installation +# Configure APT to not install recommended packages by default. Use of this +# option can result in an incomplete system and should only be used by very +# experienced users. +#d-i base-installer/install-recommends boolean false + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-686 + +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/security_host string security.debian.org + +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/repository string \ +# http://local.server/debian stable main +#d-i apt-setup/local0/comment string local server +# Enable deb-src lines +#d-i apt-setup/local0/source boolean true +# URL to the public key of the local repository; you must provide a key or +# apt will complain about the unauthenticated repository and so the +# sources.list line will be left commented out +#d-i apt-setup/local0/key string http://local.server/key + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated boolean true + +# Uncomment this to add multiarch configuration for i386 +#d-i apt-setup/multiarch string i386 + +# Disable prompt "You now have the option to scan additional CDs or..." +d-i apt-setup/cdrom/set-first false + +### Package selection +tasksel tasksel/first multiselect standard + +# Individual additional packages to install +d-i pkgsel/include string openssh-server ntp acpid sudo bzip2 rsync +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select none + +# Some versions of the installer can report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and include it on CDs. +popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the default boot loader (for x86). If you want lilo installed +# instead, uncomment this: +#d-i grub-installer/skip boolean true +# To also skip installing lilo, and install no bootloader, uncomment this +# too: +#d-i lilo-installer/skip boolean true + + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Due notably to potential USB sticks, the location of the MBR can not be +# determined safely in general, so this needs to be specified: +#d-i grub-installer/bootdev string /dev/sda +# To install to the first device (assuming it is not a USB stick): +d-i grub-installer/bootdev string default + +# Alternatively, if you want to install to a location other than the mbr, +# uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,1) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +#d-i debian-installer/add-kernel-opts string nousb + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ + '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ + /usr/lib/pre-pkgsel.d/20install-hwpackages +# This command is run immediately before the partitioner starts. It may be +# useful to apply dynamic partitioner preseeding that depends on the state +# of the disks (which may not be visible when preseed/early_command runs). +#d-i partman/early_command \ +# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh + diff --git a/templates/Debian-9.1-amd64-netboot/puppet.sh b/templates/Debian-9.1-amd64-netboot/puppet.sh new file mode 100644 index 00000000..107b2361 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/puppet.sh @@ -0,0 +1,7 @@ +# Prepare puppetlabs repo +wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb +dpkg -i puppetlabs-release-wheezy.deb +apt-get update + +# Install puppet/facter +apt-get install -y puppet facter diff --git a/templates/Debian-9.1-amd64-netboot/ruby.sh b/templates/Debian-9.1-amd64-netboot/ruby.sh new file mode 100644 index 00000000..e44d60d2 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/ruby.sh @@ -0,0 +1,10 @@ +# Install Ruby from packages +apt-get -y install ruby ruby-dev libopenssl-ruby1.8 irb ri rdoc + +# Install Rubygems from source +rg_ver=1.8.22 +curl -o /tmp/rubygems-${rg_ver}.zip \ + "http://production.cf.rubygems.org/rubygems/rubygems-${rg_ver}.zip" +(cd /tmp && unzip rubygems-${rg_ver}.zip && \ + cd rubygems-${rg_ver} && ruby setup.rb --no-format-executable) +rm -rf /tmp/rubygems-${rg_ver} /tmp/rubygems-${rg_ver}.zip diff --git a/templates/Debian-9.1-amd64-netboot/vagrant.sh b/templates/Debian-9.1-amd64-netboot/vagrant.sh new file mode 100644 index 00000000..54c2a71e --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/vagrant.sh @@ -0,0 +1,21 @@ +# Set up Vagrant. + +date > /etc/vagrant_box_build_time + +# Create the user vagrant with password vagrant +useradd -G sudo -p $(perl -e'print crypt("vagrant", "vagrant")') -m -s /bin/bash -N vagrant + +# Install vagrant keys +mkdir -pm 700 /home/vagrant/.ssh +curl -Lo /home/vagrant/.ssh/authorized_keys \ + 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' +chmod 0600 /home/vagrant/.ssh/authorized_keys +chown -R vagrant:vagrant /home/vagrant/.ssh + +# Customize the message of the day +echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd + +# Install NFS client +apt-get -y install nfs-common + + diff --git a/templates/Debian-9.1-amd64-netboot/virtualbox.sh b/templates/Debian-9.1-amd64-netboot/virtualbox.sh new file mode 100644 index 00000000..4dad6492 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/virtualbox.sh @@ -0,0 +1,37 @@ +if test -f .vbox_version ; then + # The netboot installs the VirtualBox support (old) so we have to remove it + if test -f /etc/init.d/virtualbox-ose-guest-utils ; then + /etc/init.d/virtualbox-ose-guest-utils stop + fi + + rmmod vboxguest + aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils + + # Install dkms for dynamic compiles + + apt-get install -y dkms + + # If libdbus is not installed, virtualbox will not autostart + apt-get -y install --no-install-recommends libdbus-1-3 + + # Install the VirtualBox guest additions + VBOX_VERSION=$(cat .vbox_version) + VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso + mount -o loop $VBOX_ISO /mnt + yes|sh /mnt/VBoxLinuxAdditions.run + umount /mnt + + # Start the newly build driver + /etc/init.d/vboxadd start + + # Make a temporary mount point + mkdir /tmp/veewee-validation + + # Test mount the veewee-validation + mount -t vboxsf veewee-validation /tmp/veewee-validation + + rm $VBOX_ISO + + # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341 + ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions +fi diff --git a/templates/Debian-9.1-amd64-netboot/vmfusion.sh b/templates/Debian-9.1-amd64-netboot/vmfusion.sh new file mode 100644 index 00000000..3ced7e44 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/vmfusion.sh @@ -0,0 +1,7 @@ +cd /tmp +mkdir -p /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom +tar zxvf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ +/tmp/vmware-tools-distrib/vmware-install.pl -d +rm /home/vagrant/linux.iso +umount /mnt/cdrom diff --git a/templates/Debian-9.1-amd64-netboot/zerodisk.sh b/templates/Debian-9.1-amd64-netboot/zerodisk.sh new file mode 100644 index 00000000..938075a3 --- /dev/null +++ b/templates/Debian-9.1-amd64-netboot/zerodisk.sh @@ -0,0 +1,3 @@ +# Zero out the free space to save space in the final image: +dd if=/dev/zero of=/EMPTY bs=1M +rm -f /EMPTY diff --git a/templates/Fedora-14-amd64-netboot/definition.rb b/templates/Fedora-14-amd64-netboot/definition.rb index 8da26537..0edf896c 100644 --- a/templates/Fedora-14-amd64-netboot/definition.rb +++ b/templates/Fedora-14-amd64-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "acd25fc1470f2497cf2a2a245adbfe1e", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-14-amd64/definition.rb b/templates/Fedora-14-amd64/definition.rb index b98592f6..d9aef77b 100644 --- a/templates/Fedora-14-amd64/definition.rb +++ b/templates/Fedora-14-amd64/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "381d7336c6d1685cbb4eae49cdef2247", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-14-i386-netboot/definition.rb b/templates/Fedora-14-i386-netboot/definition.rb index b24fe813..1d40b91f 100644 --- a/templates/Fedora-14-i386-netboot/definition.rb +++ b/templates/Fedora-14-i386-netboot/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "59d2490d7bf73a6c8a80d9a790f17184", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-14-i386/definition.rb b/templates/Fedora-14-i386/definition.rb index b366d0b6..b140e329 100644 --- a/templates/Fedora-14-i386/definition.rb +++ b/templates/Fedora-14-i386/definition.rb @@ -7,7 +7,7 @@ :iso_md5 => "1cc67641506d2f931d669b8d3528dded", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-15-i386-netboot/definition.rb b/templates/Fedora-15-i386-netboot/definition.rb index 240deaf3..f9dcb58c 100644 --- a/templates/Fedora-15-i386-netboot/definition.rb +++ b/templates/Fedora-15-i386-netboot/definition.rb @@ -8,7 +8,7 @@ :iso_md5 => "9a91492ac84dde9ceff0cb346a079487", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-15-i386/definition.rb b/templates/Fedora-15-i386/definition.rb index 5a6bae9f..5b26e969 100644 --- a/templates/Fedora-15-i386/definition.rb +++ b/templates/Fedora-15-i386/definition.rb @@ -8,7 +8,7 @@ :iso_md5 => "9a91492ac84dde9ceff0cb346a079487", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-15-x86_64-netboot/definition.rb b/templates/Fedora-15-x86_64-netboot/definition.rb index 8762936e..fb8e0db2 100644 --- a/templates/Fedora-15-x86_64-netboot/definition.rb +++ b/templates/Fedora-15-x86_64-netboot/definition.rb @@ -14,7 +14,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "100", :ssh_user => "vagrant", diff --git a/templates/Fedora-15-x86_64/definition.rb b/templates/Fedora-15-x86_64/definition.rb index 7e183b9c..64a0e370 100644 --- a/templates/Fedora-15-x86_64/definition.rb +++ b/templates/Fedora-15-x86_64/definition.rb @@ -8,7 +8,7 @@ :iso_md5 => "c122a2a4f478da4a3d2d12396e84244e", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-16-i386/definition.rb b/templates/Fedora-16-i386/definition.rb index 1c41e3d3..a01ee1cd 100644 --- a/templates/Fedora-16-i386/definition.rb +++ b/templates/Fedora-16-i386/definition.rb @@ -8,7 +8,7 @@ :iso_md5 => "0d64ab6b1b800827a9c83d95395b3da0", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-16-x86_64-netboot/definition.rb b/templates/Fedora-16-x86_64-netboot/definition.rb index 91f45ccb..84990587 100644 --- a/templates/Fedora-16-x86_64-netboot/definition.rb +++ b/templates/Fedora-16-x86_64-netboot/definition.rb @@ -14,7 +14,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ ' linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => 10000, :ssh_user => "vagrant", diff --git a/templates/Fedora-16-x86_64/definition.rb b/templates/Fedora-16-x86_64/definition.rb index 35117e39..6fa345e4 100644 --- a/templates/Fedora-16-x86_64/definition.rb +++ b/templates/Fedora-16-x86_64/definition.rb @@ -8,7 +8,7 @@ :iso_md5 => "bb38ea1fe4b2fc69e7a6e15cf1c69c91", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-17-i386/definition.rb b/templates/Fedora-17-i386/definition.rb index b894e14b..200a3fb2 100644 --- a/templates/Fedora-17-i386/definition.rb +++ b/templates/Fedora-17-i386/definition.rb @@ -8,7 +8,7 @@ :iso_md5 => "d4717e04b596e33898cc34970e79dd3d", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-17-x86_64/definition.rb b/templates/Fedora-17-x86_64/definition.rb index c5db6e6e..08b659c6 100644 --- a/templates/Fedora-17-x86_64/definition.rb +++ b/templates/Fedora-17-x86_64/definition.rb @@ -8,7 +8,7 @@ :iso_md5 => "26f3358a5f8973f0956093f28a0106e7", :iso_download_timeout => 1000, :boot_wait => "10", :boot_cmd_sequence => [ ' linux text biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], - :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg", + :kickstart_port => "7122", :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "", :ssh_host_port => "7222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", diff --git a/templates/Fedora-18-i386/definition.rb b/templates/Fedora-18-i386/definition.rb index 4b310108..f0316ee4 100644 --- a/templates/Fedora-18-i386/definition.rb +++ b/templates/Fedora-18-i386/definition.rb @@ -14,7 +14,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ ' linux text biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Fedora-18-x86_64/definition.rb b/templates/Fedora-18-x86_64/definition.rb index 6a6bcb05..0323acfd 100644 --- a/templates/Fedora-18-x86_64/definition.rb +++ b/templates/Fedora-18-x86_64/definition.rb @@ -14,7 +14,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ ' linux text biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Fedora-19-i386/definition.rb b/templates/Fedora-19-i386/definition.rb index cd00ff0a..59d5a5e4 100644 --- a/templates/Fedora-19-i386/definition.rb +++ b/templates/Fedora-19-i386/definition.rb @@ -14,7 +14,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ ' linux text net.ifnames=0 biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Fedora-19-x86_64/definition.rb b/templates/Fedora-19-x86_64/definition.rb index 4e55d60f..b164031b 100644 --- a/templates/Fedora-19-x86_64/definition.rb +++ b/templates/Fedora-19-x86_64/definition.rb @@ -14,7 +14,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ ' linux text net.ifnames=0 biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Fedora-20-i386/definition.rb b/templates/Fedora-20-i386/definition.rb index 34053677..8d30459b 100644 --- a/templates/Fedora-20-i386/definition.rb +++ b/templates/Fedora-20-i386/definition.rb @@ -14,7 +14,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'i linux text net.ifnames=0 biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Fedora-20-x86_64/definition.rb b/templates/Fedora-20-x86_64/definition.rb index 627daf3d..6e967058 100644 --- a/templates/Fedora-20-x86_64/definition.rb +++ b/templates/Fedora-20-x86_64/definition.rb @@ -14,7 +14,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'i linux text net.ifnames=0 biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", diff --git a/templates/Fedora-21-x86_64/base.sh b/templates/Fedora-21-x86_64/base.sh new file mode 100644 index 00000000..e7186df8 --- /dev/null +++ b/templates/Fedora-21-x86_64/base.sh @@ -0,0 +1,9 @@ +# Base install + +# Enable updates-testing repo +sed -i "s/enabled=0/enabled=1/" /etc/yum.repos.d/fedora-updates-testing.repo + +# Must exclude kernel for now. Otherwise, kernel gets upgraded before reboot, +# but VirtualBox tools get compiled against the old kernel, so the fresh +# image will refuse to start under Vagrant. +yum -y update --exclude kernel* diff --git a/templates/Fedora-21-x86_64/chef.sh b/templates/Fedora-21-x86_64/chef.sh new file mode 100644 index 00000000..9f4ba864 --- /dev/null +++ b/templates/Fedora-21-x86_64/chef.sh @@ -0,0 +1,17 @@ +# Install pre-requisites +yum -y install \ + rubygem-bunny \ + rubygem-erubis \ + rubygem-highline \ + rubygem-json \ + rubygem-mime-types \ + rubygem-net-ssh \ + rubygem-polyglot \ + rubygem-rest-client \ + rubygem-systemu \ + rubygem-treetop \ + rubygem-uuidtools + +# Install Chef +gem install --no-ri --no-rdoc chef + diff --git a/templates/CentOS-6.5-i386-netboot/cleanup.sh b/templates/Fedora-21-x86_64/cleanup.sh similarity index 72% rename from templates/CentOS-6.5-i386-netboot/cleanup.sh rename to templates/Fedora-21-x86_64/cleanup.sh index 929e13f5..6ba836c2 100644 --- a/templates/CentOS-6.5-i386-netboot/cleanup.sh +++ b/templates/Fedora-21-x86_64/cleanup.sh @@ -1,8 +1,6 @@ yum -y erase gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts yum -y clean all -rm -rf /etc/yum.repos.d/{puppetlabs,epel}.repo rm -rf VBoxGuestAdditions_*.iso # Remove traces of mac address from network configuration sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 -rm /etc/udev/rules.d/70-persistent-net.rules diff --git a/templates/CentOS-5.10-i386-netboot/definition.rb b/templates/Fedora-21-x86_64/definition.rb old mode 100755 new mode 100644 similarity index 52% rename from templates/CentOS-5.10-i386-netboot/definition.rb rename to templates/Fedora-21-x86_64/definition.rb index e5c17b9a..3822422a --- a/templates/CentOS-5.10-i386-netboot/definition.rb +++ b/templates/Fedora-21-x86_64/definition.rb @@ -1,24 +1,20 @@ Veewee::Session.declare({ + # Minimum RAM requirement for installation is 512MB. :cpu_count => '1', - :memory_size=> '384', + :memory_size=> '512', :disk_size => '10140', :disk_format => 'VDI', - :hostiocache => 'on', - :virtualbox => { - :vm_options => [ - "pae" => "on", - "ioapic" => "on", - ], - }, - :os_type_id => 'RedHat', - :iso_file => "CentOS-5.10-i386-netinstall.iso", - :iso_src => "http://mirrors.kernel.org/centos/5.10/isos/i386/CentOS-5.10-i386-netinstall.iso", - :iso_md5 => "8d19b12cb5f65a4b5c2bc61a98abf80c", + :hostiocache => 'off', + :hwvirtext => 'on', + :os_type_id => 'Fedora_64', + :iso_file => "Fedora-Server-DVD-x86_64-21.iso", + :iso_src => "http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/x86_64/iso/Fedora-Server-DVD-x86_64-21.iso", + :iso_sha256 => "a6a2e83bb409d6b8ee3072ad07faac0a54d79c9ecbe3a40af91b773e2d843d8e", :iso_download_timeout => 1000, :boot_wait => "10", - :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], + :boot_cmd_sequence => [ 'i linux text net.ifnames=0 biosdevname=0 ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "vagrant", @@ -35,6 +31,7 @@ "puppet.sh", "vagrant.sh", "virtualbox.sh", + #"vmfusion.sh", "cleanup.sh", "zerodisk.sh" ], diff --git a/templates/Fedora-21-x86_64/ks.cfg b/templates/Fedora-21-x86_64/ks.cfg new file mode 100644 index 00000000..5ad91c5d --- /dev/null +++ b/templates/Fedora-21-x86_64/ks.cfg @@ -0,0 +1,83 @@ +# Kickstart file automatically generated by anaconda. + +install +cdrom +lang en_US.UTF-8 +keyboard 'us' +# note we set biosdevname=0 when launching install +# this means we will be using standard ethernet devices, e.g. eth[0,1,2] eth +network --onboot yes --device eth0 --bootproto dhcp --noipv6 --hostname=localhost.localdomain +timezone --utc America/New_York +rootpw --iscrypted $6$n/NGsk5H2aiBMXL4$r/oPkJtB5rasvQHPo9AvIJBe6sNVlQbpZxvTRMN7.qZk/Sn9u2qZ0XgNxflUvK20y7OIWdr/vv7MED6gzkBiH0 +selinux --enforcing +auth --enableshadow --passalgo=sha512 +firewall --service=ssh + +# Avoiding warning message on Storage device breaking automated generation +zerombr + +# The following is the partition information you requested +# Note that any partitions you deleted are not expressed +# here so unless you clear all partitions first, this is +# not guaranteed to work +clearpart --all --initlabel + +#part biosboot --fstype=biosboot --size=1 +part /boot --fstype=ext4 --size=500 +part pv.2 --grow --size=500 + +volgroup vg_vagrant --pesize=32768 pv.2 +logvol / --fstype=ext4 --name=lv_root --vgname=vg_vagrant --size=1024 --grow +logvol swap --fstype=swap --name=lv_swap --vgname=vg_vagrant --size=528 --grow --maxsize=1056 +bootloader --location=mbr --append="norhgb net.ifnames=0 biosdevname=0" +services --enabled network +reboot + +%packages +@core + +# Requirements for vagrant +bzip2 +deltarpm +gcc +gcc-c++ +kernel-devel +kernel-headers +make +net-tools +openssl-devel +perl +readline-devel +sqlite-devel +tar +wget +zlib-devel +%end + +%post +# Make ssh quicker in disconnected situations. +echo 'UseDNS no' >> /etc/ssh/sshd_config + +# Disable udev persistent net rules +# We do this so that we do not persist rules mapped to virtual machines +# instances created from this basebox. +ln -s /dev/null /etc/udev/rule.d/70-persistent-net.rules + +# Add Vagrant user and group. +/usr/sbin/groupadd vagrant +/usr/sbin/useradd vagrant -g vagrant +echo "vagrant"|passwd --stdin vagrant + +# Give Vagrant user permission to sudo. +echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant +echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant +chmod 440 /etc/sudoers.d/vagrant + +# Install vagrant authorized ssh key. +mkdir /home/vagrant/.ssh +curl -L 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' > /home/vagrant/.ssh/authorized_keys +chown vagrant:vagrant -R /home/vagrant/.ssh +chmod 700 /home/vagrant/.ssh +chmod 600 /home/vagrant/.ssh/authorized_keys +chcon -R unconfined_u:object_r:user_home_t:s0 /home/vagrant/.ssh +%end diff --git a/templates/Fedora-21-x86_64/puppet.sh b/templates/Fedora-21-x86_64/puppet.sh new file mode 100644 index 00000000..22e76783 --- /dev/null +++ b/templates/Fedora-21-x86_64/puppet.sh @@ -0,0 +1,2 @@ +# Install Puppet +yum -y install puppet facter diff --git a/templates/Fedora-21-x86_64/ruby.sh b/templates/Fedora-21-x86_64/ruby.sh new file mode 100644 index 00000000..9698ed0e --- /dev/null +++ b/templates/Fedora-21-x86_64/ruby.sh @@ -0,0 +1,3 @@ +# Install Ruby +yum -y install ruby ruby-devel rubygems + diff --git a/templates/CentOS-6.5-i386-netboot/vagrant.sh b/templates/Fedora-21-x86_64/vagrant.sh similarity index 100% rename from templates/CentOS-6.5-i386-netboot/vagrant.sh rename to templates/Fedora-21-x86_64/vagrant.sh diff --git a/templates/Fedora-21-x86_64/virtualbox.sh b/templates/Fedora-21-x86_64/virtualbox.sh new file mode 100644 index 00000000..28fd92d0 --- /dev/null +++ b/templates/Fedora-21-x86_64/virtualbox.sh @@ -0,0 +1,4 @@ +# Installing the virtualbox guest additions +mount /dev/sr1 /mnt +sh /mnt/VBoxLinuxAdditions.run +umount /mnt diff --git a/templates/CentOS-6.5-x86_64-netboot/vmfusion.sh b/templates/Fedora-21-x86_64/vmfusion.sh similarity index 50% rename from templates/CentOS-6.5-x86_64-netboot/vmfusion.sh rename to templates/Fedora-21-x86_64/vmfusion.sh index 3bd2e1b2..6be11307 100644 --- a/templates/CentOS-6.5-x86_64-netboot/vmfusion.sh +++ b/templates/Fedora-21-x86_64/vmfusion.sh @@ -1,10 +1,7 @@ -# vmware-vmblock-fuse requires libfuse.so -yum -y install fuse-libs - cd /tmp mkdir -p /mnt/cdrom -mount -o loop /home/veewee/linux.iso /mnt/cdrom +mount -o loop /home/vagrant/linux.iso /mnt/cdrom tar zxf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ /tmp/vmware-tools-distrib/vmware-install.pl -d umount /mnt/cdrom -rm /home/veewee/linux.iso +rm /home/vagrant/linux.iso diff --git a/templates/Fedora-21-x86_64/zerodisk.sh b/templates/Fedora-21-x86_64/zerodisk.sh new file mode 100644 index 00000000..938075a3 --- /dev/null +++ b/templates/Fedora-21-x86_64/zerodisk.sh @@ -0,0 +1,3 @@ +# Zero out the free space to save space in the final image: +dd if=/dev/zero of=/EMPTY bs=1M +rm -f /EMPTY diff --git a/templates/OSX/definition.rb b/templates/OSX/definition.rb index b5c728ab..9694ed6a 100644 --- a/templates/OSX/definition.rb +++ b/templates/OSX/definition.rb @@ -1,6 +1,7 @@ Veewee::Definition.declare({ :cpu_count => '1', :memory_size=> '2048', + :video_memory_size => '32', :disk_size => '40000', :disk_format => 'VDI', :hostiocache => 'off', @@ -27,5 +28,16 @@ "puppet.sh", # Puppet install from Hashicorp's puppet-boostrap repo "fix_user_perms.sh" # some folders in vagrant's got created as root in the above script ], - :postinstall_timeout => "10000" + :postinstall_timeout => "10000", + # For valid `VBoxManage modifyvm` options, see `VBoxManage help modifyvm` or `VBoxManage -h` + :virtualbox => { :vm_options => [ + 'accelerate3d' => 'on', # Enable 3D Acceleration + 'ioapic' => 'on', + 'pae' => 'on', # Enable PAE/NX + 'hwvirtex' => 'on', # Enable VT-x / AMD-V + 'chipset' => 'ich9', # Use ICH9 chipset for motherboard + 'nic1' => 'nat', # Force the first nic to be enabled and attached to NAT + 'firmware' => 'efi', # Need EFI to boot image + 'rtcuseutc' => 'on' # Set hardware clock in UTC + ] } }) diff --git a/templates/OSX/postinstall.sh b/templates/OSX/postinstall.sh index 96841a3e..ee89d4aa 100644 --- a/templates/OSX/postinstall.sh +++ b/templates/OSX/postinstall.sh @@ -4,13 +4,13 @@ OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}') # Install VMware tools if we were built with VMware if [ -e .vmfusion_version ]; then - TMPMOUNT=`/usr/bin/mktemp -d /tmp/vmware-tools.XXXX` - hdiutil attach darwin.iso -mountpoint "$TMPMOUNT" - installer -pkg "$TMPMOUNT/Install VMware Tools.app/Contents/Resources/VMware Tools.pkg" -target / - # This usually fails - hdiutil detach "$TMPMOUNT" - rm -rf "$TMPMOUNT" - rm darwin.iso + TMPMOUNT=`/usr/bin/mktemp -d /tmp/vmware-tools.XXXX` + hdiutil attach darwin.iso -mountpoint "$TMPMOUNT" + installer -pkg "$TMPMOUNT/Install VMware Tools.app/Contents/Resources/VMware Tools.pkg" -target / + # This usually fails + hdiutil detach "$TMPMOUNT" + rm -rf "$TMPMOUNT" + rm darwin.iso fi # Set computer/hostname @@ -21,7 +21,7 @@ scutil --set HostName ${COMPNAME}.vagrantup.com # Installing vagrant keys mkdir /Users/vagrant/.ssh chmod 700 /Users/vagrant/.ssh -curl -k 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' > /Users/vagrant/.ssh/authorized_keys +curl -Lk 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' > /Users/vagrant/.ssh/authorized_keys chmod 600 /Users/vagrant/.ssh/authorized_keys chown -R vagrant /Users/vagrant/.ssh diff --git a/templates/OSX/prepare_veewee_iso/prepare_veewee_iso.sh b/templates/OSX/prepare_veewee_iso/prepare_veewee_iso.sh index db3686c6..f5b6fed7 100755 --- a/templates/OSX/prepare_veewee_iso/prepare_veewee_iso.sh +++ b/templates/OSX/prepare_veewee_iso/prepare_veewee_iso.sh @@ -124,6 +124,39 @@ if [ $? -ne 0 ]; then msg_error "Could not mount $ESD on $MNT_ESD" exit 1 fi +if [ ! -e "$MNT_ESD/System/Library/CoreServices/SystemVersion.plist" ]; then + install_app=$(ls -1 -d "$MNT_ESD/Install OS X"*.app | head -n1) + if [ -n "$install_app" -a -d "$install_app" ]; then + # This might be an install .app inside a dmg + if [ -e "$install_app/Contents/SharedSupport/InstallESD.dmg" ]; then + TOPLVL_ESD="$ESD" + TOPLVL_MNT_ESD="$MNT_ESD" + ESD="$install_app/Contents/SharedSupport/InstallESD.dmg" + + MNT_ESD=`/usr/bin/mktemp -d /tmp/veewee-osx-esd.XXXX` + msg_status "Found an 'Install OS X *.app' file: $install_app" + msg_status "Attaching to OS X installer image with shadow file.." + hdiutil attach "$ESD" -mountpoint "$MNT_ESD" -shadow -nobrowse -owners on + if [ $? -ne 0 ]; then + [ ! -e "$ESD" ] && msg_error "Could not find $ESD in $(pwd)" + msg_error "Could not mount $ESD on $MNT_ESD" + exit 1 + fi + if [ ! -e "$MNT_ESD/System/Library/CoreServices/SystemVersion.plist" ]; then + msg_error "Can't determine OSX version. File not found: $MNT_ESD/System/Library/CoreServices/SystemVersion.plist" + exit 1 + fi + else + msg_error "Can't locate an InstallESD.dmg in this source location $install_app!" + fi + else + msg_error "Can't determine OSX version. File not found: $MNT_ESD/System/Library/CoreServices/SystemVersion.plist" + hdiutil detach "$MNT_ESD" + rm "$ESD.shadow" + rm -rf "$MNT_ESD" + exit 1 + fi +fi DMG_OS_VERS=$(/usr/libexec/PlistBuddy -c 'Print :ProductVersion' "$MNT_ESD/System/Library/CoreServices/SystemVersion.plist") DMG_OS_VERS_MAJOR=$(echo $DMG_OS_VERS | awk -F "." '{print $2}') DMG_OS_BUILD=$(/usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' "$MNT_ESD/System/Library/CoreServices/SystemVersion.plist") @@ -131,6 +164,15 @@ OUTPUT_DMG="$OUT_DIR/OSX_InstallESD_${DMG_OS_VERS}_${DMG_OS_BUILD}.dmg" if [ -e "$OUTPUT_DMG" ]; then msg_error "Output file $OUTPUT_DMG already exists! We're not going to overwrite it, exiting.." hdiutil detach "$MNT_ESD" + if [ -n "$TOPLVL_MNT_ESD" ]; then + hdiutil detach "$TOPLVL_MNT_ESD" + rm "$TOPLVL_ESD.shadow" + rm -rf "$TOPLVL_MNT_ESD" + rm -rf "$MNT_ESD" + else + rm "$ESD.shadow" + rm -rf "$MNT_ESD" + fi exit 1 fi @@ -262,8 +304,15 @@ hdiutil detach "$MNT_ESD" msg_status "Converting to final output file.." hdiutil convert -format UDZO -o "$OUTPUT_DMG" -shadow "$ESD.shadow" "$ESD" -rm "$ESD.shadow" -rm -rf "$MNT_ESD" +if [ -z "$TOPLVL_ESD" ]; then + rm "$ESD.shadow" + rm -rf "$MNT_ESD" +else + hdiutil detach "$TOPLVL_MNT_ESD" + rm "$TOPLVL_ESD.shadow" + rm -rf "$TOPLVL_MNT_ESD" + rm -rf "$MNT_ESD" +fi msg_status "Fixing permissions.." chown -R $VEEWEE_UID:$VEEWEE_GID \ diff --git a/templates/OracleLinux-5.10-i386-DVD/base.sh b/templates/OracleLinux-5.10-i386-DVD/base.sh index 6b96bb0c..d024ad97 100644 --- a/templates/OracleLinux-5.10-i386-DVD/base.sh +++ b/templates/OracleLinux-5.10-i386-DVD/base.sh @@ -4,8 +4,7 @@ source ./proxy.sh sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers -cd /etc/yum.repos.d -wget https://public-yum.oracle.com/public-yum-el5.repo +wget http://public-yum.oracle.com/public-yum-el5.repo -O /etc/yum.repos.d/public-yum-el5.repo cd /tmp wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm @@ -18,9 +17,3 @@ rm -f /tmp/epel-release-5-4.noarch.rpm echo "UseDNS no" >> /etc/ssh/sshd_config sed -i "s/^HOSTNAME=.*/HOSTNAME=oracle.vagrantup.com/" /etc/sysconfig/network - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` \ - kernel-uek-devel-`uname -r` zlib-devel openssl-devel \ - readline-devel sqlite-devel perl wget curl bzip2 dkms - -yum -y update diff --git a/templates/OracleLinux-5.10-i386-DVD/definition.rb b/templates/OracleLinux-5.10-i386-DVD/definition.rb index bb4e858b..030c47cb 100644 --- a/templates/OracleLinux-5.10-i386-DVD/definition.rb +++ b/templates/OracleLinux-5.10-i386-DVD/definition.rb @@ -12,7 +12,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/OracleLinux-5.10-i386-DVD/ks.cfg b/templates/OracleLinux-5.10-i386-DVD/ks.cfg index 23b25934..1c516324 100644 --- a/templates/OracleLinux-5.10-i386-DVD/ks.cfg +++ b/templates/OracleLinux-5.10-i386-DVD/ks.cfg @@ -16,12 +16,32 @@ zerombr clearpart --all --initlabel autopart -auth --useshadow --enablemd5 firstboot --disabled reboot %packages --ignoremissing @core +wget +curl +make +gcc +gcc-c++ +kernel-devel +kernel-uek-devel +kernel-headers +zlib-devel +openssl-devel +readline-devel +sqlite-devel +perl +bzip2 +dkms +net-tools +bind-utils +nfs-utils +bash-completion +deltarpm +yum-utils -ipw2100-firmware -ipw2200-firmware -ivtv-firmware diff --git a/templates/OracleLinux-5.10-i386-DVD/ruby.sh b/templates/OracleLinux-5.10-i386-DVD/ruby.sh index c00d73ab..1659ca10 100644 --- a/templates/OracleLinux-5.10-i386-DVD/ruby.sh +++ b/templates/OracleLinux-5.10-i386-DVD/ruby.sh @@ -2,7 +2,7 @@ source ./proxy.sh -RUBY_VERSION="ruby-1.9.3-p484" +RUBY_VERSION="ruby-1.9.3-p547" RUBY_SOURCE="http://ftp.ruby-lang.org/pub/ruby/1.9/${RUBY_VERSION}.tar.gz" LIBYAML_VERSION="yaml-0.1.5" LIBYAML_SOURCE="http://pyyaml.org/download/libyaml/${LIBYAML_VERSION}.tar.gz" diff --git a/templates/OracleLinux-5.10-x86_64-DVD/base.sh b/templates/OracleLinux-5.10-x86_64-DVD/base.sh index 6b96bb0c..d024ad97 100644 --- a/templates/OracleLinux-5.10-x86_64-DVD/base.sh +++ b/templates/OracleLinux-5.10-x86_64-DVD/base.sh @@ -4,8 +4,7 @@ source ./proxy.sh sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers -cd /etc/yum.repos.d -wget https://public-yum.oracle.com/public-yum-el5.repo +wget http://public-yum.oracle.com/public-yum-el5.repo -O /etc/yum.repos.d/public-yum-el5.repo cd /tmp wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm @@ -18,9 +17,3 @@ rm -f /tmp/epel-release-5-4.noarch.rpm echo "UseDNS no" >> /etc/ssh/sshd_config sed -i "s/^HOSTNAME=.*/HOSTNAME=oracle.vagrantup.com/" /etc/sysconfig/network - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` \ - kernel-uek-devel-`uname -r` zlib-devel openssl-devel \ - readline-devel sqlite-devel perl wget curl bzip2 dkms - -yum -y update diff --git a/templates/OracleLinux-5.10-x86_64-DVD/definition.rb b/templates/OracleLinux-5.10-x86_64-DVD/definition.rb index c3bae73c..a81c49f8 100644 --- a/templates/OracleLinux-5.10-x86_64-DVD/definition.rb +++ b/templates/OracleLinux-5.10-x86_64-DVD/definition.rb @@ -12,7 +12,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/OracleLinux-5.10-x86_64-DVD/ks.cfg b/templates/OracleLinux-5.10-x86_64-DVD/ks.cfg index 23b25934..1c516324 100644 --- a/templates/OracleLinux-5.10-x86_64-DVD/ks.cfg +++ b/templates/OracleLinux-5.10-x86_64-DVD/ks.cfg @@ -16,12 +16,32 @@ zerombr clearpart --all --initlabel autopart -auth --useshadow --enablemd5 firstboot --disabled reboot %packages --ignoremissing @core +wget +curl +make +gcc +gcc-c++ +kernel-devel +kernel-uek-devel +kernel-headers +zlib-devel +openssl-devel +readline-devel +sqlite-devel +perl +bzip2 +dkms +net-tools +bind-utils +nfs-utils +bash-completion +deltarpm +yum-utils -ipw2100-firmware -ipw2200-firmware -ivtv-firmware diff --git a/templates/OracleLinux-5.10-x86_64-DVD/ruby.sh b/templates/OracleLinux-5.10-x86_64-DVD/ruby.sh index c00d73ab..1659ca10 100644 --- a/templates/OracleLinux-5.10-x86_64-DVD/ruby.sh +++ b/templates/OracleLinux-5.10-x86_64-DVD/ruby.sh @@ -2,7 +2,7 @@ source ./proxy.sh -RUBY_VERSION="ruby-1.9.3-p484" +RUBY_VERSION="ruby-1.9.3-p547" RUBY_SOURCE="http://ftp.ruby-lang.org/pub/ruby/1.9/${RUBY_VERSION}.tar.gz" LIBYAML_VERSION="yaml-0.1.5" LIBYAML_SOURCE="http://pyyaml.org/download/libyaml/${LIBYAML_VERSION}.tar.gz" diff --git a/templates/OracleLinux-5.9-i386-DVD/base.sh b/templates/OracleLinux-5.9-i386-DVD/base.sh index 6b96bb0c..d024ad97 100644 --- a/templates/OracleLinux-5.9-i386-DVD/base.sh +++ b/templates/OracleLinux-5.9-i386-DVD/base.sh @@ -4,8 +4,7 @@ source ./proxy.sh sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers -cd /etc/yum.repos.d -wget https://public-yum.oracle.com/public-yum-el5.repo +wget http://public-yum.oracle.com/public-yum-el5.repo -O /etc/yum.repos.d/public-yum-el5.repo cd /tmp wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm @@ -18,9 +17,3 @@ rm -f /tmp/epel-release-5-4.noarch.rpm echo "UseDNS no" >> /etc/ssh/sshd_config sed -i "s/^HOSTNAME=.*/HOSTNAME=oracle.vagrantup.com/" /etc/sysconfig/network - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` \ - kernel-uek-devel-`uname -r` zlib-devel openssl-devel \ - readline-devel sqlite-devel perl wget curl bzip2 dkms - -yum -y update diff --git a/templates/OracleLinux-5.9-i386-DVD/definition.rb b/templates/OracleLinux-5.9-i386-DVD/definition.rb index 24d1867b..ea89b915 100644 --- a/templates/OracleLinux-5.9-i386-DVD/definition.rb +++ b/templates/OracleLinux-5.9-i386-DVD/definition.rb @@ -12,7 +12,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/OracleLinux-5.9-i386-DVD/ks.cfg b/templates/OracleLinux-5.9-i386-DVD/ks.cfg index 23b25934..1c516324 100644 --- a/templates/OracleLinux-5.9-i386-DVD/ks.cfg +++ b/templates/OracleLinux-5.9-i386-DVD/ks.cfg @@ -16,12 +16,32 @@ zerombr clearpart --all --initlabel autopart -auth --useshadow --enablemd5 firstboot --disabled reboot %packages --ignoremissing @core +wget +curl +make +gcc +gcc-c++ +kernel-devel +kernel-uek-devel +kernel-headers +zlib-devel +openssl-devel +readline-devel +sqlite-devel +perl +bzip2 +dkms +net-tools +bind-utils +nfs-utils +bash-completion +deltarpm +yum-utils -ipw2100-firmware -ipw2200-firmware -ivtv-firmware diff --git a/templates/OracleLinux-5.9-i386-DVD/ruby.sh b/templates/OracleLinux-5.9-i386-DVD/ruby.sh index 72dde07e..1659ca10 100644 --- a/templates/OracleLinux-5.9-i386-DVD/ruby.sh +++ b/templates/OracleLinux-5.9-i386-DVD/ruby.sh @@ -2,9 +2,9 @@ source ./proxy.sh -RUBY_VERSION="ruby-1.9.3-p448" +RUBY_VERSION="ruby-1.9.3-p547" RUBY_SOURCE="http://ftp.ruby-lang.org/pub/ruby/1.9/${RUBY_VERSION}.tar.gz" -LIBYAML_VERSION="yaml-0.1.4" +LIBYAML_VERSION="yaml-0.1.5" LIBYAML_SOURCE="http://pyyaml.org/download/libyaml/${LIBYAML_VERSION}.tar.gz" yum install -y readline-devel ncurses-devel gdbm-devel tcl-devel \ diff --git a/templates/OracleLinux-5.9-x86_64-DVD/base.sh b/templates/OracleLinux-5.9-x86_64-DVD/base.sh index 6b96bb0c..d024ad97 100644 --- a/templates/OracleLinux-5.9-x86_64-DVD/base.sh +++ b/templates/OracleLinux-5.9-x86_64-DVD/base.sh @@ -4,8 +4,7 @@ source ./proxy.sh sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers -cd /etc/yum.repos.d -wget https://public-yum.oracle.com/public-yum-el5.repo +wget http://public-yum.oracle.com/public-yum-el5.repo -O /etc/yum.repos.d/public-yum-el5.repo cd /tmp wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm @@ -18,9 +17,3 @@ rm -f /tmp/epel-release-5-4.noarch.rpm echo "UseDNS no" >> /etc/ssh/sshd_config sed -i "s/^HOSTNAME=.*/HOSTNAME=oracle.vagrantup.com/" /etc/sysconfig/network - -yum -y install gcc make gcc-c++ kernel-devel-`uname -r` \ - kernel-uek-devel-`uname -r` zlib-devel openssl-devel \ - readline-devel sqlite-devel perl wget curl bzip2 dkms - -yum -y update diff --git a/templates/OracleLinux-5.9-x86_64-DVD/definition.rb b/templates/OracleLinux-5.9-x86_64-DVD/definition.rb index 6d3e2eeb..8b6d8e86 100644 --- a/templates/OracleLinux-5.9-x86_64-DVD/definition.rb +++ b/templates/OracleLinux-5.9-x86_64-DVD/definition.rb @@ -12,7 +12,7 @@ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg ' ], :kickstart_port => "7122", - :kickstart_timeout => 10000, + :kickstart_timeout => 300, :kickstart_file => "ks.cfg", :ssh_login_timeout => "10000", :ssh_user => "veewee", diff --git a/templates/OracleLinux-5.9-x86_64-DVD/ks.cfg b/templates/OracleLinux-5.9-x86_64-DVD/ks.cfg index 23b25934..1c516324 100644 --- a/templates/OracleLinux-5.9-x86_64-DVD/ks.cfg +++ b/templates/OracleLinux-5.9-x86_64-DVD/ks.cfg @@ -16,12 +16,32 @@ zerombr clearpart --all --initlabel autopart -auth --useshadow --enablemd5 firstboot --disabled reboot %packages --ignoremissing @core +wget +curl +make +gcc +gcc-c++ +kernel-devel +kernel-uek-devel +kernel-headers +zlib-devel +openssl-devel +readline-devel +sqlite-devel +perl +bzip2 +dkms +net-tools +bind-utils +nfs-utils +bash-completion +deltarpm +yum-utils -ipw2100-firmware -ipw2200-firmware -ivtv-firmware diff --git a/templates/OracleLinux-5.9-x86_64-DVD/ruby.sh b/templates/OracleLinux-5.9-x86_64-DVD/ruby.sh index 72dde07e..1659ca10 100644 --- a/templates/OracleLinux-5.9-x86_64-DVD/ruby.sh +++ b/templates/OracleLinux-5.9-x86_64-DVD/ruby.sh @@ -2,9 +2,9 @@ source ./proxy.sh -RUBY_VERSION="ruby-1.9.3-p448" +RUBY_VERSION="ruby-1.9.3-p547" RUBY_SOURCE="http://ftp.ruby-lang.org/pub/ruby/1.9/${RUBY_VERSION}.tar.gz" -LIBYAML_VERSION="yaml-0.1.4" +LIBYAML_VERSION="yaml-0.1.5" LIBYAML_SOURCE="http://pyyaml.org/download/libyaml/${LIBYAML_VERSION}.tar.gz" yum install -y readline-devel ncurses-devel gdbm-devel tcl-devel \ diff --git a/templates/OracleLinux-6.3-x86_64-DVD/definition.rb b/templates/OracleLinux-6.3-x86_64-DVD/definition.rb index 5322f16e..d03b4a81 100644 --- a/templates/OracleLinux-6.3-x86_64-DVD/definition.rb +++ b/templates/OracleLinux-6.3-x86_64-DVD/definition.rb @@ -14,7 +14,7 @@ ' text ks=http://%IP%:%PORT%/ks.cfg