[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Roy Nielsen
Hello Reno, Try this: exec { touch-file: command => "touch /home/test", require => Exec[subscribe-echo] } - or - file { touch-file: contents => " ", path => "/home/test", require => Exec[subscribe-echo] } Regards, -Roy Reno wrote: >

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Reno
hello, what is the meaning of that: require => Exec[subscribe-echo] On Oct 21, 4:21 pm, Roy Nielsen wrote: > Hello Reno, > > Try this: > >     exec { touch-file: >         command => "touch /home/test", >         require => Exec[subscribe-echo] >     } > >  - or - > >     file { touch-file:

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Jeff Adams
Something like the following should work: exec { subscribe-echo: command => "/usr/bin/apt-get -q -q update && touch /home/test ", logoutput => false, refreshonly => true, subscribe => file["/etc/apt/sources.list"]

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Roy Nielsen
Hello Reno, "require" is a metaparameter -- see: http://reductivelabs.com/trac/puppet/wiki/MetaparameterReference#require I believe the string proceeding the brackets is a "capitalized type" from: http://reductivelabs.com/trac/puppet/wiki/TypeReference and the string inside the brackets is th

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Reno
hi and thanks for the help I use a more simple ( to me ) but effective solution: exec { "touch /home/ciao": cwd => "/home", path => "/usr/bin:/usr/sbin:/bin" } On Oct 21, 4:30 pm, Roy Nielsen wrote: > Hello Reno, > > "require" is a metaparameter -- see: > > http://reductivelabs.co

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Brice Figureau
On Wed, 2009-10-21 at 08:53 -0700, Reno wrote: > hi and thanks for the help > > I use a more simple ( to me ) but effective solution: > > > exec { "touch /home/ciao": > cwd => "/home", > path => "/usr/bin:/usr/sbin:/bin" > } You can't guarantee this exec won't run _before_ your other

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Reno
Yes I agree, for example what you will do if I want to run the touch command only if /usr/bin/apt-get -q -q update has run without error? exec { subscribe-echo: command => "/usr/bin/apt-get -q -q update", logoutput => false, refreshonly => true

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Roy Nielsen
Use the onlyif parameter of the exec type: exec { "touch /home/ciao:" cwd => "/home", path => "/usr/bin:/usr/sbin:/bin", onlyif => "/usr/bin/apt-get -q -q update" } Note: the onlyif parameter only works this way with the "exec" type (works a bit differently for the augeas type) Th

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Reno
err: Could not retrieve catalog: Could not parse for environment production: Syntax error at 'cwd'; expected '}' at /etc/puppet/ manifests/classes/source.list.pp:24 On Oct 21, 5:45 pm, Roy Nielsen wrote: > Use the onlyif parameter of the exec type: > > exec { "touch /home/ciao:" >      cwd => "

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Roy Nielsen
oops, quote in the wrong place, try: exec { "touch /home/ciao": cwd => "/home", path => "/usr/bin:/usr/sbin:/bin", onlyif => "/usr/bin/apt-get -q -q update" } Reno wrote: > err: Could not retrieve catalog: Could not parse for environment > production: Syntax error at 'cwd'; exp

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Reno
op sorry I didn't see too! :-) Btw onlyif => "/usr/bin/apt-get -q -q update" say to do that just after the apt-get command is lunched but what if I want the contrary ... to run the command only if the apt-get fail to run? On Oct 21, 6:02 pm, Roy Nielsen wrote: > oops, quote in the wro

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Roy Nielsen
Hello Reno - Use the "unless" exec parameter http://reductivelabs.com/trac/puppet/wiki/TypeReference#unless With unless, (from the page): "If this parameter is set, then this exec will run unless the command returns 0." Regards, -Roy Reno wrote: > op sorry I didn't see too! :-) > > Btw >

[Puppet Users] Re: execute more commands (beginner talking)

2009-10-21 Thread Gourav Shah
On Wed, Oct 21, 2009 at 9:53 PM, Reno wrote: > > Yes I agree, > > for example what you will do if I want to run the touch command only > if /usr/bin/apt-get -q -q update has run without error? > > thats what require is for use require => Exec[subscribe-echo] exec { subscribe-echo: >