vagrant-pe_build 0.13.0 → 0.13.1

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: 47561a70a1c02283bba9c70a97e051730f204fc4
4
- data.tar.gz: 996f48ec7088af25312fecf60f7a1f841d541080
3
+ metadata.gz: e2e6f14e8b35e22ae15176f3cdf0c565e46c4e38
4
+ data.tar.gz: 361e059dc515938468056f519f041303901169d1
5
5
  SHA512:
6
- metadata.gz: 9acee36342d28520e8fbc2266b7b1bfdc74bb8c52f59cb9ffcf5c11614a584c8ed1e34b0d077fd05d56e4253ebdc38e19a9c487e01f5bbe70804e8754c1900d6
7
- data.tar.gz: d7c96302dc35a03ad6c08b7e63a62814c29c6338a161df39e73dcf3eedda49b4afc9feacc2c8f1585c4bbcf356755c61c4cf4d773b04421bc3626be76ebf1a2a
6
+ metadata.gz: 6b74826bbbde2c4a824fafa7fb021b6cc0f0f7078355087ae366a81e06f5f78790570c5123bc701355607bc8357c1686de9f2b2215b9b762042c6a96e69785ee
7
+ data.tar.gz: 54a2614a6218771ee590865ff44e772db378cc686af4756af69ba82266c14cbb67267d03783a244c87aa5e5d029249c54c3d6bb1bbbdd1e7d0f9bc6733511735
data/CHANGELOG CHANGED
@@ -1,6 +1,23 @@
1
1
  vagrant-pe_build
2
2
  ================
3
3
 
4
+ 0.13.1
5
+ ------
6
+
7
+ 2015-10-25
8
+
9
+ This is a backwards compatible bugfix release.
10
+
11
+ * (GH-100) Fixed an issue where the `pe_build` provisioner would fail
12
+ validation after provisioning had been executed. Some Vagrant providers
13
+ and plugins set up action chains that run validation multiple times.
14
+
15
+ * (GH-101) When loading facts, POSIX guests now properly search for
16
+ Puppet installations.
17
+
18
+ * (GH-102) Searches for Puppet installations are performed using the root
19
+ account and environment variables.
20
+
4
21
  0.13.0
5
22
  ------
6
23
 
@@ -96,7 +96,7 @@ class PEBuild::Cap::Facts::Base
96
96
  # Override this method to implement a more sophisticated search for the
97
97
  # Puppet executable.
98
98
  def find_puppet
99
- return 'puppet' if @machine.communicate.test('puppet --version')
99
+ return 'puppet' if @machine.communicate.test('puppet --version', :sudo => true)
100
100
  return nil
101
101
  end
102
102
 
@@ -19,7 +19,7 @@ class PEBuild::Cap::Facts::POSIX < PEBuild::Cap::Facts::Base
19
19
 
20
20
  private
21
21
 
22
- def find_facter
22
+ def find_puppet
23
23
  paths = %w[
24
24
  /opt/puppetlabs/bin/puppet
25
25
  /opt/puppet/bin/puppet
@@ -27,7 +27,7 @@ class PEBuild::Cap::Facts::POSIX < PEBuild::Cap::Facts::Base
27
27
  ]
28
28
 
29
29
  paths.each do |path|
30
- return path if @machine.communicate.test("#{path} --version")
30
+ return path if @machine.communicate.test("#{path} --version", :sudo => true)
31
31
  end
32
32
 
33
33
  return nil
@@ -12,13 +12,14 @@ module PEBuild
12
12
 
13
13
  attr_reader :facts
14
14
  attr_reader :agent_version
15
+ attr_reader :master_vm
15
16
 
16
17
  def provision
17
18
  provision_init!
18
19
 
19
20
  # As of 2015.x, pe_repo doesn't support windows installation, so skip
20
21
  # provisioning the repositories.
21
- unless config.master_vm.nil? || provision_windows?
22
+ unless master_vm.nil? || provision_windows?
22
23
  provision_pe_repo
23
24
  end
24
25
  provision_agent
@@ -28,17 +29,17 @@ module PEBuild
28
29
  # This gets run during agent destruction and will remove the agent's
29
30
  # certificate from the master, if requested.
30
31
  def cleanup
