boxes 3.3.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5106c67561b5dbf9b132e8cab7c97b4905ed6478
4
- data.tar.gz: 3ff73aa92235cf4111c4a1241347b4c9bd65d812
2
+ SHA256:
3
+ metadata.gz: b749a9a33b2dda40aad6917ca20448e445bebea00260a9b00dcc4f5f4548ff0d
4
+ data.tar.gz: aec4f6c96166beffb081e7780a60a9d26290c1b4bd85a61f6770c42b8a89c1ba
5
5
  SHA512:
6
- metadata.gz: dfadc3fb89a0f904454b27b66da0ce5aa212bcf0e0c355fdd1ac6aff01b1f9df4d61cb8566b4b9568e38133b6fabf1d703ee1eb22cdcc489e8fc0d7a7fc221cd
7
- data.tar.gz: 472ad770e3022e46af83b5613900eca701263640049daf333547a2fa0fb6398d54ed1dd0eec623c00197f77c506d7bf422007775c7278198ee3c37a094710bd4
6
+ metadata.gz: a98de9c699d352be12dbda5094fa675c5c089ffb41b6abd8b6d1c3dfe1e62771738bd9eb2c4a869eecfe3cf78de81cca3247a3b451c6a2735e0b3f9019c87c57
7
+ data.tar.gz: 27e2ee3e684309739e70945b84799e9c128c492b5a4a0cbceed3ce1fd371875715808a4777ffadaca221cba705504122a14b1934759ac69b1a7a884c24e51d82
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml CHANGED
@@ -352,8 +352,18 @@ Style/TrailingCommaInArguments:
352
352
  - no_comma
353
353
  Enabled: true
354
354
 
355
- Style/TrailingCommaInLiteral:
356
- Description: 'Checks for trailing comma in array and hash literals.'
355
+ Style/TrailingCommaInArrayLiteral:
356
+ Description: 'Checks for trailing comma in array literals.'
357
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
358
+ EnforcedStyleForMultiline: comma
359
+ SupportedStylesForMultiline:
360
+ - comma
361
+ - consistent_comma
362
+ - no_comma
363
+ Enabled: true
364
+
365
+ Style/TrailingCommaInHashLiteral:
366
+ Description: 'Checks for trailing comma in hash literals.'
357
367
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
358
368
  EnforcedStyleForMultiline: comma
359
369
  SupportedStylesForMultiline:
@@ -398,6 +408,13 @@ Layout/AlignParameters:
398
408
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
399
409
  Enabled: false
400
410
 
411
+ Layout/ConditionPosition:
412
+ Description: >-
413
+ Checks for condition placed in a confusing position relative to
414
+ the keyword.
415
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
416
+ Enabled: false
417
+
401
418
  Layout/DotPosition:
402
419
  Description: 'Checks the position of the dot in multi-line method calls.'
403
420
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
@@ -450,13 +467,6 @@ Lint/CircularArgumentReference:
450
467
  Description: "Don't refer to the keyword argument in the default value."
451
468
  Enabled: false
452
469
 
453
- Lint/ConditionPosition:
454
- Description: >-
455
- Checks for condition placed in a confusing position relative to
456
- the keyword.
457
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
458
- Enabled: false
459
-
460
470
  Lint/DeprecatedClassMethods:
461
471
  Description: 'Check for deprecated class method calls.'
462
472
  Enabled: false
@@ -482,7 +492,7 @@ Lint/HandleExceptions:
482
492
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
483
493
  Enabled: false
484
494
 
485
- Lint/LiteralInCondition:
495
+ Lint/LiteralAsCondition:
486
496
  Description: 'Checks of literals used in conditions.'
487
497
  Enabled: false
488
498
 
@@ -523,7 +533,7 @@ Lint/UnderscorePrefixedVariableName:
523
533
  Description: 'Do not use prefix `_` for a variable that is used.'
524
534
  Enabled: false
525
535
 
526
- Lint/UnneededDisable:
536
+ Lint/UnneededCopDisableDirective:
527
537
  Description: >-
528
538
  Checks for rubocop:disable comments that can be removed.
529
539
  Note: this cop is not disabled when disabling all cops.
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.4.2
1
+ ruby-2.5.3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.4.0 (02/12/2018)
4
+
5
+ * Update Debian Stretch ISO to 9.6.0.
6
+ * Update Ubuntu Xenial ISO image to 16.04.4.
7
+ * Update Ubuntu Bionic ISO to 18.04.1.
8
+ * Remove unnecessary thread block.
9
+ * Avoid printing variables which are nil.
10
+
3
11
  ## 3.3.1 (27/04/2018)
4
12
 
5
13
  * Refresh Ubuntu Xenial ISO image. ([55])
@@ -18,14 +18,11 @@ module Boxes
18
18
  Open3.popen3(command) do |_stdin, stdout, stderr, thread|
19
19
  # read each stream from a new thread
20
20
  { out: stdout, err: stderr }.each do |key, stream|
21
- Thread.new do
22
- stream.each_line do |line|
23
- # yield the block depending on the stream
24
- if key == :out
25
- yield line, nil, thread if block_given?
26
- else
27
- yield nil, line, thread if block_given?
28
- end
21
+ stream.each_line do |line|
22
+ if key == :out
23
+ yield line, nil, thread if block_given?
24
+ elsif key == :err
25
+ yield nil, line, thread if block_given?
29
26
  end
30
27
  end
31
28
  end
data/lib/boxes/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Boxes
2
- VERSION = "3.3.1".freeze
2
+ VERSION = "3.4.0".freeze
3
3
  end
@@ -1,4 +1,10 @@
1
- # postinstall.sh based upon Mitchell's old basebox example
1
+ #!/bin/sh
2
+
3
+ ##
4
+ # Post install configuration, preparing the box for usage
5
+ #
6
+ # Originally based upon Mitchell's old basebox example
7
+ ##
2
8
 
3
9
  # mark the build time
4
10
  date > /etc/vagrant_box_build_time
@@ -34,17 +40,55 @@ curl -Lo /home/vagrant/.ssh/authorized_keys \
34
40
  chmod 0600 /home/vagrant/.ssh/authorized_keys
35
41
  chown -R vagrant:vagrant /home/vagrant/.ssh
36
42
 
