vagrant-hiera 0.1.4 → 0.1.20
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.
- data/README.md +3 -11
- data/lib/vagrant-hiera/config.rb +10 -10
- data/lib/vagrant-hiera/middleware/prepare.rb +1 -0
- data/lib/vagrant-hiera/middleware/setup.rb +1 -1
- data/lib/vagrant-hiera/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -18,18 +18,10 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
Create a [hiera.yaml](https://github.com/puppetlabs/hiera-puppet#module-user) file on your host with the datadir pointing to `/tmp/vagrant-hiera/data`
|
22
|
-
|
23
|
-
:json:
|
24
|
-
:datadir: /var/lib/hiera
|
25
|
-
|
26
21
|
Add the following to your VagrantFile:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
config.hiera.data_path = 'host/path/to/hiera-data'
|
31
|
-
|
32
|
-
And then...
|
22
|
+
config.hiera.config_path = 'path/to/directory/that/contains/configuration'
|
23
|
+
config.hiera.config_file = 'hiera.yaml'
|
24
|
+
config.hiera.data_path = '/path/to/hiera-data'
|
33
25
|
|
34
26
|
`vagrant up`
|
35
27
|
|
data/lib/vagrant-hiera/config.rb
CHANGED
@@ -8,19 +8,19 @@ module VagrantHiera
|
|
8
8
|
attr_accessor :guest_data_path
|
9
9
|
|
10
10
|
def guest_config_path
|
11
|
-
@guest_config_path.nil? ? (@guest_config_path = '/tmp/vagrant-hiera
|
11
|
+
@guest_config_path.nil? ? (@guest_config_path = '/tmp/vagrant-hiera-config') : @guest_config_path
|
12
12
|
end
|
13
13
|
|
14
14
|
def guest_data_path
|
15
|
-
@guest_data_path.nil? ? (@guest_data_path = '/tmp/vagrant-hiera
|
15
|
+
@guest_data_path.nil? ? (@guest_data_path = '/tmp/vagrant-hiera-data') : @guest_data_path
|
16
16
|
end
|
17
17
|
|
18
18
|
def config_path
|
19
|
-
File.
|
19
|
+
File.absolute_path(@config_path)
|
20
20
|
end
|
21
21
|
|
22
22
|
def data_path
|
23
|
-
File.
|
23
|
+
File.absolute_path(@data_path)
|
24
24
|
end
|
25
25
|
|
26
26
|
def set?
|
@@ -28,12 +28,12 @@ module VagrantHiera
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def validate(env, errors)
|
31
|
-
|
32
|
-
errors.add("
|
33
|
-
errors.add("
|
34
|
-
|
35
|
-
|
36
|
-
errors.add("#{data_path} does not exist.") unless File.exists?("#{data_path}")
|
31
|
+
config_file = File.join("#{config_path}", "#{config_file}")
|
32
|
+
errors.add("#{File.new(config_file).absolute_path} does not exist.") unless File.exists? config_file
|
33
|
+
errors.add("#{File.new(data_path).absolute_path} does not exist.") unless File.exists? "#{data_path}"
|
34
|
+
#global_config.vm.share_folder("vagrant-hiera-config", guest_config_path, config_path)
|
35
|
+
#global_config.vm.share_folder("vagrant-hiera-data", guest_data_path, data_path)
|
37
36
|
end
|
37
|
+
|
38
38
|
end
|
39
39
|
end
|
@@ -10,6 +10,7 @@ module VagrantHiera
|
|
10
10
|
def call(env)
|
11
11
|
@env = env
|
12
12
|
if @env[:vm].config.hiera.set?
|
13
|
+
@env[:vm].config.hiera.validate(@env, nil)
|
13
14
|
install_puppet_hiera unless puppet_hiera_installed?
|
14
15
|
create_shared_folders
|
15
16
|
create_symlink_to_hiera_config
|
@@ -39,7 +40,6 @@ module VagrantHiera
|
|
39
40
|
|
40
41
|
def create_symlink_to_hiera_config
|
41
42
|
@env[:ui].info I18n.t('vagrant.plugins.hiera.middleware.setup.installing_hiera_config')
|
42
|
-
@env[:vm].channel.sudo("mkdir -p /etc/puppet")
|
43
43
|
@env[:vm].channel.sudo("ln -fs #{@env[:vm].config.hiera.guest_config_path}/#{@env[:vm].config.hiera.config_file} /etc/puppet/hiera.yaml")
|
44
44
|
end
|
45
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-hiera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: vagrant
|