Class: Vagrant::Provisioners::PuppetServer
- Inherits:
-
Base
- Object
- Base
- Vagrant::Provisioners::PuppetServer
show all
- Defined in:
- lib/vagrant/provisioners/puppet_server.rb
Defined Under Namespace
Classes: Config
Instance Attribute Summary
Attributes inherited from Base
#config, #env
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#cleanup, #initialize, #prepare
Class Method Details
.config_class ⇒ Object
17
18
19
|
# File 'lib/vagrant/provisioners/puppet_server.rb', line 17
def self.config_class
Config
end
|
Instance Method Details
#provision! ⇒ Object
21
22
23
24
|
# File 'lib/vagrant/provisioners/puppet_server.rb', line 21
def provision!
verify_binary("puppetd")
run_puppetd_client
end
|
#run_puppetd_client ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/vagrant/provisioners/puppet_server.rb', line 33
def run_puppetd_client
options = config.options
options = [options] if !options.is_a?(Array)
cn = nil
if config.puppet_node
cn = config.puppet_node
elsif env[:vm].config.vm.host_name
cn = nil
else
cn = env[:vm].config.vm.box
end
options += ["--certname", cn] if cn
options = options.join(" ")
command = "puppetd #{options} --server #{config.puppet_server}"
env[:ui].info I18n.t("vagrant.provisioners.puppet_server.running_puppetd")
env[:vm].channel.sudo(command) do |type, data|
env[:ui].info(data.chomp, :prefix => false)
end
end
|
#verify_binary(binary) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/vagrant/provisioners/puppet_server.rb', line 26
def verify_binary(binary)
env[:vm].channel.sudo("which #{binary}",
:error_class => PuppetServerError,
:error_key => :not_detected,
:binary => binary)
end
|