vagrant-orchestrate 0.1.1 → 0.2.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: f4f003fe2e9ff1f79c05fdb94187ca3f9957950a
4
- data.tar.gz: dd89457152b3cb5240932e40f5163fc182e22887
3
+ metadata.gz: fc05a7ce791712848c4eabc6b1f2dac74818bc87
4
+ data.tar.gz: 3f54e38bd2bfb9f57b2f55b6a9fa8ddc2ab4fb39
5
5
  SHA512:
6
- metadata.gz: cee9ce03f28e452395afbe716422ccfb87994655a38c333f62ae277a5edf08f6a1b54466c6daac37a0ebc00d2194cc29b04fe68d723d0927796b01c1617ff7d0
7
- data.tar.gz: 4f669963f2a2b23a58fd4a2cc9bdd3df5094c0ba3d843d20fbb387ab82609316e0b525c110cc652e5324c9613b80959f1d6b47791c22744940050b24022f962f
6
+ metadata.gz: 286c92e818750020924142d1c5a7f6fde14d8848481c3b7cfe2a9189485548780a5962333be77fb2a58902131464f19716023f3ff2a90407dc8162006d82a7ea
7
+ data.tar.gz: 45ad7a0068ae502e3de3bc76934119b967b0120e81c3f6e2052884efa95ac55603fda57693c6c6865c1f100fde45d8154164cc397593eb4c6aab9de869fdba92
@@ -103,24 +103,27 @@ module VagrantPlugins
103
103
  return unless argv
104
104
 
105
105
  if options[:provisioners].include? "puppet"
106
+ FileUtils.mkdir_p(File.join(@env.cwd, "puppet"))
106
107
  if options[:puppet_librarian_puppet]
107
108
  contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/puppet/Puppetfile"))
108
- write_file "Puppetfile", contents, options
109
- FileUtils.mkdir_p(File.join(@env.cwd, "modules"))
110
- write_file(File.join(@env.cwd, "modules", ".gitignore"), "*", options)
109
+ write_file File.join("puppet", "Puppetfile"), contents, options
110
+ FileUtils.mkdir_p(File.join(@env.cwd, "puppet", "modules"))
111
+ write_file(File.join(@env.cwd, "puppet", "modules", ".gitignore"), "*", options)
111
112
  options[:plugins] << "vagrant-librarian-puppet"
112
113
  end
113
114
 
114
115
  if options[:puppet_hiera]
115
116
  contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/puppet/hiera.yaml"))
116
- write_file("hiera.yaml", contents, options)
117
- FileUtils.mkdir_p(File.join(@env.cwd, "hiera"))
117
+ write_file(File.join("puppet", "hiera.yaml"), contents, options)
118
+ FileUtils.mkdir_p(File.join(@env.cwd, "puppet", "hieradata"))
118
119
  contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/puppet/hiera/common.yaml"))
119
- write_file(File.join(@env.cwd, "hiera", "common.yaml"), contents, options)
120
+ write_file(File.join(@env.cwd, "puppet", "hieradata", "common.yaml"), contents, options)
120
121
  end
121
122
 
122
- FileUtils.mkdir_p(File.join(@env.cwd, "manifests"))
123
- write_file(File.join(@env.cwd, "manifests", "default.pp"), "# Your puppet code goes here", options)
123
+ FileUtils.mkdir_p(File.join(@env.cwd, "puppet", "manifests"))
124
+ write_file(File.join(@env.cwd, "puppet", "manifests", "default.pp"),
125
+ "# Your puppet code goes here",
126
+ options)
124
127
  end
125
128
 
126
129
  options[:shell_paths] ||= options[:shell_inline] ? [] : [DEFAULT_SHELL_PATH]
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Orchestrate
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -86,8 +86,9 @@ describe VagrantPlugins::Orchestrate::Command::Init do
86
86
 
87
87
  it "creates the default files" do
88
88
  subject.execute
89
- expect(Dir.entries(iso_env.cwd)).to include("manifests")
90
- expect(Dir.entries(File.join(iso_env.cwd, "manifests"))).to include("default.pp")
89
+ expect(Dir.entries(iso_env.cwd)).to include("puppet")
90
+ expect(Dir.entries(File.join(iso_env.cwd, "puppet"))).to include("manifests")
91
+ expect(Dir.entries(File.join(iso_env.cwd, "puppet", "manifests"))).to include("default.pp")
91
92
  end
