Puppet and scripts.

45 views
Skip to first unread message

Daniel Lyons

unread,
Nov 21, 2013, 1:08:10 PM11/21/13
to puppet...@googlegroups.com
Hello,
So I realize one of the main points of puppet is moving way from .sh scripts but I'm at a point where I need to use one until I can get everything figured out. The problem I'm having is that my scripts dont seem to run properly if I have puppet call them.
 
We've got a decently complicated .sh script used to set up oracle database, inlcuding partioning and the like. If I attempt to run it through puppet the script will end after 300 seconds as timed out. To test a simpler case I just made a little script as such:
 
#!/bin/sh
echo Something
 
Then if I try to use it with this (as a puppet agent run):
 
exec { "Thing":
provider => shell,
command => "sh /testscript.sh",
path => "(my path)" 
}
 
I notice through --debug it says it executes the script but I don't see the actual echo command comming out. I've read about logoutput => true and that will give me the "Somthing" in the puppet information but if I run the big script I still dont see anything. The install script opens with defining a bunch of functions and then heading into a main, so I'm wondering if there is something with puppet and scripts that doesn't want to just run? It seems like it should just let the script run though. I have verified the script works correctly when simply run straight in the shell.
 
Again, as I've moved some other programs and installs to puppet I realize I'm kind of going against the puppet grain on this and eventually plan to do away with sh scripts but for now, due to time constraints and having a lot of this script written before I arrived here, I sort of need to put a temporary fix on this one by running the script we've used for a while.
 
Thanks for the help, and double thanks if this is something out of my range of understanding for scripts and puppet that I'm unaware of. I'm a bit of a newbie to all this and have run through the tutorials and such but I think there's a piece I'm blind to here. :)
 
-Daniel

Andreas Ntaflos

unread,
Nov 21, 2013, 1:33:41 PM11/21/13
to puppet...@googlegroups.com
On 2013-11-21 19:08, Daniel Lyons wrote:
> We've got a decently complicated .sh script used to set up oracle
> database, inlcuding partioning and the like. If I attempt to run it
> through puppet the script will end after 300 seconds as timed out. To
> test a simpler case I just made a little script as such:

Exec has a timeout parameter:
http://docs.puppetlabs.com/references/latest/type.html#exec-attribute-timeout

HTH

Andreas

signature.asc

Daniel Lyons

unread,
Nov 21, 2013, 1:58:00 PM11/21/13
to puppet...@googlegroups.com
So I knew the script took a while but I thought to myself: "No way does it take 5 minutes." Sure enough I dropped the timeout and it finishes. 312 seconds...
 
Also I understand now that the log is posted in full AFTER the script runs, so that's why I wasn't seeing any of the echo outputs at all after the timeout fail.
 
I needed that second brain to see a goof like that, highly appriciate it Andreas.
Reply all
Reply to author
Forward
0 new messages