How to get logs in to the same termianl in agent side

41 views
Skip to first unread message

Malintha Adikari

unread,
Jun 18, 2014, 6:23:07 AM6/18/14
to puppet...@googlegroups.com
Hi,

I am executing a shell script in the puppet agent side. If I execute the same shell script in my local machine it will print several log messages to terminal. But when I execute it in the puppet agent it does not print any log into the agent terminal. How can I print the logs of the shell script when I run it using puppet ? I am using following command to execute the 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'],
  }

Regards,
Malintha Adikari

Sans

unread,
Jun 18, 2014, 10:36:44 AM6/18/14
to puppet...@googlegroups.com
I think, you cannot: The manifest is first compiled on Puppet Master and then the catalog (complied manifests) is sent to the agent, where that command actually runs. You can try this instead to see if you get any thing better

command    => '/pathToShellScript/myScript.sh 2>&1',
logoutput  => true,

Best!

Sans

unread,
Jun 18, 2014, 10:40:59 AM6/18/14
to puppet...@googlegroups.com
Another thing, JFYI: I think somewhere you said you are new the Puppet, so get into the habit to follow the style-guide before it's too late, especially for the quote: you are mixing up the double and single quotes.
Look at here: http://docs.puppetlabs.com/guides/style_guide.html

Erik Dalén

unread,
Jun 18, 2014, 11:41:09 AM6/18/14
to puppet...@googlegroups.com
you will need to run the puppet agent with --verbose (or --test which implied verbose) to actually display the output in the terminal.


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/dc3a5a66-8f3d-4efc-b1ab-e0f262efa746%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Erik Dalén
Reply all
Reply to author
Forward
0 new messages