veewee 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDY0M2Q2ZDk2NGZkYTY4MzcwY2E3MTFjY2ZiY2ZjNDY5NDc5Yzg2Mg==
4
+ MGYzYTZiOTM2OGM2Nzc3Yjc4NTEyNzhiMjRjMGYyMmQzYTk0OTJlZQ==
5
5
  data.tar.gz: !binary |-
6
- YWQ4ODA1N2QwOGRhZTBhNDZmZGMyOTkyY2RmNDVkYThjYmYwODE0NQ==
6
+ NjdiN2ZkN2QyZGM4YjdiMTk1NGJkMGE4NjdiYWFkYTUzMmE5ZGUxOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzQ3MGQ0OTdiMmJjNDA5ZTEzZWFmMjEwMjE2ZGU5OWU4MTZiZjQ4MjA3OTMx
10
- MDVlNWVhNzExMGMzMjY2ZGMxNjhmNDAxYjBlYWFkMTkzZmJkYTdhOWM4MDhj
11
- ZGUxYjQzNGM3ZGYwYmQ1ZDNlZmE2N2Y4ZDgwN2ZkZWNjYTQ0YTQ=
9
+ YTIwNmFmYzIyYWNkZTgwM2NhZWRlODgzMWZhMTYwYzk4OGQwNjczNTU3YjI1
10
+ NTdjYTBjMTNmNDI3M2Y3MTNjNDA4NzNmMDk2ZjVkOTA2NzczOTFmZDEwYjE4
11
+ OGM1OTdkOTFmMmI4OTE4MGU4YzAxNWY3Y2U1ZDZiYzY5ZTM2YjI=
12
12
  data.tar.gz: !binary |-
13
- NThmYzRkZmU5YjA0OGMyNWM5ZjdlOGQ2NTVhZjgzYjdlZGI2YWYwMjYxZmUz
14
- NDA4OTFiNzI4ZDc5MzQzMDQzM2YxN2FjMDMzNGM2NGQxN2NmNGRlODU0NDNl
15
- Y2NjNjMzZDg2NzkwYWRjOWI1ZTZkZjZiN2ZhNmYzMWI4MzBhNDQ=
13
+ NWIxZWQ5Yzk0MDUzNjk4YzdkNWZkNzVkYzQwMzc5Mjg5ZDE0ODdjOWU4ZWM4
14
+ NzNkMzZlYjBmNmQ1ZTM2M2YwNDAxOTcwMWEyODUwOTcyZGU2ZGI0Y2FlNjRh
15
+ OGI0ZWNmZDdkYjk0ZGY5MTBkZGRmYWE5NjQwYTVhNzQ1NWJjZGE=
@@ -196,7 +196,7 @@ This box will have `pae` and `ioapic` enabled with VirtualBox, and will use the
196
196
 
197
197
  You can store definitions in `*.yml` files, loading them is as easy as:
198
198
 
199
- Veewee::Definition.declare_yaml(file_name1, filename2 ...)
199
+ Veewee::Definition.declare_yaml(filename1, filename2 ...)
200
200
 
201
201
  For example given those 3 files:
202
202
 
@@ -218,6 +218,17 @@ it is possible to mix multiple possible combinations of systems,
218
218
  versions, and architectures. All the configurations available in
219
219
  `declare` are also valid in `*yml` files.
220
220
 
221
+ You can also mix options with file names like:
222
+
223
+ Veewee::Definition.declare_yaml(
224
+ {:cpu_count => '1'},
225
+ filename1,
226
+ {:ssh_user => 'vagrant'},
227
+ filename2,
228
+ ...
229
+ )
230
+
231
+
221
232
  ## Up Next
222
233
 
223
234
  [Veeweefile](veeweefile.md) can be used to define your own paths.
@@ -127,7 +127,13 @@ module Veewee
127
127
 
128
128
  def declare_yaml(*files)
129
129
  files.each do |file|
130
- declare(YAML.load_file(file))
130
+ if Hash === file
131
+ env.logger.info("Reading hash options")
132
+ else
133
+ env.logger.info("Reading yaml file: #{file}")
134
+ file = YAML.load_file(file)
135
+ end
136
+ declare(file)
131
137
  end
132
138
  end
133
139
 
@@ -15,7 +15,7 @@ module Veewee
15
15
 
16
16
  if (options[:interactive]==true)
