Saturday, 15 February 2014

shell - Puppet : How to get logs in to the same terminal in agent side -



shell - Puppet : How to get logs in to the same terminal in agent side -

i executing shell script in puppet agent side. if execute same shell script in local machine print several log messages terminal. when execute in puppet agent not print log agent terminal.

how can print logs of shell script when run using puppet?

i using next command execute shell script.

exec { "strating": user => 'root', environment => 'java_home=/home/malintha/jdk1.6.0', path => $command_path, command => "/pathtoshellscript/myscript.sh", logoutput => true, timeout => 3600, require => exec['another goal'], }

note: set logoutput => true

you can add together --debug flag puppet command.

puppet agent --test --debug

or alternatively can set loglevel metaparameter info or notice:

exec { 'starting': path => $command_path, command => '/path/to/script.sh', logoutput => true, loglevel => info }

see below output:

[~]$ puppet apply --verbose test.pp notice: compiled catalog dpsmqm009.local in environment production in 0.03 seconds info: applying configuration version '1403302144' info: /stage[main]/main/exec[starting]/returns: testing info: /stage[main]/main/exec[starting]/returns: testing 1 time again info: /stage[main]/main/exec[starting]/returns: testing more info: /stage[main]/main/exec[starting]/returns: executed notice: finished catalog run in 0.20 seconds reference

http://docs.puppetlabs.com/references/latest/metaparameter.html#loglevel

shell puppet puppetlabs-apache

No comments:

Post a Comment