vagrant-dotvm 0.30.0 → 0.31.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
2
  SHA1:
3
- metadata.gz: a6d538d3645fe69b4fda9fc292f0fdaafb222cbf
4
- data.tar.gz: 4c25a64b1472dd6636f6b180872cf381e6751c48
3
+ metadata.gz: acc52b4f98f4aa98e7693a14a72fb982f7ee4c6a
4
+ data.tar.gz: 869ed4c1f28ce6bf71297322027d01b316ac0820
5
5
  SHA512:
6
- metadata.gz: c3e851140912f7c3ad8372dc94477d595d7d578ff42ccefafef1fb7278aa23d0223a919ec63788b850f60b6430e6396c46f0f906227a64ef34d6fa16e1737799
7
- data.tar.gz: 202f8824f810364eea87a4a08778c32be19e3c64595445d2dd323b65d6bbaca48b982b3652cb2cd76a0de2491655633cde48ca7a7f7120415c3da3b3a8b36d72
6
+ metadata.gz: 2c48a592dc80dc609e7188ff8a1e397b29c5fe59ec51bcfc079a44aba888e224f15ec6a6662103c72f4e841edaa86a281ed719f5c847909043793274e4b52dd5
7
+ data.tar.gz: 633e6bcf76edec1a5c768a0807952a64d4afa07650ba45252fe6d297b457af78470085ac58804459dfaae153c7eb902b92bc314b91104d5d5a144bff85a3c83f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.31.0
2
+ * Authorized keys and hosts were broken. It has been fixed.
3
+ * Docker provision
4
+
1
5
  # 0.30.0
2
6
  * Ability to set pillar data
3
7
 
data/lib/vagrant-dotvm.rb CHANGED
@@ -3,6 +3,7 @@ require 'yaml'
3
3
 
4
4
  require 'vagrant-dotvm/plugin'
5
5
  require 'vagrant-dotvm/version'
6
+ require 'vagrant-dotvm/pathes'
6
7
  require 'vagrant-dotvm/dotvm'
7
8
 
8
9
  require 'vagrant-dotvm/injector/root'
@@ -24,3 +25,5 @@ require 'vagrant-dotvm/config/sharedfolder'
24
25
  require 'vagrant-dotvm/config/option'
25
26
  require 'vagrant-dotvm/config/route'
26
27
  require 'vagrant-dotvm/config/network'
28
+ require 'vagrant-dotvm/config/buildimage'
29
+ require 'vagrant-dotvm/config/run'
@@ -0,0 +1,10 @@
1
+ module VagrantPlugins
2
+ module Dotvm
3
+ module Config
4
+ class BuildImage < AbstractConfig
5
+ attr_accessor :image
6
+ attr_accessor :args
7
+ end
8
+ end
9
+ end
10
+ end
@@ -122,6 +122,35 @@ module VagrantPlugins
122
122
  attr_accessor :recipes # chef
123
123
  attr_accessor :roles # chef
124
124
  attr_accessor :pillar
125
+
126
+ attr_accessor :images
127
+ attr_accessor :build_images
128
+ attr_accessor :runs
129
+
130
+ def initialize
131
+ @build_images = []
132
+ @runs = []
133
+ end
134
+
135
+ def populate_build_images(data)
136
+ raise "'build_images' must be array." unless data.kind_of?(Array) || data.kind_of?(NilClass)
137
+
138
+ data.to_a.each do |conf|
139
+ item = BuildImage.new
140
+ item.populate conf
141
+ @build_images << item
142
+ end
143
+ end
144
+
145
+ def populate_runs(data)
146
+ raise "'runs' must be array." unless data.kind_of?(Array) || data.kind_of?(NilClass)
147
+
148
+ data.to_a.each do |conf|
149
+ item = Run.new
150
+ item.populate conf
151
+ @runs << item
152
+ end
153
+ end
125
154
  end
126
155
  end
127
156
  end
@@ -0,0 +1,15 @@
1
+ module VagrantPlugins
2
+ module Dotvm
3
+ module Config
4
+ class Run < AbstractConfig
5
+ attr_accessor :name
6
+ attr_accessor :image
7
+ attr_accessor :cmd
8
+ attr_accessor :args
9
+ attr_accessor :auto_assign_name
10
+ attr_accessor :daemonize
11
+ attr_accessor :restart
12
+ end
13
+ end
14
+ end
15
+ end
@@ -10,7 +10,7 @@ module VagrantPlugins
10
10
  end
