vagrant-saltdeps 1.0.6 → 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
  SHA1:
3
- metadata.gz: 9a4c4b9157ca427b44fa7426ba6bfefad93aa60f
4
- data.tar.gz: beb135e609501a3a1c0f019dba6e52d51ffabde5
3
+ metadata.gz: 5371e3683e7ec08d696d9cece6dea97e5939f863
4
+ data.tar.gz: 9061cdc8d6df7d9a70fc74d9e70e3ce503e44fb4
5
5
  SHA512:
6
- metadata.gz: 509222d2ba3802e0ec03b85bd51f17cee60dae9507d4d3361582f439a9e82ffbf7fdff1fee3695b2eb1c4489e9a6fdae0bccd2736319585701fa8db8abe79c45
7
- data.tar.gz: 76098f9991ee08dfc5a75a04cc942c27f006a5d4d6668dd8195f8a975cfd9d115b11b52bcaf1e6b456bef66cf4f79126a0f55dc73a6b4fb353dbaa4b8c248727
6
+ metadata.gz: ac52046d59ed1e07828fb87282fd740c5a82564a2b549ce6029bc7742f1df9bbb8b38bfe85966cdc94d7e6b6d68ca93c1fbcd91859b0ee88019ff09e7906d40a
7
+ data.tar.gz: ccd7ae62ccacdc27a490650bd0b8919beb6e314a4a814bb3561e6e0e368d770e12d9432573e3e321b30a6b996038a97d4bda8fc039d4dfbfc8aa3106ed895d33
data/CHANGLOG.md CHANGED
@@ -1,8 +1,13 @@
1
+ ## 1.1.0 (2015-09-21)
2
+
3
+ Base Vagrantfile:
4
+ - you can now configure a `base_vagratfile` git repo that all of your saltdeps projects can inherit from. This allows you to share common configuration. See README for more details.
5
+
1
6
  ## 1.0.6 (2015-04-13)
2
7
 
3
8
  BugFixes:
4
9
  - change require so that case-sensitive filesystems can load the plugin.
5
-
10
+
6
11
  ## 1.0.5 (2015-04-13)
7
12
 
8
13
  BugFixes:
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  GIT
2
2
  remote: https://github.com/mitchellh/vagrant.git
3
- revision: f5ee8b8b7d25883e2715de630e03dcb550da3958
3
+ revision: 45ab5b4dc5f1860f4ad143f81b31fe4eaadf18f0
4
4
  specs:
5
- vagrant (1.7.2)
6
- bundler (>= 1.5.2, < 1.8.0)
5
+ vagrant (1.7.4)
6
+ bundler (>= 1.5.2, <= 1.10.5)
7
7
  childprocess (~> 0.5.0)
8
8
  erubis (~> 2.7.0)
9
9
  hashicorp-checkpoint (~> 0.1.1)
10
10
  i18n (>= 0.6.0, <= 0.8.0)
11
- listen (~> 2.8.0)
11
+ listen (~> 3.0.2)
12
12
  log4r (~> 1.1.9, < 1.1.11)
13
13
  net-scp (~> 1.1.0)
14
14
  net-sftp (~> 2.1)
@@ -18,12 +18,12 @@ GIT
18
18
  rest-client (>= 1.6.0, < 2.0)
19
19
  wdm (~> 0.1.0)
20
20
  winrm (~> 1.3)
21
- winrm-fs (~> 0.1.0)
21
+ winrm-fs (~> 0.2.2)
22
22
 
23
23
  PATH
24
24
  remote: .
25
25
  specs:
26
- vagrant-saltdeps (1.0.2)
26
+ vagrant-saltdeps (1.1.0)
27
27
  activesupport (= 4.1.10)
28
28
  git (~> 1.2)
29
29
 
@@ -37,40 +37,36 @@ GEM
37
37
  thread_safe (~> 0.1)
38
38
  tzinfo (~> 1.1)
39
39
  builder (3.2.2)
40
- celluloid (0.16.0)
41
- timers (~> 4.0.0)
42
- childprocess (0.5.5)
40
+ childprocess (0.5.6)
43
41
  ffi (~> 1.0, >= 1.0.11)
44
42
  diff-lcs (1.2.5)
45
- domain_name (0.5.23)
43
+ domain_name (0.5.24)
46
44
  unf (>= 0.0.5, < 1.0.0)
47
45
  erubis (2.7.0)
48
- ffi (1.9.8)
46
+ ffi (1.9.10)
49
47
  git (1.2.9.1)
50
48
  gssapi (1.2.0)
51
49
  ffi (>= 1.0.1)
52
- gyoku (1.2.3)
50
+ gyoku (1.3.1)
53
51
  builder (>= 2.1.2)
54
52
  hashicorp-checkpoint (0.1.4)