31
- unless config.master_vm.is_a?(::Vagrant::Machine)
32
- vm_def = machine.env.active_machines.find {|vm| vm[0].to_s == config.master_vm.to_s}
33
- if vm_def.nil?
34
- config.master_vm.ui.warn I18n.t(
35
- 'pebuild.provisioner.pe_agent.skip_purge_no_master',
36
- :master => config.master_vm.to_s
37
- )
38
- return
39
- end
40
- config.master_vm = machine.env.machine(*vm_def)
32
+ # Search the list of created VMs, which is a list of [name, provider]
33
+ # tuples. This will fail to match anything if config.master_vm is nil.
34
+ vm_def = machine.env.active_machines.find {|vm| vm[0].to_s == config.master_vm.to_s}
35
+ if vm_def.nil?
36
+ config.master_vm.ui.warn I18n.t(
37
+ 'pebuild.provisioner.pe_agent.skip_purge_no_master',
38
+ :master => config.master_vm.to_s
39
+ )
40
+ return
41
41
  end
42
+ @master_vm = machine.env.machine(*vm_def)
42
43
 
43
44
  cleanup_agent_cert if config.autopurge
44
45
  end
@@ -55,8 +56,8 @@ module PEBuild
55
56
  vm_def = machine.env.active_machines.find {|vm| vm[0].to_s == config.master_vm.to_s}
56
57
 
57
58
  unless vm_def.nil?
58
- config.master_vm = machine.env.machine(*vm_def)
59
- config.master ||= config.master_vm.config.vm.hostname.to_s
59
+ @master_vm = machine.env.machine(*vm_def)
60
+ config.master ||= @master_vm.config.vm.hostname.to_s
60
61
  end
61
62
  end
62
63
  end
@@ -94,7 +95,7 @@ module PEBuild
94
95
  def provision_pe_repo
95
96
  # This method will raise an error if commands can't be run on the
96
97
  # master VM.
97
- ensure_reachable(config.master_vm)
98
+ ensure_reachable(master_vm)
98
99
 
99
100
  platform = platform_tag(facts)
100
101
  # Transform the platform_tag into a Puppet class name.
@@ -104,18 +105,18 @@ module PEBuild
104
105
 
105
106
  # Print a message and return if the agent repositories exist on the
106
107
  # master.