11
11
 
12
12
  machine.vm.provision "shell" do |s|
13
- s.path = File.dirname(__FILE__) + "/../../utils/authorize_key.sh"
13
+ s.path = "#{UTILS_PATH}/authorize_key.sh"
14
14
  s.args = [pubkey]
15
15
  s.privileged = false
16
16
  end
@@ -4,7 +4,7 @@ module VagrantPlugins
4
4
  class Host
5
5
  def self.inject(host: nil, machine: nil)
6
6
  machine.vm.provision "shell", run: "always" do |s|
7
- s.path = File.dirname(__FILE__) + "/../../utils/add_host.sh"
7
+ s.path = "#{UTILS_PATH}/add_host.sh"
8
8
  s.args = [host.ip, host.host]
9
9
  s.privileged = true
10
10
  end
@@ -119,6 +119,16 @@ module VagrantPlugins
119
119
  :delete_node,
120
120
  :delete_client,
121
121
  :recipe,
122
+ :images,
123
+ ]
124
+
125
+ RUNS_OPTIONS = [
126
+ :image,
127
+ :cmd,
128
+ :args,
129
+ :auto_assign_name,
130
+ :daemonize,
131
+ :restart,
122
132
  ]
123
133
 
124
134
  public
@@ -138,6 +148,22 @@ module VagrantPlugins
138
148
  end
139
149
 
140
150
  p.pillar provision_cfg.pillar unless provision_cfg.pillar.nil?
151
+
152
+ provision_cfg.build_images.to_a.each do |image|
153
+ args = {}
154
+ args[:args] = image.args unless image.args.nil?
155
+ p.build_image image.image, **args
156
+ end
157
+
158
+ provision_cfg.runs.to_a.each do |run|
159
+ args = {}
160
+ RUNS_OPTIONS.each do |opt|
161
+ val = run.send(opt)
162
+ args[opt] = val unless val.nil?
163
+ end
164
+
165
+ p.run run.name, **args
166
+ end
141
167
  end
142
168
  end
143
169
  end
@@ -4,7 +4,7 @@ module VagrantPlugins
4
4
  class Route
5
5
  def self.inject(route: nil, machine: nil)
6
6
  machine.vm.provision "shell", run: "always" do |s|
7
- s.path = File.dirname(__FILE__) + "/../../../utils/setup_route.sh"
7
+ s.path = "#{UTILS_PATH}/setup_route.sh"
8
8
  s.args = [route.destination, route.gateway]
9
9
  s.privileged = true
10
10
  end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module Dotvm
3
+ UTILS_PATH = File.dirname(__FILE__) + "/../../utils"
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Dotvm
3
- VERSION = "0.30.0"
3
+ VERSION = "0.31.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-dotvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Magosa
@@ -62,6 +62,7 @@ files:
62
62
  - lib/vagrant-dotvm.rb
63
63
  - lib/vagrant-dotvm/config/abstractconfig.rb
64
64
  - lib/vagrant-dotvm/config/authorizedkey.rb
65
+ - lib/vagrant-dotvm/config/buildimage.rb
65
66
  - lib/vagrant-dotvm/config/host.rb
66
67
  - lib/vagrant-dotvm/config/machine.rb
67
68
  - lib/vagrant-dotvm/config/network.rb
@@ -69,6 +70,7 @@ files:
69
70
  - lib/vagrant-dotvm/config/provision.rb
70
71
  - lib/vagrant-dotvm/config/root.rb
71
72
  - lib/vagrant-dotvm/config/route.rb
73
+ - lib/vagrant-dotvm/config/run.rb
72
74
  - lib/vagrant-dotvm/config/sharedfolder.rb
73
75
  - lib/vagrant-dotvm/dotvm.rb
74
76
  - lib/vagrant-dotvm/injector/authorizedkey.rb
@@ -79,6 +81,7 @@ files:
79
81
  - lib/vagrant-dotvm/injector/root.rb
80
82
  - lib/vagrant-dotvm/injector/route.rb
81
83
  - lib/vagrant-dotvm/injector/sharedfolder.rb
84
+ - lib/vagrant-dotvm/pathes.rb
82
85
  - lib/vagrant-dotvm/plugin.rb
83
86
  - lib/vagrant-dotvm/version.rb
84
87
  - utils/add_host.sh