55
- hitimes (1.2.2)
56
53
  http-cookie (1.0.2)
57
54
  domain_name (~> 0.5)
58
55
  httpclient (2.6.0.1)
59
56
  i18n (0.7.0)
60
- json (1.8.2)
61
- listen (2.8.6)
62
- celluloid (>= 0.15.2)
57
+ json (1.8.3)
58
+ listen (3.0.3)
63
59
  rb-fsevent (>= 0.9.3)
64
60
  rb-inotify (>= 0.9)
65
- little-plugger (1.1.3)
61
+ little-plugger (1.1.4)
66
62
  log4r (1.1.10)
67
63
  logging (1.8.2)
68
64
  little-plugger (>= 1.1.3)
69
65
  multi_json (>= 1.8.4)
70
- mime-types (2.4.3)
66
+ mime-types (2.6.2)
71
67
  mini_portile (0.6.0)
72
- minitest (5.5.1)
73
- multi_json (1.11.0)
68
+ minitest (5.8.0)
69
+ multi_json (1.11.2)
74
70
  net-scp (1.1.2)
75
71
  net-ssh (>= 2.6.5)
76
72
  net-sftp (2.1.2)
@@ -79,12 +75,12 @@ GEM
79
75
  netrc (0.10.3)
80
76
  nokogiri (1.6.3.1)
81
77
  mini_portile (= 0.6.0)
82
- nori (2.4.0)
78
+ nori (2.6.0)
83
79
  rake (10.4.2)
84
- rb-fsevent (0.9.4)
80
+ rb-fsevent (0.9.6)
85
81
  rb-inotify (0.9.5)
86
82
  ffi (>= 0.5.0)
87
- rb-kqueue (0.2.3)
83
+ rb-kqueue (0.2.4)
88
84
  ffi (>= 0.5.0)
89
85
  rest-client (1.8.0)
90
86
  http-cookie (>= 1.0.2, < 2.0)
@@ -106,16 +102,14 @@ GEM
106
102
  rubyntlm (0.4.0)
107
103
  rubyzip (1.1.7)
108
104
  thread_safe (0.3.5)
109
- timers (4.0.1)
110
- hitimes
111
105
  tzinfo (1.2.2)
112
106
  thread_safe (~> 0.1)
113
107
  unf (0.1.4)
114
108
  unf_ext
115
- unf_ext (0.0.6)
109
+ unf_ext (0.0.7.1)
116
110
  uuidtools (2.1.5)
117
- wdm (0.1.0)
118
- winrm (1.3.0)
111
+ wdm (0.1.1)
112
+ winrm (1.3.4)
119
113
  builder (>= 2.1.2)
120
114
  gssapi (~> 1.2)
121
115
  gyoku (~> 1.0)
@@ -124,7 +118,7 @@ GEM
124
118
  nori (~> 2.0)
125
119
  rubyntlm (~> 0.4.0)
126
120
  uuidtools (~> 2.1.2)
127
- winrm-fs (0.1.0)
121
+ winrm-fs (0.2.2)
128
122
  erubis (~> 2.7)
129
123
  logging (~> 1.6, >= 1.6.1)
130
124
  rubyzip (~> 1.1)
@@ -138,3 +132,6 @@ DEPENDENCIES
138
132
  rspec (~> 3.2)
139
133
  vagrant!
140
134
  vagrant-saltdeps!
135
+
136
+ BUNDLED WITH
137
+ 1.10.3
data/README.md CHANGED
@@ -36,9 +36,9 @@ deps:
36
36
  * **name** - The name of your current formula, and the folder in the same directory as the Vagrantfile where your salt state data exists. This also determines the name of the folder created in `/srv/salt`
37
37
  * **deps** - A list of dependencies for your formula
38
38
  * **apache** - In this example we are telling saltdeps that we expect a folder in this repo with our salt states to be called apache. This also determins the folder names that saltdeps creates
39
- * **git** - The git repo to checkout from. Currently only git ssh protocol is supported.
39
+ * **git** - The git repo to checkout from. Currently only git ssh protocol is supported.
40
40
  * **branch** - The branch of the dependent fromula you would like to check out
41
-
41
+
42
42
  After defining a saltdeps.yml file you must configure your Vagrantfile. You should put the vagrant-saltdeps provisioner before your salt provisioner since it touches the salt provisioner configuration.
43
43
 