92
93
  end
93
94
 
@@ -108,13 +109,13 @@ describe VagrantPlugins::Orchestrate::Command::Init do
108
109
 
109
110
  it "creates the modules directory and placeholder" do
110
111
  subject.execute
111
- expect(Dir.entries(iso_env.cwd)).to include("modules")
112
- expect(Dir.entries(File.join(iso_env.cwd, "modules"))).to include(".gitignore")
112
+ expect(Dir.entries(File.join(iso_env.cwd, "puppet"))).to include("modules")
113
+ expect(Dir.entries(File.join(iso_env.cwd, "puppet", "modules"))).to include(".gitignore")
113
114
  end
114
115
 
115
116
  it "creates the Puppetfile" do
116
117
  subject.execute
117
- expect(Dir.entries(iso_env.cwd)).to include("Puppetfile")
118
+ expect(Dir.entries(File.join(iso_env.cwd, "puppet"))).to include("Puppetfile")
118
119
  end
119
120
 
120
121
  it "contains the plugin" do
@@ -137,14 +138,26 @@ describe VagrantPlugins::Orchestrate::Command::Init do
137
138
  let(:argv) { ["--puppet", "--puppet-hiera"] }
138
139
  it "is passed into the Vagrantfile" do
139
140
  subject.execute
140
- expect(iso_env.vagrantfile.config.vm.provisioners.first.config.hiera_config_path).to eq("hiera.yaml")
141
+ expect(iso_env.vagrantfile.config.vm.provisioners.first.config.hiera_config_path).to eq("puppet/hiera.yaml")
141
142
  end
142
143
 
143
144
  it "creates the file" do
144
145
  subject.execute
145
- expect(Dir.entries(iso_env.cwd)).to include("hiera.yaml")
146
- expect(Dir.entries(iso_env.cwd)).to include("hiera")
147
- expect(Dir.entries(File.join(iso_env.cwd, "hiera"))).to include("common.yaml")
146
+ expect(Dir.entries(File.join(iso_env.cwd, "puppet"))).to include("hiera.yaml")
147
+ expect(Dir.entries(File.join(iso_env.cwd, "puppet"))).to include("hieradata")
148
+ expect(Dir.entries(File.join(iso_env.cwd, "puppet", "hieradata"))).to include("common.yaml")
149
+ end
150
+
151
+ describe "hiera.yaml" do
152
+ it "declares a datadir contains a common.yaml file" do
153
+ subject.execute
154
+ hiera_obj = YAML.load(File.read(File.join(iso_env.cwd, "puppet", "hiera.yaml")))
155
+ datadir = hiera_obj[:datadir]
156
+ expect(datadir).to start_with("/vagrant")
157
+ datadir_path = File.join(iso_env.cwd, datadir.sub("/vagrant/", ""))
158
+ expect(datadir_path).to satisfy { |path| Dir.exist?(path) }
159
+ expect(Dir.entries(datadir_path)).to include("common.yaml")
160
+ end
148
161
  end
149
162
  end
150
163
  end
@@ -7,4 +7,4 @@
7
7
  - "common"
8
8
 
9
9
  :yaml:
10
- :datadir: '/vagrant/hiera'
10
+ :datadir: '/vagrant/puppet/hieradata'
@@ -25,11 +25,12 @@ Vagrant.configure("2") do |config|
25
25
  <% end -%>
26
26
  config.vm.provision "puppet" do |puppet|
27
27
  <% if puppet_librarian_puppet -%>
28
- puppet.module_path = 'modules'
28
+ puppet.module_path = 'puppet/modules'
29
29
  <% end -%>
30
30
  <% if puppet_hiera -%>
31
- puppet.hiera_config_path = 'hiera.yaml'
31
+ puppet.hiera_config_path = 'puppet/hiera.yaml'
32
32
  <% end -%>
33
+ puppet.manifests_path = 'puppet/manifests'
33
34
  end
34
35
  <% end -%>
35
36
  <% if communicator == "ssh" -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-orchestrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Baldauf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-18 00:00:00.000000000 Z
11
+ date: 2015-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler