vagrant-hiera 0.1.20 → 0.1.30
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 +11 -3
- data/lib/vagrant-hiera/config.rb +2 -5
- data/lib/vagrant-hiera/middleware/setup.rb +1 -0
- data/lib/vagrant-hiera/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
|
@@ -18,10 +18,18 @@ 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
|
+
|
|
21
26
|
Add the following to your VagrantFile:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
|
|
28
|
+
config.hiera.config_path = 'host/path/to/the/directory/that/contains/hiera.yaml'
|
|
29
|
+
config.hiera.config_file = 'hiera.yaml'
|
|
30
|
+
config.hiera.data_path = 'host/path/to/hiera-data'
|
|
31
|
+
|
|
32
|
+
And then...
|
|
25
33
|
|
|
26
34
|
`vagrant up`
|
|
27
35
|
|
data/lib/vagrant-hiera/config.rb
CHANGED
|
@@ -8,11 +8,11 @@ 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
|
|
@@ -31,9 +31,6 @@ module VagrantHiera
|
|
|
31
31
|
config_file = File.join("#{config_path}", "#{config_file}")
|
|
32
32
|
errors.add("#{File.new(config_file).absolute_path} does not exist.") unless File.exists? config_file
|
|
33
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)
|
|
36
34
|
end
|
|
37
|
-
|
|
38
35
|
end
|
|
39
36
|
end
|
|
@@ -40,6 +40,7 @@ module VagrantHiera
|
|
|
40
40
|
|
|
41
41
|
def create_symlink_to_hiera_config
|
|
42
42
|
@env[:ui].info I18n.t('vagrant.plugins.hiera.middleware.setup.installing_hiera_config')
|
|
43
|
+
@env[:vm].channel.sudo("mkdir -p /etc/puppet")
|
|
43
44
|
@env[:vm].channel.sudo("ln -fs #{@env[:vm].config.hiera.guest_config_path}/#{@env[:vm].config.hiera.config_file} /etc/puppet/hiera.yaml")
|
|
44
45
|
end
|
|
45
46
|
end
|