44
44
  ```
@@ -61,6 +61,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
61
61
 
62
62
  if Vagrant.has_plugin?("vagrant-saltdeps")
63
63
  config.vm.provision :saltdeps do |deps|
64
+ deps.base_vagrantfile = "ssh://git@github.com/jhughes/vagrant-base.git"
64
65
  deps.checkout_path = "./.vagrant-salt/deps"
65
66
  deps.deps_path = "./.vagrant-salt/saltdeps.yml"
66
67
  end
@@ -100,6 +101,7 @@ This project exposes a few configuration options so you can decide the best way
100
101
  * **merge_pillars** - Tells saltdeps if it should merge your dependent pillars into one file. Defaults to `true`.
101
102
  * **merge_grains** - Tells saltdeps if it should merge your dependent grains into one file. Defaults to `true`.
102
103
  * **merge_path** - Path where saltdeps should put the results of the merged pillars and grains files. Defaults to `.vagrant-salt/compiled_grains` and `.vagrant-salt/compiled_pillars`.
104
+ * **base_vagrantfile** - This defines a git repo that has a single `Vagrantfile` in the root of the repository. This Vagrantfile is loaded before the Vagrantfile in the root of the project. The intention here is to allow for common configuration to be shared between salt formula. Any settings in the base Vagrantfile can be overridden with the Vagrantfile in your salt formula repository. The goal is to reduce the number of edits you have to do across the Vagranfiles in your different formulas.
103
105
 
104
106
 
105
107
  ## Development
@@ -0,0 +1,45 @@
1
+ require 'git'
2
+ module Vagrant
3
+ module Saltdeps
4
+ class Action
5
+ def initialize(app, env)
6
+ @app = app
7
+ end
8
+
9
+ def call(env)
10
+ base_vagrantfile = ''
11
+ checkout_path = ''
12
+ config_loader = env[:env].config_loader
13
+
14
+ v = Vagrantfile.new(config_loader, [:home,:root])
15
+ v.config.vm.provisioners.each do |provisioner|
16
+ if provisioner.config.class.to_s == 'VagrantPlugins::Saltdeps::Config::Provisioner'
17
+ base_vagrantfile = provisioner.config.base_vagrantfile
18
+ checkout_path = provisioner.config.checkout_path
19
+ end
20
+ end
21
+
22
+ if base_vagrantfile != Vagrant::Plugin::V2::Config.const_get(:UNSET_VALUE)
23
+ uri = base_vagrantfile
24
+ name = "base-vagrantfile"
25
+ branch = 'master'
26
+
27
+ if File.directory? checkout_path + "/#{name}"
28
+ g = Git.open checkout_path + "/#{name}"
29
+ else
30
+ g = Git.clone(uri, name, path: checkout_path)
31
+ end
32
+ begin
33
+ g.checkout(branch)
34
+ g.pull
35
+ rescue Git::GitExecuteError => e
36
+ raise GitCheckoutError.new :branch => branch, :message => e.message
37
+ end
38
+
39
+ config_loader.set(:base_vagrantfile, "#{checkout_path}/#{name}/Vagrantfile")
40
+ env[:env].instance_variable_set(:@vagrantfile, Vagrantfile.new(config_loader, [:home, :base_vagrantfile, :root]))
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,64 @@
1
+ module VagrantPlugins
2
+ module Saltdeps
3
+ module Config
4
+ class Provisioner < Vagrant.plugin('2', :config)
5
+ attr_accessor :checkout_path
6
+ attr_accessor :deps_path
7
+ attr_accessor :grains_path
8
+ attr_accessor :pillars_path
9
+ attr_accessor :merge_pillars
10
+ attr_accessor :merge_grains
11
+ attr_accessor :merged_path
12
+ attr_accessor :base_vagrantfile
13
+
14
+ def initialize
15
+ super
16
+ @machine = nil
17
+ @checkout_path = UNSET_VALUE
18
+ @deps_path = '.vagrant-salt/saltdeps.yml'
19
+ @grains_path = UNSET_VALUE
20
+ @pillars_path = UNSET_VALUE
21
+ @merge_pillars = UNSET_VALUE
22
+ @merge_grains = UNSET_VALUE
23
+ @merged_path = UNSET_VALUE
24
+ @base_vagrantfile = UNSET_VALUE
25
+ end
26
+
27
+ def validate(machine)
28
+ @machine = machine
29
+ errors = _detected_errors
30
+ if @checkout_path
31
+ Pathname.new(@checkout_path).expand_path(machine.env.root_path)
32
+ else
33
+ @checkout_path = '.saltdeps'
34
+ Pathname.new(@checkout_path).expand_path(machine.env.root_path)
35
+ end
36
+
37
+ expand(@grains_path, errors)
38
+ expand(@pillars_path, errors)
39
+
40
+
41
+ return {"salt provisioner" => errors}
42
+ end
43
+
44
+ def finalize!
45
+ @grains_path = '.vagrant-salt/grains' if @grains_path == UNSET_VALUE
46
+ @pillars_path = '.vagrant-salt/pillars' if @pillars_path == UNSET_VALUE
47
+ @merged_path = '.vagrant-salt' if @merged_path == UNSET_VALUE
48
+
49
+ @merge_grains = true if @merge_grains == UNSET_VALUE
50
+ @merge_pillars = true if @merge_pillars == UNSET_VALUE
51
+ end
52
+
53
+ private
54
+
55
+ def expand(path, errors=[], check=false)
56
+ expanded = Pathname.new(path).expand_path(@machine.env.root_path)
57
+ if check && !expanded.file?
58
+ errors << "The file at #{expanded} does not exist. Please give a valid path to your saltdeps.yml file."
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -18,13 +18,17 @@ module VagrantPlugins
18
18
  This plugin manages salt formula dependencies.
19
19
  DESC
20
20
 
21
+ action_hook :basevagrant, :environment_load do |hook|
22
+ require_relative './action.rb'
23
+ hook.prepend(Vagrant::Saltdeps::Action)
24
+ end
25
+
21
26
  config(:saltdeps, :provisioner) do
22
- require File.expand_path("../config", __FILE__)
23
- Config
27
+ require File.expand_path("../config/provisioner", __FILE__)
28
+ Config::Provisioner
24
29
  end
25
30
 
26
31
  provisioner(:saltdeps) do
27
-
28
32
  # Return the provider
29
33
  require File.expand_path("../provisioner", __FILE__)
30
34
  Provisioner
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Saltdeps
3
- VERSION = '1.0.6'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-saltdeps
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Hughes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -82,7 +82,8 @@ files:
82
82
  - README.md
83
83
  - Rakefile
84
84
  - lib/vagrant-saltdeps.rb
85
- - lib/vagrant-saltdeps/config.rb
85
+ - lib/vagrant-saltdeps/action.rb
86
+ - lib/vagrant-saltdeps/config/provisioner.rb
86
87
  - lib/vagrant-saltdeps/errors.rb
87
88
  - lib/vagrant-saltdeps/plugin.rb
88
89
  - lib/vagrant-saltdeps/provisioner.rb
@@ -109,9 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
110
  version: '0'
110
111
  requirements: []
111
112
  rubyforge_project:
112
- rubygems_version: 2.2.2
113
+ rubygems_version: 2.4.5
113
114
  signing_key:
114
115
  specification_version: 4
115
116
  summary: Manages vagrant salt dependencies
116
117
  test_files: []
117
- has_rdoc:
@@ -1,64 +0,0 @@
1
- module VagrantPlugins
2
- module Saltdeps
3
- class Config < Vagrant.plugin('2', :config)
4
- attr_accessor :checkout_path
5
- attr_accessor :deps_path
6
- attr_accessor :grains_path
7
- attr_accessor :pillars_path
8
- attr_accessor :merge_pillars
9
- attr_accessor :merge_grains
10
- attr_accessor :merged_path
11
-
12
- def initialize
13
- super
14
- @machine = nil
15
- @checkout_path = UNSET_VALUE
16
- @deps_path = UNSET_VALUE
17
- @grains_path = UNSET_VALUE
18
- @pillars_path = UNSET_VALUE
19
- @merge_pillars = UNSET_VALUE
20
- @merge_grains = UNSET_VALUE
21
- @merged_path = UNSET_VALUE
22
- end
23
-
24
- def validate(machine)
25
- @machine = machine
26
- errors = _detected_errors
27
- if @checkout_path
28
- Pathname.new(@checkout_path).expand_path(machine.env.root_path)
29
- else
30
- @checkout_path = '.saltdeps'
31
- Pathname.new(@checkout_path).expand_path(machine.env.root_path)
32
- end
33
-
34
- expand(@deps_path, errors, true)
35
- expand(@grains_path, errors)
36
- expand(@pillars_path, errors)
37
-
38
-
39
- return {"salt provisioner" => errors}
40
- end
41
-
42
- def finalize!
43
- @deps_path = expand('.vagrant-salt/saltdeps.yml') if @deps_path == UNSET_VALUE
44
- @grains_path = '.vagrant-salt/grains' if @grains_path == UNSET_VALUE
45
- @pillars_path = '.vagrant-salt/pillars' if @pillars_path == UNSET_VALUE
46
- @merged_path = '.vagrant-salt' if @merged_path == UNSET_VALUE
47
-
48
- @merge_grains = true if @merge_grains == UNSET_VALUE
49
- @merge_pillars = true if @merge_pillars == UNSET_VALUE
50
- end
51
-
52
- private
53
-
54
- def expand(path, errors=[], check=false)
55
- expanded = Pathname.new(@deps_path).expand_path(@machine.env.root_path)
56
- if check && !expanded.file?
57
- errors << "The file at #{expanded} does not exist. Please give a valid path to your saltdeps.yml file."
58
- end
59
- end
60
-
61
-
62
- end
63
- end
64
- end