add something like
notify   => Exec["myapp::decompress"],
to your file resource

also, according to the documentation, for a file resource the ensure
parameter
possible values are *absent*, *present*, *file*, and *directory*
I'm not sure what latest is going to do there, but you don't need it, just
say present

ensure => latest is usually used for the package resource type, though I
would suggest never doing that either, unless you really want your package
management trying to update everytime puppet runs

On Wed, Apr 25, 2012 at 11:02 PM, Suresh <[email protected]> wrote:

> class filecheck {
>   include myapp
>   file { "puppet:///modules/myapp/MyApp_GA.tar.gz":
>     owner => 'myapp',
>     group => 'myapp',
>     ensure => latest,
>     path => "/opt/apps/myapp/artifacts/MyApp_GA.tar.gz",
>   }
> }
>
>
> class myapp::decompress {
>   exec { "myapp::decompress":
>     owner => 'myapp',
>     group => 'myapp',
>     mode => 0755,
>     command => "/bin/tar -xzf MyApp_GA.tar.gz -C /opt/apps/myapp/release"
> }
>
>
> in my puppet manifests/nodes.pp
> I have defined several stages e.g.
>
> nodes.pp
> ========
> stage {
>   "stop_service": ;
>  }
>
>  node mynode.com {
>    include filecheck, myapp
>  }
>
> What I need is if filecheck fails, then execution should stop and should
> go no further.
>
> -Suresh
>
> On Wed, Apr 25, 2012 at 7:21 PM, Michael Baydoun 
> <[email protected]>wrote:
>
>> The file ensure for the tar file should only download when it changes
>> The untar can have a require on the file resource, and so on
>>
>> Can you post your file resource and untar exec resource?
>>
>>
>> On Wed, Apr 25, 2012 at 5:51 PM, Suresh <[email protected]> wrote:
>>
>>> Can you guys please help me address this host configuration?
>>>
>>> 1) I have 5 different modules that need to be installed to each
>>> host/agent
>>> 1.1) from one of the modules, a large application tar file is downloaded
>>> by agent and performs untar to required folder structure.
>>> 1.2) before the "untar", required application services are stopped and
>>> after "untar' is complete all the services are started
>>>
>>> What I have observed is, agent is downloading the application tar file
>>> every 30 minutes (agent is running in daemon mode)
>>> and performing the complete process (1, 1.1, 1.2) which it shouldn't if
>>> the file is unchanged from its previous download.
>>>
>>>
>>> How can I configure agent, such that it should perform the installation,
>>> only if downloaded file is changed from previous download?
>>>
>>> Suresh
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Puppet Users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/puppet-users/-/_YirDaiAVGwJ.
>>> 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.
>>>
>>
>>  --
>> 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.
>>
>
>  --
> 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.
>

-- 
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