107
- if config.master_vm.communicate.test("[ -e #{platform_repo} ]")
108
- config.master_vm.ui.info I18n.t(
108
+ if master_vm.communicate.test("[ -e #{platform_repo} ]", :sudo => true)
109
+ master_vm.ui.info I18n.t(
109
110
  'pebuild.provisioner.pe_agent.pe_repo_present',
110
- :vm_name => config.master_vm.name,
111
+ :vm_name => master_vm.name,
111
112
  :platform_tag => platform
112
113
  )
113
114
  return
114
115
  end
115
116
 
116
- config.master_vm.ui.info I18n.t(
117
+ master_vm.ui.info I18n.t(
117
118
  'pebuild.provisioner.pe_agent.adding_pe_repo',
118
- :vm_name => config.master_vm.name,
119
+ :vm_name => master_vm.name,
119
120
  :platform_tag => platform
120
121
  )
121
122
 
@@ -129,7 +130,7 @@ module PEBuild
129
130
  EOS
130
131
  shell_config.finalize!
131
132
 
132
- shell_provisioner = Vagrant.plugin('2').manager.provisioners[:shell].new(config.master_vm, shell_config)
133
+ shell_provisioner = Vagrant.plugin('2').manager.provisioners[:shell].new(master_vm, shell_config)
133
134
  shell_provisioner.provision
134
135
  end
135
136
 
@@ -181,7 +182,7 @@ bash pe_frictionless_installer.sh
181
182
  def provision_agent_cert
182
183
  # This method will raise an error if commands can't be run on the
183
184
  # master VM.
184
- ensure_reachable(config.master_vm)
185
+ ensure_reachable(master_vm)
185
186
 
186
187
  agent_certname = facts['certname']
187
188
 
@@ -189,19 +190,19 @@ bash pe_frictionless_installer.sh
189
190
  # inverted as `grep -q` will exit with 1 if the certificate is not
190
191
  # found.
191
192
  # TODO: Extend paths to PE 3.x masters.
192
- if not config.master_vm.communicate.test("/opt/puppetlabs/bin/puppet cert list | grep -q -F #{agent_certname}", :sudo => true)
193
- config.master_vm.ui.info I18n.t(
193
+ if not master_vm.communicate.test("/opt/puppetlabs/bin/puppet cert list | grep -q -F #{agent_certname}", :sudo => true)
194
+ master_vm.ui.info I18n.t(
194
195
  'pebuild.provisioner.pe_agent.no_csr_pending',
195
196
  :certname => agent_certname,
196
- :master => config.master_vm.name.to_s
197
+ :master => master_vm.name.to_s
197
198
  )
198
199
  return
199
200
  end
200
201
 
201
- config.master_vm.ui.info I18n.t(
202
+ master_vm.ui.info I18n.t(
202
203
  'pebuild.provisioner.pe_agent.signing_agent_cert',
203
204
  :certname => agent_certname,
204
- :master => config.master_vm.name.to_s
205
+ :master => master_vm.name.to_s
205
206
  )
206
207
 
207
208
  shell_config = Vagrant.plugin('2').manager.provisioner_configs[:shell].new
@@ -212,7 +213,7 @@ bash pe_frictionless_installer.sh
212
213
  EOS
213
214
  shell_config.finalize!
214
215
 
215
- shell_provisioner = Vagrant.plugin('2').manager.provisioners[:shell].new(config.master_vm, shell_config)
216
+ shell_provisioner = Vagrant.plugin('2').manager.provisioners[:shell].new(master_vm, shell_config)
216
217
  shell_provisioner.provision
217
218
  end
218
219
 
@@ -221,28 +222,28 @@ bash pe_frictionless_installer.sh
221
222
  # point, so it's the best guess we have available.
222
223
  agent_certname = machine.config.vm.hostname
223
224
 
224
- unless is_reachable?(config.master_vm)
225
- config.master_vm.ui.warn I18n.t(
225
+ unless is_reachable?(master_vm)
226
+ master_vm.ui.warn I18n.t(
226
227
  'pebuild.provisioner.pe_agent.skip_purge_master_not_reachable',
227
- :vm_name => config.master_vm.name.to_s
228
+ :vm_name => master_vm.name.to_s
228
229
  )
229
230
  return
230
231
  end
231
232
 
232
233
  # TODO: Extend paths to PE 3.x masters.
233
- if not config.master_vm.communicate.test("/opt/puppetlabs/bin/puppet cert list #{agent_certname}", :sudo => true)
234
- config.master_vm.ui.info I18n.t(
234
+ unless master_vm.communicate.test("/opt/puppetlabs/bin/puppet cert list #{agent_certname}", :sudo => true)
235
+ master_vm.ui.info I18n.t(
235
236
  'pebuild.provisioner.pe_agent.agent_purged',
236
237
  :certname => agent_certname,
237
- :master => config.master_vm.name.to_s
238
+ :master => master_vm.name.to_s
238
239
  )
239
240
  return
240
241
  end
241
242
 
242
- config.master_vm.ui.info I18n.t(
243
+ master_vm.ui.info I18n.t(
243
244
  'pebuild.provisioner.pe_agent.purging_agent',
244
245
  :certname => agent_certname,
245
- :master => config.master_vm.name.to_s
246
+ :master => master_vm.name.to_s
246
247
  )
247
248
 
248
249
  shell_config = Vagrant.plugin('2').manager.provisioner_configs[:shell].new
@@ -253,7 +254,7 @@ bash pe_frictionless_installer.sh
253
254
  EOS
254
255
  shell_config.finalize!
255
256
 
256
- shell_provisioner = Vagrant.plugin('2').manager.provisioners[:shell].new(config.master_vm, shell_config)
257
+ shell_provisioner = Vagrant.plugin('2').manager.provisioners[:shell].new(master_vm, shell_config)
257
258
  shell_provisioner.provision
258
259
  end
259
260
 
@@ -1,3 +1,3 @@
1
1
  module PEBuild
2
- VERSION = '0.13.0'
2
+ VERSION = '0.13.1'
3
3
  end
@@ -65,7 +65,7 @@ EOF
65
65
 
66
66
  context 'when master_vm is set' do
67
67
  before(:each) do
68
- allow(config).to receive(:master_vm).and_return(master_vm)
68
+ allow(subject).to receive(:master_vm).and_return(master_vm)
69
69
  end
70
70
 
71
71
  it 'raises an error if the master_vm is unreachable' do
@@ -78,7 +78,7 @@ EOF
78
78
  context 'when osfamily is windows' do
79
79
  before(:each) do
80
80
  allow(subject).to receive(:provision_windows?).and_return(true)
81
- allow(config).to receive(:master_vm).and_return(master_vm)
81
+ allow(subject).to receive(:master_vm).and_return(master_vm)
82
82
  end
83
83
 
84
84
  it 'invokes the windows provisioner and skips pe_repo' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-pe_build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-18 00:00:00.000000000 Z
12
+ date: 2015-10-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: progressbar