vagrant-guests-clearlinux 1.1.3 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant-guests-clearlinux.rb +0 -1
- data/lib/vagrant-guests-clearlinux/cap/change_host_name.rb +5 -6
- data/lib/vagrant-guests-clearlinux/cap/configure_networks.rb +9 -8
- data/lib/vagrant-guests-clearlinux/cap/nfs_client.rb +8 -5
- data/lib/vagrant-guests-clearlinux/cap/rsync.rb +2 -2
- data/lib/vagrant-guests-clearlinux/guest.rb +0 -1
- data/lib/vagrant-guests-clearlinux/plugin.rb +7 -3
- data/lib/vagrant-guests-clearlinux/provisioner.rb +14 -21
- data/lib/vagrant-guests-clearlinux/version.rb +1 -2
- data/spec/cap/configure_networks_spec.rb +48 -49
- data/spec/guest_spec.rb +1 -2
- data/spec/plugin_spec.rb +2 -3
- data/spec/spec_helper.rb +6 -7
- data/vagrant-guests-clearlinux.gemspec +1 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5faae4f77c23af96be0409500baccac750bbeb6190ffe4bc35fbe5e167d2916
|
4
|
+
data.tar.gz: ff619c6fc79786ae0128699c045168dae3bfc5333ca8fd411a559a2a3303b672
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d9c8be0da64353edf8bbeded78a6e1e0047c936cbed953066b284dc23e8550dcfc6d85c1ecd0a4f96b47fefccb859657313707d850073f63fec839d218070b1
|
7
|
+
data.tar.gz: a986025f005f51b2554c2599d91b0200fc92eb0ae762ce7d0a87ad41d2d2aea5d8b17f49106e76b7f674c6106244b470e3705f92fc8f6d01cbf61280431dce63
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# Copyright (c) 2018 António Meireles. All Rights Reserved.
|
3
2
|
|
4
3
|
module VagrantPlugins
|
@@ -9,13 +8,13 @@ module VagrantPlugins
|
|
9
8
|
machine.communicate.tap do |comm|
|
10
9
|
unless comm.test("hostnamectl --static | grep '#{name}'")
|
11
10
|
comm.sudo([
|
12
|
-
|
13
|
-
|
11
|
+
'rm /etc/machine-id',
|
12
|
+
'systemd-machine-id-setup',
|
14
13
|
"hostnamectl set-hostname --static '#{name}'",
|
15
14
|
"hostnamectl set-hostname --transient '#{name}'",
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
'hostnamectl set-hostname --set-chassis vm',
|
16
|
+
'systemctl restart systemd-networkd.service'
|
17
|
+
].join("\n"))
|
19
18
|
end
|
20
19
|
end
|
21
20
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# Copyright (c) 2018 António Meireles. All Rights Reserved.
|
3
2
|
|
4
3
|
require 'tempfile'
|
@@ -30,7 +29,7 @@ module VagrantPlugins
|
|
30
29
|
class ConfigureNetworks
|
31
30
|
include Vagrant::Util
|
32
31
|
extend Vagrant::Util::GuestInspection::Linux
|
33
|
-
NETWORKD_DIRECTORY =
|
32
|
+
NETWORKD_DIRECTORY = '/etc/systemd/network'.freeze
|
34
33
|
@@logger = Log4r::Logger.new('vagrant::guest::clearlinux::configure_networks')
|
35
34
|
|
36
35
|
def self.configure_networks(machine, networks)
|
@@ -43,16 +42,16 @@ module VagrantPlugins
|
|
43
42
|
@@logger.warn("Could not find match rule for network #{network.inspect}")
|
44
43
|
next
|
45
44
|
end
|
46
|
-
unit_name = format('50-vagrant
|
45
|
+
unit_name = format('50-vagrant-%<device>s.network', device: device)
|
47
46
|
|
48
47
|
if network[:type] == :static
|
49
|
-
leased =
|
48
|
+
leased = 'no'
|
50
49
|
cidr = IPAddr.new(network[:netmask]).to_cidr
|
51
50
|
body = "Address=#{network[:ip]}/#{cidr}"
|
52
51
|
body += "\nGateway=#{network[:gateway]}" if network[:gateway]
|
53
52
|
elsif network[:type] == :dhcp
|
54
|
-
leased =
|
55
|
-
body =
|
53
|
+
leased = 'yes'
|
54
|
+
body = ''
|
56
55
|
end
|
57
56
|
|
58
57
|
unit_file = format(VAGRANT_NETWORK, device, leased, body)
|
@@ -62,12 +61,14 @@ module VagrantPlugins
|
|
62
61
|
temp.close
|
63
62
|
|
64
63
|
comm.upload(temp.path, "/tmp/#{unit_name}")
|
65
|
-
comm.sudo([
|
64
|
+
comm.sudo([
|
65
|
+
"mkdir -p #{NETWORKD_DIRECTORY}",
|
66
66
|
"rm -f #{NETWORKD_DIRECTORY}/#{unit_name}",
|
67
67
|
"mv /tmp/#{unit_name} #{NETWORKD_DIRECTORY}",
|
68
68
|
"chown root:root #{NETWORKD_DIRECTORY}/#{unit_name}",
|
69
69
|
"chmod a+r #{NETWORKD_DIRECTORY}/#{unit_name}",
|
70
|
-
|
70
|
+
'systemctl restart systemd-networkd'
|
71
|
+
].join(' && '))
|
71
72
|
comm.wait_for_ready(30)
|
72
73
|
end
|
73
74
|
end
|
@@ -3,16 +3,19 @@ module VagrantPlugins
|
|
3
3
|
module Cap
|
4
4
|
class NFS
|
5
5
|
def self.nfs_client_installed(machine)
|
6
|
-
machine.communicate.test(
|
6
|
+
machine.communicate.test('test -x /usr/bin/mount.nfs')
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.nfs_client_install(machine)
|
10
10
|
comm = machine.communicate
|
11
11
|
comm.sudo([
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
'swupd bundle-add nfs-utils',
|
13
|
+
'systemctl enable rpcbind --now'
|
14
|
+
].join(' && '))
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.nfs_pre(machine)
|
18
|
+
machine.communicate.sudo('systemctl start rpcbind')
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
@@ -3,12 +3,12 @@ module VagrantPlugins
|
|
3
3
|
module Cap
|
4
4
|
class RSync
|
5
5
|
def self.rsync_installed(machine)
|
6
|
-
machine.communicate.test(
|
6
|
+
machine.communicate.test('test -f /usr/bin/rsync')
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.rsync_install(machine)
|
10
10
|
# until it is available as a pundle...
|
11
|
-
machine.communicate.sudo(
|
11
|
+
machine.communicate.sudo('swupd bundle-add network-basic')
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# Copyright (c) 2018 António Meireles. All Rights Reserved.
|
3
2
|
|
4
3
|
require 'vagrant'
|
@@ -61,13 +60,18 @@ module VagrantPlugins
|
|
61
60
|
Cap::NFS
|
62
61
|
end
|
63
62
|
|
63
|
+
guest_capability('clearlinux', 'nfs_pre') do
|
64
|
+
require_relative 'cap/nfs_client'
|
65
|
+
Cap::NFS
|
66
|
+
end
|
67
|
+
|
64
68
|
guest_capability(:clearlinux, :rsync_install) do
|
65
|
-
require_relative
|
69
|
+
require_relative 'cap/rsync'
|
66
70
|
Cap::RSync
|
67
71
|
end
|
68
72
|
|
69
73
|
guest_capability(:clearlinux, :rsync_installed) do
|
70
|
-
require_relative
|
74
|
+
require_relative 'cap/rsync'
|
71
75
|
Cap::RSync
|
72
76
|
end
|
73
77
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# Copyright (c) 2019 António Meireles. All Rights Reserved.
|
3
2
|
|
4
3
|
require 'vagrant'
|
@@ -6,9 +5,8 @@ require 'tzinfo'
|
|
6
5
|
|
7
6
|
module VagrantPlugins
|
8
7
|
module GuestClearLinux
|
9
|
-
|
10
8
|
class BundlesConfig < Vagrant.plugin('2', :config)
|
11
|
-
|
9
|
+
attr_reader :bundles
|
12
10
|
|
13
11
|
def initialize
|
14
12
|
super
|
@@ -18,12 +16,13 @@ module VagrantPlugins
|
|
18
16
|
def finalize!
|
19
17
|
@bundles = [] if @bundles == UNSET_VALUE
|
20
18
|
end
|
19
|
+
|
21
20
|
def bundles=(bundles)
|
22
|
-
if bundles.
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
@bundles = if bundles.is_a?(Array)
|
22
|
+
bundles.join(' ')
|
23
|
+
else
|
24
|
+
bundles
|
25
|
+
end
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
@@ -40,19 +39,15 @@ module VagrantPlugins
|
|
40
39
|
@timezone = '' if @timezone == UNSET_VALUE
|
41
40
|
end
|
42
41
|
|
43
|
-
def validate(
|
42
|
+
def validate(_machine)
|
44
43
|
errors = _detected_errors
|
45
44
|
|
46
45
|
TZInfo::Timezone.get(timezone)
|
47
|
-
{
|
46
|
+
{ 'vm.provision.set_timezone:' => errors }
|
48
47
|
rescue TZInfo::InvalidTimezoneIdentifier
|
49
|
-
errors <<
|
48
|
+
errors << "Invalid (user provided) timezone: '#{timezone}', Aborting!"
|
50
49
|
|
51
|
-
{
|
52
|
-
end
|
53
|
-
|
54
|
-
def timezone=(timezone)
|
55
|
-
@timezone = timezone
|
50
|
+
{ 'vm.provision.set_timezone:' => errors }
|
56
51
|
end
|
57
52
|
end
|
58
53
|
|
@@ -60,7 +55,7 @@ module VagrantPlugins
|
|
60
55
|
def provision
|
61
56
|
@machine.ui.detail("setting (user provided) timezone to '#{@config.timezone}'")
|
62
57
|
@machine.communicate.sudo("timedatectl set-timezone #{@config.timezone}") do |type, data|
|
63
|
-
if [
|
58
|
+
if %i[stderr stdout].include?(type)
|
64
59
|
color = type == :stdout ? :green : :red
|
65
60
|
|
66
61
|
options = {}
|
@@ -76,7 +71,7 @@ module VagrantPlugins
|
|
76
71
|
def provision
|
77
72
|
@machine.ui.detail("installing the following bundle(s): '#{@config.bundles}'")
|
78
73
|
@machine.communicate.sudo("swupd bundle-add #{@config.bundles}") do |type, data|
|
79
|
-
if [
|
74
|
+
if %i[stderr stdout].include?(type)
|
80
75
|
color = type == :stdout ? :green : :red
|
81
76
|
|
82
77
|
options = {}
|
@@ -89,11 +84,10 @@ module VagrantPlugins
|
|
89
84
|
end
|
90
85
|
|
91
86
|
class BundleRemoveProvisioner < Vagrant.plugin('2', :provisioner)
|
92
|
-
|
93
87
|
def provision
|
94
88
|
@machine.ui.detail("removing the following bundle(s): '#{@config.bundles}'")
|
95
89
|
@machine.communicate.sudo("swupd bundle-remove #{@config.bundles}") do |type, data|
|
96
|
-
if [
|
90
|
+
if %i[stderr stdout].include?(type)
|
97
91
|
color = type == :stdout ? :green : :red
|
98
92
|
|
99
93
|
options = {}
|
@@ -104,6 +98,5 @@ module VagrantPlugins
|
|
104
98
|
end
|
105
99
|
end
|
106
100
|
end
|
107
|
-
|
108
101
|
end
|
109
102
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# Copyright (c) 2018 António Meireles. All Rights Reserved.
|
3
2
|
|
4
3
|
require 'vagrant-guests-ClearLinux/cap/configure_networks'
|
@@ -21,9 +20,9 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
|
|
21
20
|
# config.vm.network :private_network, type: "dhcp"
|
22
21
|
{
|
23
22
|
:type => :dhcp,
|
24
|
-
:adapter_ip =>
|
25
|
-
:ip =>
|
26
|
-
:netmask =>
|
23
|
+
:adapter_ip => '172.28.128.1',
|
24
|
+
:ip => '172.28.128.1',
|
25
|
+
:netmask => '255.255.255.0',
|
27
26
|
:auto_config => true,
|
28
27
|
:interface => 2
|
29
28
|
},
|
@@ -36,10 +35,10 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
|
|
36
35
|
},
|
37
36
|
# config.vm.network :public_network, bridge: "en0: Wi-Fi (AirPort)", ip: "192.168.1.201"
|
38
37
|
{
|
39
|
-
:type
|
40
|
-
:bridge =>
|
41
|
-
:ip =>
|
42
|
-
:netmask =>
|
38
|
+
:type => :static,
|
39
|
+
:bridge => 'en0: Wi-Fi (AirPort)',
|
40
|
+
:ip => '192.168.1.201',
|
41
|
+
:netmask => '255.255.255.0',
|
43
42
|
:use_dhcp_assigned_default_route => false,
|
44
43
|
:auto_config => true,
|
45
44
|
:interface => 4
|
@@ -50,7 +49,7 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
|
|
50
49
|
|
51
50
|
before do
|
52
51
|
communicate.stub(:sudo).with("ifconfig -a | grep -E '^enp|^eth' | cut -f1 -d' '")
|
53
|
-
|
52
|
+
.and_yield(nil, interfaces)
|
54
53
|
end
|
55
54
|
|
56
55
|
it 'should configure networks' do
|
@@ -58,65 +57,65 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
|
|
58
57
|
|
59
58
|
# enp0s8
|
60
59
|
communicate.should_receive(:sudo).with("grep enp0s8 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
|
61
|
-
communicate.should_receive(:sudo).with(
|
60
|
+
communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-enp0s8.network')
|
62
61
|
communicate.should_receive(:upload) do |src, dst|
|
63
|
-
contents = (File.readlines src).join(
|
62
|
+
contents = (File.readlines src).join('')
|
64
63
|
contents.should eq "[Match]\nName=enp0s8\n\n[Network]\nAddress=192.168.10.10/24\n"
|
65
|
-
dst.should eq
|
64
|
+
dst.should eq '/tmp/50-vagrant-enp0s8.network'
|
66
65
|
end
|
67
66
|
communicate.should_receive(:sudo)
|
68
|
-
|
67
|
+
.with('mv /tmp/50-vagrant-enp0s8.network /etc/systemd/network/')
|
69
68
|
communicate.should_receive(:sudo)
|
70
|
-
|
69
|
+
.with('chown root:root /etc/systemd/network/50-vagrant-enp0s8.network')
|
71
70
|
communicate.should_receive(:sudo)
|
72
|
-
|
71
|
+
.with('chmod a+r /etc/systemd/network/50-vagrant-enp0s8.network')
|
73
72
|
|
74
73
|
# eth2
|
75
74
|
communicate.should_receive(:sudo).with("grep eth2 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
|
76
|
-
communicate.should_receive(:sudo).with(
|
75
|
+
communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-eth2.network')
|
77
76
|
communicate.should_receive(:upload) do |src, dst|
|
78
|
-
contents = (File.readlines src).join(
|
77
|
+
contents = (File.readlines src).join('')
|
79
78
|
contents.should eq "[Match]\nName=eth2\n\n[Network]\nDHCP=yes\n"
|
80
|
-
dst.should eq
|
79
|
+
dst.should eq '/tmp/50-vagrant-eth2.network'
|
81
80
|
end
|
82
81
|
communicate.should_receive(:sudo)
|
83
|
-
|
82
|
+
.with('mv /tmp/50-vagrant-eth2.network /etc/systemd/network/')
|
84
83
|
communicate.should_receive(:sudo)
|
85
|
-
|
84
|
+
.with('chown root:root /etc/systemd/network/50-vagrant-eth2.network')
|
86
85
|
communicate.should_receive(:sudo)
|
87
|
-
|
86
|
+
.with('chmod a+r /etc/systemd/network/50-vagrant-eth2.network')
|
88
87
|
|
89
88
|
# enp1s5
|
90
89
|
communicate.should_receive(:sudo).with("grep enp1s5 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
|
91
|
-
communicate.should_receive(:sudo).with(
|
90
|
+
communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-enp1s5.network')
|
92
91
|
communicate.should_receive(:upload) do |src, dst|
|
93
|
-
contents = (File.readlines src).join(
|
92
|
+
contents = (File.readlines src).join('')
|
94
93
|
contents.should eq "[Match]\nName=enp1s5\n\n[Network]\nDHCP=yes\n"
|
95
|
-
dst.should eq
|
94
|
+
dst.should eq '/tmp/50-vagrant-enp1s5.network'
|
96
95
|
end
|
97
96
|
communicate.should_receive(:sudo)
|
98
|
-
|
97
|
+
.with('mv /tmp/50-vagrant-enp1s5.network /etc/systemd/network/')
|
99
98
|
communicate.should_receive(:sudo)
|
100
|
-
|
99
|
+
.with('chown root:root /etc/systemd/network/50-vagrant-enp1s5.network')
|
101
100
|
communicate.should_receive(:sudo)
|
102
|
-
|
101
|
+
.with('chmod a+r /etc/systemd/network/50-vagrant-enp1s5.network')
|
103
102
|
|
104
103
|
# enp1s6
|
105
104
|
communicate.should_receive(:sudo).with("grep enp1s6 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
|
106
|
-
communicate.should_receive(:sudo).with(
|
105
|
+
communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-enp1s6.network')
|
107
106
|
communicate.should_receive(:upload) do |src, dst|
|
108
|
-
contents = (File.readlines src).join(
|
107
|
+
contents = (File.readlines src).join('')
|
109
108
|
contents.should eq "[Match]\nName=enp1s6\n\n[Network]\nAddress=192.168.1.201/24\n"
|
110
|
-
dst.should eq
|
109
|
+
dst.should eq '/tmp/50-vagrant-enp1s6.network'
|
111
110
|
end
|
112
111
|
communicate.should_receive(:sudo)
|
113
|
-
|
112
|
+
.with('mv /tmp/50-vagrant-enp1s6.network /etc/systemd/network/')
|
114
113
|
communicate.should_receive(:sudo)
|
115
|
-
|
114
|
+
.with('chown root:root /etc/systemd/network/50-vagrant-enp1s6.network')
|
116
115
|
communicate.should_receive(:sudo)
|
117
|
-
|
116
|
+
.with('chmod a+r /etc/systemd/network/50-vagrant-enp1s6.network')
|
118
117
|
|
119
|
-
communicate.should_receive(:sudo).with(
|
118
|
+
communicate.should_receive(:sudo).with('systemctl restart systemd-networkd.service')
|
120
119
|
|
121
120
|
described_class.configure_networks(machine, networks)
|
122
121
|
end
|
@@ -136,9 +135,9 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
|
|
136
135
|
# config.vm.network :private_network, type: "dhcp"
|
137
136
|
{
|
138
137
|
:type => :dhcp,
|
139
|
-
:adapter_ip =>
|
140
|
-
:ip =>
|
141
|
-
:netmask =>
|
138
|
+
:adapter_ip => '172.28.128.1',
|
139
|
+
:ip => '172.28.128.1',
|
140
|
+
:netmask => '255.255.255.0',
|
142
141
|
:auto_config => true,
|
143
142
|
:interface => 2
|
144
143
|
}
|
@@ -148,36 +147,36 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
|
|
148
147
|
|
149
148
|
before do
|
150
149
|
communicate.stub(:sudo).with("ifconfig -a | grep -E '^enp|^eth' | cut -f1 -d' '")
|
151
|
-
|
152
|
-
@@logger = Log4r::Logger.new(
|
150
|
+
.and_yield(nil, interfaces)
|
151
|
+
@@logger = Log4r::Logger.new('vagrant::guest::clearlinux::configure_networks')
|
153
152
|
end
|
154
153
|
|
155
154
|
it 'should configure networks without enp0s9' do
|
156
155
|
communicate.should_receive(:sudo).with("ifconfig -a | grep -E '^enp|^eth' | cut -f1 -d' '")
|
157
156
|
communicate.should_receive(:sudo).with("grep enp0s8 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
|
158
|
-
communicate.should_receive(:sudo).with(
|
157
|
+
communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-enp0s8.network')
|
159
158
|
|
160
159
|
# enp0s8
|
161
160
|
communicate.should_receive(:upload) do |src, dst|
|
162
|
-
contents = (File.readlines src).join(
|
161
|
+
contents = (File.readlines src).join('')
|
163
162
|
contents.should eq "[Match]\nName=enp0s8\n\n[Network]\nAddress=192.168.10.10/24\n"
|
164
|
-
dst.should eq
|
163
|
+
dst.should eq '/tmp/50-vagrant-enp0s8.network'
|
165
164
|
end
|
166
165
|
communicate.should_receive(:sudo)
|
167
|
-
|
166
|
+
.with('mv /tmp/50-vagrant-enp0s8.network /etc/systemd/network/')
|
168
167
|
communicate.should_receive(:sudo)
|
169
|
-
|
168
|
+
.with('chown root:root /etc/systemd/network/50-vagrant-enp0s8.network')
|
170
169
|
communicate.should_receive(:sudo)
|
171
|
-
|
170
|
+
.with('chmod a+r /etc/systemd/network/50-vagrant-enp0s8.network')
|
172
171
|
|
173
172
|
# eth2
|
174
173
|
@@logger.should_receive(:warn).with(
|
175
|
-
|
176
|
-
|
177
|
-
|
174
|
+
'Could not find match rule for network ' \
|
175
|
+
'{:type=>:dhcp, :adapter_ip=>"172.28.128.1", :ip=>"172.28.128.1", ' \
|
176
|
+
':netmask=>"255.255.255.0", :auto_config=>true, :interface=>2}'
|
178
177
|
)
|
179
178
|
|
180
|
-
communicate.should_receive(:sudo).with(
|
179
|
+
communicate.should_receive(:sudo).with('systemctl restart systemd-networkd.service')
|
181
180
|
|
182
181
|
described_class.configure_networks(machine, networks)
|
183
182
|
end
|
data/spec/guest_spec.rb
CHANGED
data/spec/plugin_spec.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# Copyright (c) 2018 António Meireles. All Rights Reserved.
|
3
2
|
|
4
3
|
require 'spec_helper'
|
@@ -12,8 +11,8 @@ describe VagrantPlugins::GuestClearLinux::Plugin do
|
|
12
11
|
end
|
13
12
|
|
14
13
|
{
|
15
|
-
:change_host_name
|
16
|
-
:configure_networks
|
14
|
+
:change_host_name => VagrantPlugins::GuestClearLinux::Cap::ChangeHostName,
|
15
|
+
:configure_networks => VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks
|
17
16
|
}.each do |cap, cls|
|
18
17
|
it "should be capable of #{cap} with ClearLinux" do
|
19
18
|
expect(described_class.components.guest_capabilities[:clearlinux][cap]).to eq(cls)
|
data/spec/spec_helper.rb
CHANGED
@@ -1,18 +1,17 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# Copyright (c) 2018 António Meireles. All Rights Reserved.
|
3
2
|
|
4
3
|
require 'coveralls'
|
5
4
|
Coveralls.wear!
|
6
5
|
|
7
6
|
shared_context 'machine' do
|
8
|
-
let(:communicate)
|
7
|
+
let(:communicate) do
|
9
8
|
double('communicate')
|
10
|
-
|
11
|
-
let(:machine)
|
9
|
+
end
|
10
|
+
let(:machine) do
|
12
11
|
v = double('machine')
|
13
12
|
v.tap { |m| m.stub(:communicate).and_return(communicate) }
|
14
|
-
|
15
|
-
let(:guest)
|
13
|
+
end
|
14
|
+
let(:guest) do
|
16
15
|
described_class.new
|
17
|
-
|
16
|
+
end
|
18
17
|
end
|
@@ -1,6 +1,5 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# Copyright (c) 2018-2019 António Meireles. All Rights Reserved.
|
3
|
-
$LOAD_PATH.unshift File.expand_path('
|
2
|
+
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
|
4
3
|
require 'vagrant-guests-clearlinux/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-guests-clearlinux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- António Meireles
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.0.
|
176
|
+
rubygems_version: 3.0.3
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Clear Linux Guest Plugin for Vagrant
|