vagrant-guests-clearlinux 1.0.16 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +65 -23
- data/lib/vagrant-guests-clearlinux/plugin.rb +19 -0
- data/lib/vagrant-guests-clearlinux/provisioner.rb +73 -0
- data/lib/vagrant-guests-clearlinux/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33beb3e70e79076806707599978fe59c6b66f618d5f06da1fb1e07702aba06fd
|
4
|
+
data.tar.gz: f95a9328608a652575e19a81d677a412784c2e84acc94e5302bcc3bd5677d07a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fe2384afda33a4431384252885d178c77be4a34ab048c97e7d30dc63b405e03b5a8eadc23b4f5d41d74e96d8e853d4aa3b151d4d9694f5a4b433dd15262639c
|
7
|
+
data.tar.gz: ad4383fb06fc3f08a5a87fb45b1261a88752ffa78cd91df3a766964b3eefc1ed52d92b89c96b0723d3b866dde72367eea58726e5facea451854cfabbd2457774
|
data/README.md
CHANGED
@@ -1,21 +1,62 @@
|
|
1
|
-
#
|
1
|
+
# **[Plugin](http://docs.vagrantup.com/v2/plugins/index.html)** that adds **[Clear Linux](https://clearlinux.org)** *guest* support to **[Vagrant](http://www.vagrantup.com/)**
|
2
2
|
|
3
|
-
|
4
|
-
[plugin](http://docs.vagrantup.com/v2/plugins/index.html)
|
5
|
-
that adds [Clear Linux](https://clearlinux.org) guest support.
|
6
|
-
Once it gets feature complete and rock solid work will start
|
7
|
-
in order to get its functionality merged in upstream Vagrant.
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/vagrant-guests-clearlinux.svg)](https://badge.fury.io/rb/vagrant-guests-clearlinux)
|
8
4
|
|
9
|
-
|
5
|
+
> Once it gets feature complete and rock solid, and time and resources permit, work will start in
|
6
|
+
> order to get this plugin merged into **[upstream](https://github.com/hashicorp/vagrant)**.
|
10
7
|
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
Currently the plugin exposes the following *guest*
|
9
|
+
**[capabilities](https://www.vagrantup.com/docs/plugins/guest-capabilities.html)** to **Vagrant**:
|
10
|
+
- **[rsync](https://www.vagrantup.com/docs/synced-folders/rsync.html)**
|
11
|
+
- **[NFS](https://www.vagrantup.com/docs/synced-folders/nfs.html)**
|
12
|
+
|
13
|
+
Beyond adding proper **[Clear Linux](https://clearlinux.org)** *guest* support to **Vagrant** this
|
14
|
+
plugin also comes bundled with a simple
|
15
|
+
**[provisioner](https://www.vagrantup.com/docs/provisioning/)** in order to enable basic
|
16
|
+
**[swupd](https://clearlinux.org/documentation/clear-linux/guides/maintenance/swupd-guide)**
|
17
|
+
operations straight from the `Vagrantfile`:
|
18
|
+
|
19
|
+
- adding one or more **[bundles](https://clearlinux.org/documentation/clear-linux/reference/bundles)**
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
config.vm.provision :bundle_add, bundles: 'wireshark'
|
23
|
+
# alternatively ... functionally equivalent to above
|
24
|
+
# config.vm.provision :bundle_add do |p|
|
25
|
+
# p.bundles = 'wireshark'
|
26
|
+
# end
|
27
|
+
```
|
28
|
+
|
29
|
+
- removing one or more **[bundles](https://clearlinux.org/documentation/clear-linux/reference/bundles)**
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
# assuming it was installed already ...
|
33
|
+
config.vm.provision :bundle_remove, bundles: [ 'wireshark', 'nmap' ]
|
34
|
+
# alternatively ... functionally equivalent to above
|
35
|
+
# config.vm.provision :bundle_remove do |p|
|
36
|
+
# p.bundles = ['wireshark', 'nmap']
|
37
|
+
# end
|
38
|
+
```
|
39
|
+
|
40
|
+
## Compatible Vagrant boxes
|
14
41
|
|
15
|
-
|
42
|
+
The **Clear Linux** Vagrant **[boxes](https://app.vagrantup.com/AntonioMeireles/boxes/ClearLinux)** come
|
43
|
+
bundled with this plugin and, in most conditions, should install it automatically.
|
16
44
|
|
45
|
+
For additional information about them please visit their
|
46
|
+
[documentation](https://github.com/AntonioMeireles/ClearLinux-packer/blob/master/README.md).
|
47
|
+
|
48
|
+
### Manual Maintenance
|
49
|
+
|
50
|
+
#### Manual Installation
|
51
|
+
|
52
|
+
```shell
|
53
|
+
❯❯❯ vagrant plugin install vagrant-guests-clearlinux
|
17
54
|
```
|
18
|
-
|
55
|
+
|
56
|
+
### Manual Upgrading
|
57
|
+
|
58
|
+
```shell
|
59
|
+
❯❯❯ vagrant plugin update vagrant-guests-clearlinux
|
19
60
|
```
|
20
61
|
|
21
62
|
## Development
|
@@ -24,28 +65,29 @@ To build, install or modify the plugin directly from this repository:
|
|
24
65
|
|
25
66
|
> NOTE: commands bellow assume you have a working docker environment.
|
26
67
|
|
27
|
-
```
|
28
|
-
|
29
|
-
|
68
|
+
```shell
|
69
|
+
❯❯❯ make build
|
70
|
+
❯❯❯ make local-install VERSION=...
|
30
71
|
```
|
31
72
|
|
32
73
|
where `VERSION` is whatever is being set in `lib/vagrant-guests-clearlinux/version.rb`
|
33
74
|
|
34
75
|
You can run RSpec with:
|
35
76
|
|
36
|
-
```
|
37
|
-
|
38
|
-
|
77
|
+
```shell
|
78
|
+
❯❯❯ bundle install
|
79
|
+
❯❯❯ bundle exec rake
|
39
80
|
```
|
40
81
|
|
41
|
-
##
|
82
|
+
## Feedback
|
42
83
|
|
43
|
-
|
84
|
+
**[Bug Reports and Feature Suggestions](https://github.com/AntonioMeireles/vagrant-guests-clearlinux/issues)**
|
85
|
+
and **[Pull Requests](https://github.com/AntonioMeireles/vagrant-guests-clearlinux/pulls)**. You're welcome!
|
44
86
|
|
45
87
|
## Acknowledgments
|
46
88
|
|
47
|
-
This
|
48
|
-
[vagrant-guests-photon](https://github.com/vmware/vagrant-guests-photon) and
|
89
|
+
This was developed, initially, inspired in works of [Fabio Rapposelli](https://github.com/frapposelli)
|
90
|
+
on [vagrant-guests-photon](https://github.com/vmware/vagrant-guests-photon) and
|
49
91
|
[Alex Sorkin](https://github.com/alexsorkin) on
|
50
|
-
[vagrant-guests-innovitable](https://github.com/alexsorkin/vagrant-guests-innovitable)
|
92
|
+
[vagrant-guests-innovitable](https://github.com/alexsorkin/vagrant-guests-innovitable).
|
51
93
|
|
@@ -9,6 +9,25 @@ module VagrantPlugins
|
|
9
9
|
name 'Clear Linux guest'
|
10
10
|
description 'Clear Linux guest support.'
|
11
11
|
|
12
|
+
config(:bundle_add, :provisioner) do
|
13
|
+
require_relative 'provisioner'
|
14
|
+
BundlesConfig
|
15
|
+
end
|
16
|
+
config(:bundle_remove, :provisioner) do
|
17
|
+
require_relative 'provisioner'
|
18
|
+
BundlesConfig
|
19
|
+
end
|
20
|
+
|
21
|
+
provisioner(:bundle_add) do
|
22
|
+
require_relative 'provisioner'
|
23
|
+
BundleAddProvisioner
|
24
|
+
end
|
25
|
+
|
26
|
+
provisioner(:bundle_remove) do
|
27
|
+
require_relative 'provisioner'
|
28
|
+
BundleRemoveProvisioner
|
29
|
+
end
|
30
|
+
|
12
31
|
guest('clearlinux', 'linux') do
|
13
32
|
require_relative 'guest'
|
14
33
|
Guest
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Copyright (c) 2019 António Meireles. All Rights Reserved.
|
3
|
+
|
4
|
+
require 'vagrant'
|
5
|
+
|
6
|
+
module VagrantPlugins
|
7
|
+
module GuestClearLinux
|
8
|
+
|
9
|
+
class BundlesConfig < Vagrant.plugin('2', :config)
|
10
|
+
attr_accessor :bundles
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
super
|
14
|
+
@bundles = UNSET_VALUE
|
15
|
+
end
|
16
|
+
|
17
|
+
def finalize!
|
18
|
+
@bundles = [] if @bundles == UNSET_VALUE
|
19
|
+
end
|
20
|
+
def bundles=(bundles)
|
21
|
+
if bundles.kind_of?(Array)
|
22
|
+
@bundles = Array.new(bundles)
|
23
|
+
else
|
24
|
+
@bundles = [ bundles ]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class BundleAddProvisioner < Vagrant.plugin('2', :provisioner)
|
30
|
+
def provision
|
31
|
+
@config.bundles.each do | item |
|
32
|
+
@machine.ui.detail("installing '#{item}' bundle")
|
33
|
+
@machine.communicate.sudo("swupd bundle-add '#{item}'") do |type, data|
|
34
|
+
if [:stderr, :stdout].include?(type)
|
35
|
+
color = type == :stdout ? :green : :red
|
36
|
+
|
37
|
+
data = data.chomp
|
38
|
+
return if data.empty?
|
39
|
+
|
40
|
+
options = {}
|
41
|
+
options[:color] = color
|
42
|
+
|
43
|
+
@machine.ui.detail(data.chomp, options)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
class BundleRemoveProvisioner < Vagrant.plugin('2', :provisioner)
|
51
|
+
|
52
|
+
def provision
|
53
|
+
@config.bundles.each do | item |
|
54
|
+
@machine.ui.detail("removing '#{item}' bundle")
|
55
|
+
@machine.communicate.sudo("swupd bundle-remove '#{item}'") do |type, data|
|
56
|
+
if [:stderr, :stdout].include?(type)
|
57
|
+
color = type == :stdout ? :green : :red
|
58
|
+
|
59
|
+
data = data.chomp
|
60
|
+
return if data.empty?
|
61
|
+
|
62
|
+
options = {}
|
63
|
+
options[:color] = color
|
64
|
+
|
65
|
+
@machine.ui.detail(data.chomp, options)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
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.0
|
4
|
+
version: 1.1.0
|
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-
|
11
|
+
date: 2019-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/vagrant-guests-clearlinux/cap/rsync.rb
|
119
119
|
- lib/vagrant-guests-clearlinux/guest.rb
|
120
120
|
- lib/vagrant-guests-clearlinux/plugin.rb
|
121
|
+
- lib/vagrant-guests-clearlinux/provisioner.rb
|
121
122
|
- lib/vagrant-guests-clearlinux/version.rb
|
122
123
|
- spec/cap/change_host_name_spec.rb
|
123
124
|
- spec/cap/configure_networks_spec.rb
|
@@ -144,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
145
|
- !ruby/object:Gem::Version
|
145
146
|
version: '0'
|
146
147
|
requirements: []
|
147
|
-
rubygems_version: 3.0.
|
148
|
+
rubygems_version: 3.0.2
|
148
149
|
signing_key:
|
149
150
|
specification_version: 4
|
150
151
|
summary: Clear Linux Guest Plugin for Vagrant
|