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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 609fd9b88b16df3d55a99e9f56da98347b77bb1df3dde71fa8f3c288bb3a98a4
4
- data.tar.gz: f2c777e1a75a20009fb1613366e31593e60a45475228e41f14dd68a02e82f81a
3
+ metadata.gz: 33beb3e70e79076806707599978fe59c6b66f618d5f06da1fb1e07702aba06fd
4
+ data.tar.gz: f95a9328608a652575e19a81d677a412784c2e84acc94e5302bcc3bd5677d07a
5
5
  SHA512:
6
- metadata.gz: 0e4fcf59185f259a778552b53f98950e8f1c0cab64b14cc56b91e8496db4e89775fcffd782f0e75c0747516516107ceb673a17aacda1812b40541a32a67656a5
7
- data.tar.gz: 70cacaae979289b26cbe36caee9dfa2fd4a901a887ed7a26042a587edbe452024908737dff8b267d6108c45a1018ec7e3dbddc2272bd4692e2a1cb5a351ed9ec
6
+ metadata.gz: 5fe2384afda33a4431384252885d178c77be4a34ab048c97e7d30dc63b405e03b5a8eadc23b4f5d41d74e96d8e853d4aa3b151d4d9694f5a4b433dd15262639c
7
+ data.tar.gz: ad4383fb06fc3f08a5a87fb45b1261a88752ffa78cd91df3a766964b3eefc1ed52d92b89c96b0723d3b866dde72367eea58726e5facea451854cfabbd2457774
data/README.md CHANGED
@@ -1,21 +1,62 @@
1
- # vagrant-guests-clearlinux
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
- This is a [Vagrant](http://www.vagrantup.com/)
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
- ## Installation
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
- $ vagrant plugin install vagrant-guests-clearlinux
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
- ## Updading
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
- $ vagrant plugin update vagrant-guests-clearlinux
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
- $ make build
29
- $ make local-install VERSION=...
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
- $ bundle install
38
- $ bundle exec rake
77
+ ```shell
78
+ ❯❯❯ bundle install
79
+ ❯❯❯ bundle exec rake
39
80
  ```
40
81
 
41
- ## Compatible Vagrant boxes
82
+ ## Feedback
42
83
 
43
- You can find matching Vagrant boxes on [here](https://app.vagrantup.com/AntonioMeireles/boxes/ClearLinux).
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 started based on early work of [Fabio Rapposelli](https://github.com/frapposelli) on
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
@@ -4,6 +4,6 @@
4
4
  module VagrantPlugins
5
5
  # Set version for vagrant-guests-clearlinux gem.
6
6
  module GuestClearLinux
7
- VERSION = '1.0.16'
7
+ VERSION = '1.1.0'
8
8
  end
9
9
  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.16
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-01-21 00:00:00.000000000 Z
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.1
148
+ rubygems_version: 3.0.2
148
149
  signing_key:
149
150
  specification_version: 4
150
151
  summary: Clear Linux Guest Plugin for Vagrant