[Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-05-09 Thread Nigel Kersten
On Mon, May 9, 2011 at 12:03 PM, kcrwfrd wrote: > On Feb 5, 1:56 am, Nigel Kersten wrote: > > On Thu, Feb 3, 2011 at 11:45 AM, Nick Moffitt wrote: > > > Nigel Kersten: > > >> On Wed, Feb 2, 2011 at 5:10 PM, Daniel Pittman > wrote: > > >> > (Also, I went looking and found zero attempts to solve

[Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-05-09 Thread kcrwfrd
On Feb 5, 1:56 am, Nigel Kersten wrote: > On Thu, Feb 3, 2011 at 11:45 AM, Nick Moffitt wrote: > > Nigel Kersten: > >> On Wed, Feb 2, 2011 at 5:10 PM, Daniel Pittman > >> wrote: > >> > (Also, I went looking and found zero attempts to solve this in a > >> > reusable, FOSS way, let alone working

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-02-04 Thread Nigel Kersten
On Thu, Feb 3, 2011 at 11:45 AM, Nick Moffitt wrote: > Nigel Kersten: >> On Wed, Feb 2, 2011 at 5:10 PM, Daniel Pittman wrote: >> > (Also, I went looking and found zero attempts to solve this in a >> > reusable, FOSS way, let alone working solutions.) >> >> Yep. I've been dreaming of a Puppet-int

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-02-03 Thread Jeff McCune
On Wed, Feb 2, 2011 at 1:52 PM, Ashley Gould wrote: > On Mon, Jan 31, 2011 at 06:27:20PM -0800, Daniel Pittman wrote: >> In the longer term I would hope to have that information pushed out >> from the puppet system, so that if a node *should* be joined with >> centrifyDC puppet will make it so, bu

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-02-03 Thread Nick Moffitt
Nigel Kersten: > On Wed, Feb 2, 2011 at 5:10 PM, Daniel Pittman wrote: > > (Also, I went looking and found zero attempts to solve this in a > > reusable, FOSS way, let alone working solutions.) > > Yep. I've been dreaming of a Puppet-integrated Password Safe for a while :) Alas! I'm currently e

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-02-02 Thread Nigel Kersten
On Wed, Feb 2, 2011 at 5:10 PM, Daniel Pittman wrote: > On Wed, Feb 2, 2011 at 17:02, Nigel Kersten wrote: >> On Wed, Feb 2, 2011 at 10:52 AM, Ashley Gould wrote: >>> On Mon, Jan 31, 2011 at 06:27:20PM -0800, Daniel Pittman wrote: In the longer term I would hope to have that information pus

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-02-02 Thread Daniel Pittman
On Wed, Feb 2, 2011 at 17:02, Nigel Kersten wrote: > On Wed, Feb 2, 2011 at 10:52 AM, Ashley Gould wrote: >> On Mon, Jan 31, 2011 at 06:27:20PM -0800, Daniel Pittman wrote: >>> In the longer term I would hope to have that information pushed out >>> from the puppet system, so that if a node *shoul

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-02-02 Thread Nigel Kersten
On Wed, Feb 2, 2011 at 10:52 AM, Ashley Gould wrote: > On Mon, Jan 31, 2011 at 06:27:20PM -0800, Daniel Pittman wrote: >> In the longer term I would hope to have that information pushed out >> from the puppet system, so that if a node *should* be joined with >> centrifyDC puppet will make it so, b

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-02-02 Thread Ashley Gould
On Mon, Jan 31, 2011 at 06:27:20PM -0800, Daniel Pittman wrote: > In the longer term I would hope to have that information pushed out > from the puppet system, so that if a node *should* be joined with > centrifyDC puppet will make it so, but until then what you have is > great. I have considered

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-01-31 Thread Daniel Pittman
On Mon, Jan 31, 2011 at 18:14, Ashley Gould wrote: >> > thank you both. my current task will use a file action. I'm trying >> > to make puppet chose between alturnative versions of a file based on >> > the result of a binary. [...] > You caught me.  I'm a recoveing cfengine junky.  It will take

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-01-31 Thread Ashley Gould
> > thank you both. my current task will use a file action. I'm trying > > to make puppet chose between alturnative versions of a file based on > > the result of a binary. > > > > I will work on the custom fact idea.  if such an issue is coming at > > me so early in the game, then I may as well get

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-01-31 Thread Daniel Pittman
On Mon, Jan 31, 2011 at 15:31, Ashley Gould wrote: > On Mon, Jan 31, 2011 at 02:14:29PM -0800, jcbollinger wrote: >> On Jan 31, 3:12 pm, Ashley Gould wrote: >> >> > if [ "/usr/bin/my_harmless_binary 2>&1 >/dev/null" ]; then >> >   echo "my_harmless_binary succeeded" >> >   cp /tmp/file1 /data/ >>

Re: [Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-01-31 Thread Ashley Gould
On Mon, Jan 31, 2011 at 02:14:29PM -0800, jcbollinger wrote: > > On Jan 31, 3:12 pm, Ashley Gould wrote: > > if [ "/usr/bin/my_harmless_binary 2>&1 >/dev/null" ]; then > >   echo "my_harmless_binary succeeded" > >   cp /tmp/file1 /data/ > > else > >   echo "my_harmless_binary FAILED" > > fi > >

[Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-01-31 Thread jcbollinger
On Jan 31, 3:12 pm, Ashley Gould wrote: > Hi all, > > My first post.  I am just getting started with puppet and have made > good progress with some basics using templates and files. > > I would like to perform and an action based on whether or not a > particular system binary executes successfull

[Puppet Users] Re: using return value of a shell command as a puppet conditional

2011-01-31 Thread cyrus
If I understand your question you want to use the exec resource and specify the onlyif (or unless) parameter. Sort of like: exec { "cp /tmp/file1 /data", path => [ "/bin" ], onlyif => "/usr/bin/my_harmless_binary"; } On Jan 31, 2:12 pm, Ashley Gould wrote: > Hi all, > > My first pos