37
- # under systemd distributions, networking breaks on first reboot
38
- # this is because it's renamed to follow the PCI slot
39
- case $(lsb_release -cs) in
40
- "wily" | "xenial" | "stretch")
41
- sed -i "s/ens33/ens32/g" /etc/network/interfaces
42
- ;;
43
- *)
44
- ;;
45
- esac
43
+ disable_automatic_udev_rules() {
44
+ echo "Disabling automatic udev rules for network interfaces..."
45
+
46
+ # source: http://6.ptmc.org/164/
47
+ rm -f /etc/udev/rules.d/70-persistent-net.rules
48
+ ln -s /dev/null /etc/udev/rules.d/70-persistent-net.rules
49
+ rm -f /lib/udev/rules.d/75-persistent-net-generator.rules
50
+ rm -rf /dev/.udev/ /var/lib/dhcp/*
51
+ }
52
+
53
+ disable_predictable_interface_names() {
54
+ echo "Disabling predictable interface names..."
55
+
56
+ sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces
57
+ sed -ie 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub
58
+ update-grub
59
+ }
60
+
61
+ configure_netplan() {
62
+ echo "Creating DHCP netplan config for eth0..."
63
+
64
+ cat <<-EOF >/etc/netplan/01-netcfg.yaml;
65
+ network:
66
+ version: 2
67
+ ethernets:
68
+ eth0:
69
+ dhcp4: true
70
+ EOF
71
+ }
72
+
73
+ distribution=$(lsb_release -si)
74
+ version=$(lsb_release -sr)
75
+ major_version=$(echo "$version" | awk -F . '{print $1}')
76
+
77
+ if [ "$distribution" = 'Ubuntu' ]; then
78
+ if [ "$major_version" -ge "16" ]; then
79
+ disable_predictable_interface_names
80
+ fi
81
+
82
+ if [ "$major_version" -ge "18" ]; then
83
+ configure_netplan
84
+ fi
85
+ elif [ "$distribution" = 'Debian' ]; then
86
+ if [ "$major_version" -ge "8" ]; then
87
+ disable_predictable_interface_names
88
+ fi
89
+ fi
90
+
91
+ disable_automatic_udev_rules
46
92
 
47
93
  # clean up any artifacts
48
94
  rm -f /home/vagrant/shutdown.sh
49
-
50
- exit
data/scripts/purge.sh CHANGED
@@ -6,25 +6,6 @@
6
6
  # Based on: https://gist.github.com/adrienbrault/3775253
7
7
  ##
8
8
 
9
- # tidy up DCHP leases
10
- echo "Cleaning up dhcp..."
11
- rm /var/lib/dhcp/*
12
-
13
- # make sure Udev doesn't block our network
14
- # except on systemd systems where this isn't used
15
- # http://6.ptmc.org/?p=164
16
- case $(lsb_release -cs) in
17
- "wily" | "xenial")
18
- ;;
19
- *)
20
- echo "Cleaning up udev..."
21
- rm /etc/udev/rules.d/70-persistent-net.rules
22
- mkdir /etc/udev/rules.d/70-persistent-net.rules
23
- rm -rf /dev/.udev/
24
- rm /lib/udev/rules.d/75-persistent-net-generator.rules
25
- ;;
26
- esac
27
-
28
9
  # clean up apt
29
10
  echo "Cleaning up apt..."
30
11
  apt-get -qy autoremove
@@ -1,36 +1,37 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe Boxes::Subprocess do
4
- let(:command) do
5
- File.expand_path("../../support/subprocess_command.sh", __FILE__).
6
- shellescape
7
- end
8
-
9
- it 'runs a command and yields a block' do
4
+ it "runs a command and yields a block" do
10
5
  expect { |b| Boxes::Subprocess.run(command, &b) }.to yield_control
11
6
  end
12
7
 
13
- it 'runs a command and returns stdout' do
14
- total_stdout = ''
8
+ it "runs a command and returns stdout" do
9
+ total_stdout = ""
15
10
  Boxes::Subprocess.run(command) do |stdout, _stderr, _thread|
16
- total_stdout << stdout
11
+ total_stdout << stdout if stdout
17
12
  end
18
13
 
19
14
  expect(total_stdout).to eq "A happy output.\n"
20
15
  end
21
16
 
22
- it 'runs a command and returns stderr' do
23
- total_stderr = ''
17
+ it "runs a command and returns stderr" do
18
+ total_stderr = ""
24
19
  Boxes::Subprocess.run(command) do |_stdout, stderr, _thread|
25
- total_stderr << stderr
20
+ total_stderr << stderr if stderr
26
21
  end
27
22
 
28
23
  expect(total_stderr).to eq "An unhappy output.\n"
29
24
  end
30
25
 
31
- it 'returns a status code' do
26
+ it "returns a status code" do
32
27
  status = Boxes::Subprocess.run(command) { |_stdout, _stderr, _thread| }
33
28
 
34
29
  expect(status.exitstatus).to eq 5
35
30
  end
31
+
32
+ private
33
+
34
+ def command
35
+ File.expand_path("../support/subprocess_command.sh", __dir__).shellescape
36
+ end
36
37
  end
@@ -25,8 +25,8 @@
25
25
  <%- end -%>
26
26
  "headless": true,
27
27
 
28
- "iso_url": "https://cdimage.debian.org/debian-cd/9.4.0/amd64/iso-cd/debian-9.4.0-amd64-netinst.iso",
29
- "iso_checksum": "124d270006703f2111224dec3bf7a9d01450168be41d4834f88fdd035552b044",
28
+ "iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.6.0-amd64-netinst.iso",
29
+ "iso_checksum": "c51d84019c3637ae9d12aa6658ea8c613860c776bd84c6a71eaaf765a0dd60fe",
30
30
  "iso_checksum_type": "sha256",
31
31
 
32
32
  "ssh_username": "vagrant",
@@ -0,0 +1,64 @@
1
+ {
2
+ "provisioners": [
3
+ {
4
+ "type": "shell",
5
+ "scripts": [
6
+ "scripts/postinstall.sh",
7
+ "scripts/vmtools.sh",
8
+ <%- @scripts.each do |script| -%>
9
+ "scripts/<%= script %>",
10
+ <%- end -%>
11
+ "scripts/purge.sh"
12
+ ],
13
+ "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -E -S bash '{{ .Path }}'"
14
+ }
15
+ ],
16
+
17
+ "builders": [
18
+ {
19
+ "name": "<%= @name %>",
20
+ "type": "<%= @provider %>-iso",
21
+ <%- if @provider == "vmware" -%>
22
+ "guest_os_type": "ubuntu-64",
23
+ "tools_upload_flavor": "linux",
24
+ <%- else -%>
25
+ "guest_os_type": "Ubuntu_64",
26
+ <%- end -%>
27
+ "headless": true,
28
+
29
+ "iso_url": "http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.1-server-amd64.iso",
30
+ "iso_checksum": "a5b0ea5918f850124f3d72ef4b85bda82f0fcd02ec721be19c1a6952791c8ee8",
31
+ "iso_checksum_type": "sha256",
32
+
33
+ "ssh_username": "vagrant",
34
+ "ssh_password": "vagrant",
35
+ "ssh_timeout": "15m",
36
+
37
+ "http_directory": "templates/ubuntu",
38
+
39
+ "boot_command": [
40
+ "<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
41
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
42
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
43
+ "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
44
+ "/install/vmlinuz noapic ",
45
+ "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
46
+ "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
47
+ "hostname={{ .Name }} ",
48
+ "fb=false debconf/frontend=noninteractive ",
49
+ "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
50
+ "keyboard-configuration/variant=USA console-setup/ask_detect=false ",
51
+ "grub-installer/bootdev=/dev/sda ",
52
+ "initrd=/install/initrd.gz -- <enter>"
53
+ ],
54
+
55
+ "shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'"
56
+ }
57
+ ],
58
+
59
+ "post-processors": [
60
+ {
61
+ "type": "vagrant"
62
+ }
63
+ ]
64
+ }
@@ -49,7 +49,7 @@ d-i user-setup/encrypt-home boolean false
49
49
  # packages
50
50
  tasksel tasksel/first multiselect standard, ubuntu-server
51
51
  d-i pkgsel/install-language-support boolean false
52
- d-i pkgsel/include string openssh-server nfs-common curl git-core
52
+ d-i pkgsel/include string openssh-server nfs-common curl git-core python
53
53
  d-i pkgsel/upgrade select full-upgrade
54
54
  d-i pkgsel/update-policy select none
55
55
  postfix postfix/main_mailer_type select No configuration
@@ -26,8 +26,8 @@
26
26
  <%- end -%>
27
27
  "headless": true,
28
28
 
29
- "iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.4-server-amd64.iso",
30
- "iso_checksum": "0a03608988cfd2e50567990dc8be96fb3c501e198e2e6efcb846d89efc7b89f2",
29
+ "iso_url": "http://releases.ubuntu.com/xenial/ubuntu-16.04.5-server-amd64.iso",
30
+ "iso_checksum": "c94de1cc2e10160f325eb54638a5b5aa38f181d60ee33dae9578d96d932ee5f8",
31
31
  "iso_checksum_type": "sha256",
32
32
 
33
33
  "ssh_username": "vagrant",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxes
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Charlton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-06 00:00:00.000000000 Z
11
+ date: 2018-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -137,6 +137,7 @@ extra_rdoc_files: []
137
137
  files:
138
138
  - ".gitignore"
139
139
  - ".hound.yml"
140
+ - ".rspec"
140
141
  - ".rubocop.yml"
141
142
  - ".ruby-version"
142
143
  - ".travis.yml"
@@ -197,6 +198,7 @@ files:
197
198
  - templates/debian/preseed.cfg
198
199
  - templates/debian/stretch64.erb
199
200
  - templates/debian/wheezy64.erb
201
+ - templates/ubuntu/bionic64.erb
200
202
  - templates/ubuntu/precise64.erb
201
203
  - templates/ubuntu/preseed.cfg
202
204
  - templates/ubuntu/trusty64.erb
@@ -221,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
223
  version: '0'
222
224
  requirements: []
223
225
  rubyforge_project:
224
- rubygems_version: 2.6.13
226
+ rubygems_version: 2.7.6
225
227
  signing_key:
226
228
  specification_version: 4
227
229
  summary: A command line tool to take the complexity out of building Vagrant boxes.