Skip to content

Commit 70141e9

Browse files
committed
Merge pull request #208 from jamezpolley/master
Capture output of puppet_init.sh in a logfile on the node, don't nohup the agent.
2 parents 437352f + be24093 commit 70141e9

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

lib/project_razor/broker/puppet.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def init_agent(options={})
5555
Net::SSH.start(options[:ipaddress], options[:username], { :password => options[:password], :user_known_hosts_file => '/dev/null'} ) do |session|
5656
logger.debug "Copy: #{session.exec! "echo \"#{@puppet_script}\" > /tmp/puppet_init.sh" }"
5757
logger.debug "Chmod: #{session.exec! "chmod +x /tmp/puppet_init.sh"}"
58-
@run_script_str << session.exec!("bash /tmp/puppet_init.sh")
58+
@run_script_str << session.exec!("bash /tmp/puppet_init.sh |& tee /tmp/puppet_init.out")
5959
@run_script_str.split("\n").each do |line|
6060
logger.debug "puppet script: #{line}"
6161
end

lib/project_razor/broker/puppet/agent_install.erb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ EOFPUPPETDEFAULT
3737
fi
3838
}
3939

40-
function start_puppet() {
40+
function run_agent() {
4141
puppet agent -t
42-
/usr/bin/nohup puppet agent &
4342
}
4443

4544
#This fuction is not called if no custom facts are given
@@ -58,7 +57,7 @@ function provision_puppet() {
5857
install_puppet
5958
configure_puppet
6059
<%= 'facts_dot_d' if @options[:metadata] %>
61-
start_puppet
60+
run_agent
6261
echo Puppet installation finished!
6362
exit 0
6463
}

0 commit comments

Comments
 (0)