generally speaking, here's how you get a script to run at start up on  
the mac.

sudo vi /Library/LaunchDaemons/MyStartUpScript.plist

paste in the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
         "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>com.mycompany.MyStartUpScript </string> 
        <key>Nice</key>
        <integer>20</integer>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/local/bin/myscript.sh</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
</dict>

Put your script in /usr/local/bin or where ever, but update the path  
in the plist above
Have your script delete the plist file as the list line of the script
If you need to pass arguments to your script, please each one on a  
<string> line in the <array> block

That should be it. use the freeware "lingon" to create or edit these  
plists. it's easy.

Now, how to get the script to run before puppet is launched is a bit  
tricky and depends on how you are running puppet.





---
Thanks,

Allan Marcus
505-667-5666



On Jul 8, 2009, at 2:18 PM, Kurt Engle wrote:

> So are you wanting the cert cleaning and creation to happen  
> everytime a client contacts the puppetmaster?
>
> What I am looking for is a script that will run on a newly imaged  
> client that run at bootup before the puppetd process is started.  
> That script would delete any cert on the puppetmaster and then the  
> script would delete itself on the client. The issue that I am having  
> is with clients that have been using puppet but are then 're- 
> imaged'. Once a device is running puppet, it works fine unless it is  
> re-imaged.
>
> This seems like a more elegant solution in my environment than  
> trying to do this on the puppet server side of things. Besides,  
> doesn't the client need to us its cert to talk to the server in the  
> first place? If that cert is 'bad' then how would it talk to the  
> puppetmaster server and have the server delete its bad key?
>
> Now, anybody have any good resources for writing startup scripts on  
> a Mac client? I seem to be having problems getting a script that  
> runs fine on the command line to work at startup.
>
> -kurt
>
> On Fri, Jul 3, 2009 at 6:12 AM, Gary Larizza <glari...@mac.com> wrote:
>
> I love where this thread is going, I too share in this problem.
>
> Kurt:  Puppet is still being run on the client because the client is
> using a cached config (am I right on this guys?).
>
> I love the scripted ssh key, but ALSO love the PHP script that could
> be CURL-ed from the client.  Will a PHP script be able to capture the
> hostname of a connecting client?  From there, the php script could
> call puppetca to clean the cert and create a new one...would this be
> cleaner than bundling a cert with your base-image?  Unfortunately, I'm
> not that versed in PHP to hash a script out from scratch.  Does anyone
> have a rough outline that we could steal?
>
> -Gary
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to