Check exit codes of puppet provisioners
Previously, failures in applying the puppet manifests would be ignored, because puppet apply/agent don't have any useful exit codes by default. (Errors are printed, but vagrant continues.) Use the option --detailed-exitcodes of puppet apply/agent to check for success.
This commit is contained in:
parent
63a40c598d
commit
901d3ad23b
|
@ -153,7 +153,7 @@ module VagrantPlugins
|
|||
facter = "#{facts.join(" ")} "
|
||||
end
|
||||
|
||||
command = "cd #{manifests_guest_path} && #{facter}puppet apply #{options}"
|
||||
command = "cd #{manifests_guest_path} && #{facter}puppet apply #{options} --detailed-exitcodes || [ $? -eq 2 ]"
|
||||
|
||||
env[:ui].info I18n.t("vagrant.provisioners.puppet.running_puppet",
|
||||
:manifest => @manifest_file)
|
||||
|
|
|
@ -67,7 +67,7 @@ module VagrantPlugins
|
|||
facter = "#{facts.join(" ")} "
|
||||
end
|
||||
|
||||
command = "#{facter}puppet agent #{options} --server #{config.puppet_server}"
|
||||
command = "#{facter}puppet agent #{options} --server #{config.puppet_server} --detailed-exitcodes || [ $? -eq 2 ]"
|
||||
|
||||
env[:ui].info I18n.t("vagrant.provisioners.puppet_server.running_puppetd")
|
||||
env[:vm].channel.sudo(command) do |type, data|
|
||||
|
|
Loading…
Reference in New Issue