Mat,

This should work (untested):

file { "/tmp/server_binary":
       source  => "puppet:///files/server_binary",
       notify => Exec["stop-server"];
}

file { "/usr/local/sbin/server_binary":
       source  => "/tmp/server_binary",
       require => Exec["stop-server"],
       notify  => Exec["start-server"]
}

# Stops the server
exec { "/usr/local/sbin/stop-server":
       alias       => "stop-server",
       refreshonly => true
}

# Starts the server
exec { "/usr/local/sbin/start-server":
       alias       => "start-server",
       refreshonly => true
}

--Paul

On Tue, Dec 9, 2008 at 1:09 PM, Mathew Binkley <[EMAIL PROTECTED]> wrote:
>
> Hi.  I'm hoping that someone can help me with a simple example.  We are
> trying to use puppet to update a server binary to a group of machines.
> Here's pseudocode for what I'm trying:
>
> if (server_binary has changed) {
>        1)  stop the old server
>        2)  overwrite the old server binary by
>               fetching the new server binary from puppet
>        3)  start the new server
> }
>
> Here's the puppet manifest I wrote to handle this, but it isn't working
> properly.  It is not working as intended, and is 1) downloading the new
> binary and then 2) stopping the server, which screws up our data.  I've
> been looking through the documentation, and it isn't clear which
> permutation of before, require, subscribe, or notify is necessary to
> accomplish this.  Hope someone can enlighten me.  - Mat
>
>
> file { "/usr/local/sbin/server_binary":
>        source  => "puppet:///files/server_binary",
>        require => Exec["stop-server"],
>        before  => Exec["start-server"]
> }
>
> # Stops the server
> exec { "/usr/local/sbin/stop-server":
>        alias       => "stop-server",
>        refreshonly => true
> }
>
> # Starts the server
> exec { "/usr/local/sbin/start-server":
>        alias       => "start-server",
>        refreshonly => true
> }
>
> >
>

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

Reply via email to