Fix whitespace issues with puppet server

This commit is contained in:
Mitchell Hashimoto 2011-01-06 13:35:08 -08:00
parent 3849355ef6
commit 8daf81686d
1 changed files with 42 additions and 44 deletions

View File

@ -1,59 +1,57 @@
module Vagrant
module Provisioners
class PuppetServerError < Vagrant::Errors::VagrantError
error_namespace("vagrant.provisioners.puppet_server")
end
class PuppetServerConfig < Vagrant::Config::Base
configures :puppet_server
attr_accessor :puppet_server
attr_accessor :puppet_node
attr_accessor :options
def initialize
@puppet_server = "puppet"
@puppet_node = "puppet_node"
@options = []
end
end
class PuppetServer < Base
def provision!
verify_binary("puppetd")
run_puppetd_client
class PuppetServerError < Vagrant::Errors::VagrantError
error_namespace("vagrant.provisioners.puppet_server")
end
def verify_binary(binary)
vm.ssh.execute do |ssh|
# Checks for the existence of puppetd binary and error if it
# doesn't exist.
ssh.exec!("which #{binary}", :error_class => PuppetServerError, :_key => :puppetd_not_detected, :binary => binary)
class PuppetServerConfig < Vagrant::Config::Base
configures :puppet_server
attr_accessor :puppet_server
attr_accessor :puppet_node
attr_accessor :options
def initialize
@puppet_server = "puppet"
@puppet_node = "puppet_node"
@options = []
end
end
def run_puppetd_client
options = env.config.puppet_server.options
options = options.join(" ") if options.is_a?(Array)
if env.config.puppet_server.puppet_node
cn = env.config.puppet_server.puppet_node
else
cn = env.config.vm.box
class PuppetServer < Base
def provision!
verify_binary("puppetd")
run_puppetd_client
end
command = "sudo -E puppetd #{options} --server #{env.config.puppet_server.puppet_server} --certname #{cn}"
def verify_binary(binary)
vm.ssh.execute do |ssh|
# Checks for the existence of puppetd binary and error if it
# doesn't exist.
ssh.exec!("which #{binary}", :error_class => PuppetServerError, :_key => :puppetd_not_detected, :binary => binary)
end
end
env.ui.info I18n.t("vagrant.provisioners.puppet_server.running_puppetd")
def run_puppetd_client
options = env.config.puppet_server.options
options = options.join(" ") if options.is_a?(Array)
if env.config.puppet_server.puppet_node
cn = env.config.puppet_server.puppet_node
else
cn = env.config.vm.box
end
vm.ssh.execute do |ssh|
ssh.exec!(command) do |channel, type, data|
ssh.check_exit_status(data, command) if type == :exit_status
env.ui.info("#{data}: #{type}") if type != :exit_status
command = "sudo -E puppetd #{options} --server #{env.config.puppet_server.puppet_server} --certname #{cn}"
env.ui.info I18n.t("vagrant.provisioners.puppet_server.running_puppetd")
vm.ssh.execute do |ssh|
ssh.exec!(command) do |channel, type, data|
ssh.check_exit_status(data, command) if type == :exit_status
env.ui.info("#{data}: #{type}") if type != :exit_status
end
end
end
end
end
end
end
end