17
17
  unless host_ip.nil? || host_ip==""
18
- ssh_command="ssh #{ssh_commandline_options(options)} #{host_ip} #{Shellwords.escape command}"
18
+ ssh_command="ssh #{ssh_commandline_options(options)} #{host_ip} #{Shellwords.escape(command) if command}"
19
19
 
20
20
  fg_exec(ssh_command,options)
21
21
 
@@ -43,10 +43,10 @@ module Veewee
43
43
  ]
44
44
  if definition.ssh_key
45
45
  command_options << "-o IdentitiesOnly=yes"
46
- ssh_keys = ssh_key_to_a(ssh_key)
46
+ ssh_keys = ssh_key_to_a(definition.ssh_key)
47
47
  ssh_keys.each do |ssh_keys|
48
48
  # Filenames of SSH keys are relative to their definition
49
- ssh_key = Pathname.new(definition.ssh_key)
49
+ ssh_key = Pathname.new(ssh_keys)
50
50
  ssh_key = File.join(definition.path, ssh_key) if ssh_key.relative?
51
51
  command_options << "-i #{ssh_key}"
52
52
  end
@@ -31,27 +31,6 @@ module Veewee
31
31
 
32
32
  end
33
33
 
34
- private
35
- def winrm_options(options)
36
-
37
- command_options = [
38
- #"-q", #Suppress warning messages
39
- # "-T", #Pseudo-terminal will not be allocated because stdin is not a terminal.
40
- "-p #{winrm_options[:port]}",
41
- "-o UserKnownHostsFile=/dev/null",
42
- "-t -o StrictHostKeyChecking=no",
43
- "-o IdentitiesOnly=yes",
44
- "-o VerifyHostKeyDNS=no"
45
- ]
46
- if !(definition.winrm_key.nil? || definition.winrm_key.length!="")
47
- command_options << "-i #{definition.winrm_key}"
48
- end
49
- commandline_options="#{command_options.join(" ")} ".strip
50
-
51
- user_option=definition.winrm_user.nil? ? "" : "-l #{definition.winrm_user}"
52
-
53
- return "#{commandline_options} #{user_option}"
54
- end
55
34
  end # Module
56
35
  end # Module
57
36
  end # Module
@@ -22,6 +22,17 @@ module Veewee
22
22
  require 'em-winrm'
23
23
  require 'highline'
24
24
 
25
+ def build_winrm_options
26
+ {
27
+ :user => definition.winrm_user,
28
+ :pass => definition.winrm_password,
29
+ :port => definition.winrm_host_port,
30
+ :basic_auth_only => true,
31
+ :timeout => definition.winrm_login_timeout.to_i,
32
+ :operation_timeout => 600 # ten minutes
33
+ }
34
+ end
35
+
25
36
  def winrm_up?(ip,options)
26
37
  begin
27
38
  if not @winrm_up
@@ -0,0 +1,13 @@
1
+ module Veewee
2
+ module Provider
3
+ module Kvm
4
+ module BoxCommand
5
+
6
+ def winrm_options
7
+ build_winrm_options
8
+ end
9
+
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Veewee
2
+ module Provider
3
+ module Parallels
4
+ module BoxCommand
5
+
6
+ def winrm_options
7
+ build_winrm_options
8
+ end
9
+
10
+ end
11
+ end
12
+ end
13
+ end
@@ -4,25 +4,16 @@ module Veewee
4
4
  module BoxCommand
5
5
 
6
6
  def winrm_options
7
- port=definition.winrm_host_port
8
- if self.exists?
9
- forward=self.forwarding("guestwinrm")
10
- unless forward.nil?
11
- port=forward[:host_port]
7
+ build_winrm_options.tap do |options|
8
+ port=definition.winrm_host_port
9
+ if self.exists?
10
+ forward=self.forwarding("guestwinrm")
11
+ unless forward.nil?
12
+ port=forward[:host_port]
13
+ end
12
14
  end
15
+ options[:port] = port
13
16
  end
14
-
15
- winrm_options={
16
- :user => definition.winrm_user,
17
- :pass => definition.winrm_password,
18
- :port => port,
19
- # :port => (port.to_i+1).to_s, # debug, by running charles with a reverse proxy
20
- :basic_auth_only => true,
21
- :timeout => definition.winrm_login_timeout.to_i,
22
- :operation_timeout => 600 # ten minutes
23
- }
24
- return winrm_options
25
-
26
17
  end
