On Mon, Dec 13, 2010 at 12:56 PM, Yushu Yao <[email protected]> wrote:

> Another though:
>
> Can I do something like
> if $(return value of an Exec resource)==0 {
> } else {}
>
> I.e. I want to run an shell command first, and do something depend on the
> output of the command.
>

You probably want to make the shell command a fact, and then case on the
fact inside your manifests on the server.

Facts are synced at the start of the run and evaluated.


>
> Thanks
>
>
> -Yushu
>
> +-------------------------------------------------+
> | Yushu Yao
> | Ph:1-510-486-4690
> |
> | Lawrence Berkeley National Lab
> | Mailstop 50B-6222
> | 1 Cyclotron Road
> | Berkeley CA 94720-8147 - USA
> +-------------------------------------------------+
>
>
>
>
> On Mon, Dec 13, 2010 at 11:12 AM, Yushu Yao <[email protected]> wrote:
>
>> Thanks,
>>
>> Another question, when are the facts loaded? In the beginning of the
>> puppetd run?
>>
>> -Yushu
>>
>> +-------------------------------------------------+
>> | Yushu Yao
>> | Ph:1-510-486-4690
>> |
>> | Lawrence Berkeley National Lab
>> | Mailstop 50B-6222
>> | 1 Cyclotron Road
>> | Berkeley CA 94720-8147 - USA
>> +-------------------------------------------------+
>>
>>
>>
>>
>> On Mon, Dec 13, 2010 at 11:08 AM, Eric Sorenson <[email protected]>wrote:
>>
>>>
>>> On Dec 13, 2010, at 10:59 AM, Yushu Yao wrote:
>>>
>>> I am trying to implement some function tests. E.g. in my catalog for node
>>> B there is LDAP client, however, I would like to do a test to see if the
>>> LDAP server is already up and running. And decide if I want to apply the
>>> LDAP Client or not. (This is a test on remote resource, I might also need to
>>> test a resource local to the client, e.g. existence of a file, a service is
>>> running, etc).
>>>
>>> Maybe I can use custom facter for this?
>>>
>>>
>>> You could do that, but a more puppet-y way to think about this is to
>>> decide what hosts ought to be servers and use puppet to start the service
>>> there. Puppet thinks you should be the boss of your machines.
>>>
>>>
>>>   - Eric Sorenson - N37 17.255 W121 55.738  - http://twitter.com/ahpook
>>>   -
>>>
>>>  --
>>> 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]<puppet-users%[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]<puppet-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>



-- 
Nigel Kersten - Puppet Labs -  http://www.puppetlabs.com

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