27
18
 
28
19
  end
@@ -4,15 +4,7 @@ module Veewee
4
4
  module BoxCommand
5
5
 
6
6
  def winrm_options
7
- winrm_options={
8
- :user => definition.winrm_user,
9
- :pass => definition.winrm_password,
10
- :port => definition.winrm_host_port,
11
- :basic_auth_only => true,
12
- :timeout => definition.winrm_login_timeout.to_i,
13
- :operation_timeout => 600 # ten minutes
14
- }
15
- return winrm_options
7
+ build_winrm_options
16
8
  end
17
9
 
18
10
  end
@@ -4,5 +4,5 @@ end
4
4
 
5
5
  # Only set the version constant if it wasn't set before
6
6
  unless defined?(Veewee::VERSION)
7
- ::Veewee::VERSION="0.4.2"
7
+ ::Veewee::VERSION="0.4.3"
8
8
  end
@@ -0,0 +1,35 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1',
3
+ :memory_size=> '1024',
4
+ :disk_size => '10140',
5
+ :disk_format => 'VDI',
6
+ :hostiocache => 'off',
7
+ :os_type_id => 'Ubuntu',
8
+ :iso_file => "ubuntu-13.04-mini-i386.iso",
9
+ :iso_src => "http://archive.ubuntu.com/ubuntu/dists/raring/main/installer-i386/current/images/netboot/mini.iso",
10
+ :iso_md5 => 'a8f31cd33629c43d711d95bcb21ed9d8',
11
+ :iso_download_timeout => "1000",
12
+ :boot_wait => "4",
13
+ :boot_cmd_sequence => [
14
+ '<Esc><Esc>',
15
+ 'linux vga=788 noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
16
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
17
+ 'hostname=%NAME% ',
18
+ 'fb=false debconf/frontend=noninteractive ',
19
+ 'keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
20
+ 'initrd=initrd.gz -- quiet <Enter>'
21
+ ],
22
+ :kickstart_port => "7122",
23
+ :kickstart_timeout => "10000",
24
+ :kickstart_file => "preseed.cfg",
25
+ :ssh_login_timeout => "10000",
26
+ :ssh_user => "vagrant",
27
+ :ssh_password => "vagrant",
28
+ :ssh_key => "",
29
+ :ssh_host_port => "7222",
30
+ :ssh_guest_port => "22",
31
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
32
+ :shutdown_cmd => "shutdown -P now",
33
+ :postinstall_files => [ "postinstall.sh"],
34
+ :postinstall_timeout => "10000"
35
+ })
@@ -0,0 +1,84 @@
1
+ # postinstall.sh created from Mitchell's official lucid32/64 baseboxes
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+
6
+ # Apt-install various things necessary for Ruby, guest additions,
7
+ # etc., and remove optional things to trim down the machine.
8
+ apt-get -y update
9
+ apt-get -y upgrade
10
+ apt-get -y install linux-headers-$(uname -r) build-essential
11
+ apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
12
+ apt-get -y install wget curl mc p7zip-full
13
+ apt-get clean
14
+
15
+ # Installing the virtualbox guest additions
16
+ apt-get -y install dkms
17
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
18
+ mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
19
+ sh /mnt/VBoxLinuxAdditions.run
20
+ umount /mnt
21
+
22
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
23
+
24
+ cd /tmp
25
+
26
+ echo progress-bar >> /home/vagrant/.curlrc
27
+ chown vagrant:vagrant /home/vagrant/.curlrc
28
+
29
+ # Setup sudo to allow no-password sudo for "admin"
30
+ groupadd -r admin
31
+ usermod -a -G admin vagrant
32
+ cp /etc/sudoers /etc/sudoers.orig
33
+ sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
34
+ sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
35
+
36
+ # Add puppet user and group
37
+ #adduser --system --group --home /var/lib/puppet puppet
38
+
39
+ # Install NFS client
40
+ apt-get -y install nfs-common
41
+
42
+ # Install RVM and Ruby.
43
+ curl -L https://get.rvm.io | bash -s head --ruby
44
+ /etc/profile.d/rvm.sh
45
+ /usr/local/rvm/bin/rvm use ruby --default
46
+ usermod -a -G rvm vagrant
47
+ /usr/local/rvm/bin/gem update --system
48
+ /usr/local/rvm/bin/gem update
49
+
50
+ # Installing chef & Puppet
51
+ /usr/local/rvm/bin/gem install chef --no-ri --no-rdoc
52
+ /usr/local/rvm/bin/gem install puppet --no-ri --no-rdoc
53
+
54
+ # Installing vagrant keys
55
+ mkdir /home/vagrant/.ssh
56
+ chmod 700 /home/vagrant/.ssh
57
+ cd /home/vagrant/.ssh
58
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
59
+ chmod 600 /home/vagrant/.ssh/authorized_keys
60
+ chown -R vagrant /home/vagrant/.ssh
61
+
62
+ # Remove items used for building, since they aren't needed anymore
63
+ apt-get -y remove linux-headers-$(uname -r) build-essential
64
+ apt-get -y autoremove
65
+
66
+ # Zero out the free space to save space in the final image:
67
+ dd if=/dev/zero of=/EMPTY bs=1M
68
+ rm -f /EMPTY
69
+
70
+ # Removing leftover leases and persistent rules
71
+ echo "cleaning up dhcp leases"
72
+ rm /var/lib/dhcp/*
73
+
74
+ # Make sure Udev doesn't block our network
75
+ # http://6.ptmc.org/?p=164
76
+ echo "cleaning up udev rules"
77
+ rm /etc/udev/rules.d/70-persistent-net.rules
78
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
79
+ rm -rf /dev/.udev/
80
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
81
+
82
+ echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
83
+ echo "pre-up sleep 2" >> /etc/network/interfaces
84
+ exit
@@ -0,0 +1,93 @@
1
+ ## Options to set on the command line
2
+ d-i debian-installer/locale string en_US.utf8
3
+ d-i console-setup/ask_detect boolean false
4
+ d-i console-setup/layout string us
5
+
6
+ #d-i netcfg/get_hostname string dummy
7
+ d-i netcfg/get_hostname string unassigned-hostname
8
+ d-i netcfg/get_domain string unassigned-domain
9
+
10
+ # Continue without a default route
11
+ # Not working , specify a dummy in the DHCP
12
+ #d-i netcfg/no_default_route boolean
13
+
14
+ d-i time/zone string UTC
15
+ d-i clock-setup/utc-auto boolean true
16
+ d-i clock-setup/utc boolean true
17
+
18
+ d-i kbd-chooser/method select American English
19
+
20
+ d-i netcfg/wireless_wep string
21
+
22
+ d-i base-installer/kernel/override-image string linux-server
23
+ #d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
24
+
25
+ # Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
26
+ d-i debconf debconf/frontend select Noninteractive
27
+
28
+ d-i pkgsel/install-language-support boolean false
29
+ tasksel tasksel/first multiselect standard, ubuntu-server
30
+
31
+ #d-i partman-auto/method string regular
32
+ d-i partman-auto/method string lvm
33
+ #d-i partman-auto/purge_lvm_from_device boolean true
34
+
35
+ d-i partman-lvm/confirm boolean true
36
+ d-i partman-lvm/device_remove_lvm boolean true
37
+ d-i partman-auto/choose_recipe select atomic
38
+
39
+ d-i partman/confirm_write_new_label boolean true
40
+ d-i partman/confirm_nooverwrite boolean true
41
+ d-i partman/choose_partition select finish
42
+ d-i partman/confirm boolean true
43
+
44
+ #http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
45
+ #Message: "write the changes to disk and configure lvm preseed"
46
+ #http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
47
+ #preseed partman-lvm/confirm_nooverwrite boolean true
48
+
49
+ # Write the changes to disks and configure LVM?
50
+ d-i partman-lvm/confirm boolean true
51
+ d-i partman-lvm/confirm_nooverwrite boolean true
52
+ d-i partman-auto-lvm/guided_size string max
53
+
54
+ ## Default user, we can get away with a recipe to change this
55
+ d-i passwd/user-fullname string vagrant
56
+ d-i passwd/username string vagrant
57
+ d-i passwd/user-password password vagrant
58
+ d-i passwd/user-password-again password vagrant
59
+ d-i user-setup/encrypt-home boolean false
60
+ d-i user-setup/allow-password-weak boolean true
61
+
62
+ ## minimum is puppet and ssh and ntp
63
+ # Individual additional packages to install
64
+ d-i pkgsel/include string openssh-server ntp
65
+
66
+ # Whether to upgrade packages after debootstrap.
67
+ # Allowed values: none, safe-upgrade, full-upgrade
68
+ d-i pkgsel/upgrade select full-upgrade
69
+
70
+ d-i grub-installer/only_debian boolean true
71
+ d-i grub-installer/with_other_os boolean true
72
+ d-i finish-install/reboot_in_progress note
73
+
74
+ #For the update
75
+ d-i pkgsel/update-policy select none
76
+
77
+ # debconf-get-selections --install
78
+ #Use mirror
79
+ #d-i apt-setup/use_mirror boolean true
80
+ #d-i mirror/country string manual
81
+ #choose-mirror-bin mirror/protocol string http
82
+ #choose-mirror-bin mirror/http/hostname string 192.168.4.150
83
+ #choose-mirror-bin mirror/http/directory string /ubuntu
84
+ #choose-mirror-bin mirror/suite select maverick
85
+ #d-i debian-installer/allow_unauthenticated string true
86
+
87
+ choose-mirror-bin mirror/http/proxy string
88
+
89
+ d-i mirror/country string manual
90
+ d-i mirror/http/hostname string archive.ubuntu.com
91
+ d-i mirror/http/directory string /ubuntu
92
+ d-i mirror/proxy string
93
+ d-i mirror/http/mirror select us.archive.ubuntu.com
@@ -37,7 +37,8 @@
37
37
 
38
38
  <UserData>
39
39
  <!-- Product Key from http://technet.microsoft.com/en-us/library/ff793406.aspx -->
40
- <ProductKey>YC6KT-GKW9T-YTKYR-T4X34-R7VHC
40
+ <ProductKey>
41
+ <Key>YC6KT-GKW9T-YTKYR-T4X34-R7VHC</Key>
41
42
  <WillShowUI>Never</WillShowUI>
42
43
  </ProductKey>
43
44
 
@@ -37,7 +37,8 @@
37
37
 
38
38
  <UserData>
39
39
  <!-- Product Key from http://technet.microsoft.com/en-us/library/ff793406.aspx -->
40
- <ProductKey>W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
40
+ <ProductKey>
41
+ <Key>W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9</Key>
41
42
  <WillShowUI>Never</WillShowUI>
42
43
  </ProductKey>
43
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veewee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Debois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-08 00:00:00.000000000 Z
11
+ date: 2014-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -405,6 +405,7 @@ files:
405
405
  - lib/veewee/provider/kvm/box/helper/ip.rb
406
406
  - lib/veewee/provider/kvm/box/helper/ssh_options.rb
407
407
  - lib/veewee/provider/kvm/box/helper/status.rb
408
+ - lib/veewee/provider/kvm/box/helper/winrm_options.rb
408
409
  - lib/veewee/provider/kvm/box/poweroff.rb
409
410
  - lib/veewee/provider/kvm/box/up.rb
410
411
  - lib/veewee/provider/kvm/box/validate_kvm.rb
@@ -421,6 +422,7 @@ files:
421
422
  - lib/veewee/provider/parallels/box/helper/ip.rb
422
423
  - lib/veewee/provider/parallels/box/helper/ssh_options.rb
423
424
  - lib/veewee/provider/parallels/box/helper/status.rb
425
+ - lib/veewee/provider/parallels/box/helper/winrm_options.rb
424
426
  - lib/veewee/provider/parallels/box/poweroff.rb
425
427
  - lib/veewee/provider/parallels/box/ssh.rb
426
428
  - lib/veewee/provider/parallels/box/up.rb
@@ -2093,6 +2095,9 @@ files:
2093
2095
  - templates/ubuntu-12.10-server-i386/definition.rb
2094
2096
  - templates/ubuntu-12.10-server-i386/postinstall.sh
2095
2097
  - templates/ubuntu-12.10-server-i386/preseed.cfg
2098
+ - templates/ubuntu-13.04-minimal-i386-rvm/definition.rb
2099
+ - templates/ubuntu-13.04-minimal-i386-rvm/postinstall.sh
2100
+ - templates/ubuntu-13.04-minimal-i386-rvm/preseed.cfg
2096
2101
  - templates/ubuntu-13.04-server-amd64-rvm/apt.sh
2097
2102
  - templates/ubuntu-13.04-server-amd64-rvm/build_time.sh
2098
2103
  - templates/ubuntu-13.04-server-amd64-rvm/chef.sh