Also we can use function classify() to transform the fq hostname to canonical 
form. :-)

        "policy_hosts" expression =>  classify("cfengine.domain.com"),
           handle => "global_classes";

        "policy_hosts" or =>  {classify("cfengine.domain.com")},
           handle => "global_classes";

Cheers,
--Nakarin

On May 5, 2010, at 9:24 PM, Sandra Wittenbrock wrote:

> Justin,
> 
> Thanks for the swift response.  And your suggestion worked!  It was that easy.
> 
> Sandra
> 
> Justin Lloyd wrote:
>> Sandra,
>> The one thing that initially catches my eye is your definition of the
>> policy_hosts class. In your class list, you have a fully-qualified
>> hostname with dots but Cfengine "canonifies" all classes, turning dots
>> and other non-alphanumeric characters (dashes, etc.) into underscores.
>> So try this:
>>      "policy_hosts" => { "cfengine_domain_com" },
>>            handle => "global_classes";
>> Justin
>> -----Original Message-----
>> From: help-cfengine-boun...@cfengine.org
>> [mailto:help-cfengine-boun...@cfengine.org] On Behalf Of Sandra
>> Wittenbrock
>> Sent: Wednesday, May 05, 2010 12:36 PM
>> To: help-cfengine@cfengine.org
>> Subject: defining classes
>> Hello,
>> I've been playing with cfengine for a while, copying configurations, and
>> running them on my systems. Now I need to make then do what I need them to 
>> do.  For this I need to
>> define classes.  I've been able to use hard classes to select when some 
>> bundles are run, however
>> I've been unable to get the soft classes, I define, to work.
>> When I run cf-agent, the output tells me:
>> Skipping whole next promise (test1 Success policy_hosts defined), as c
>> ontext policy_hosts is not relevant
>> Here is the promises.cf file:
>> # Promises.cf
>> body common control
>> {
>> version => "0.1.1";
>> bundlesequence  => {
>>                      "g"
>>                 };
>> }
>>      
>> bundle common g{
>> # vars referred to as ${g.masterfiles} etc
>>     vars:
>>      "masterfiles" string => "/var/cfengine/masterfiles";
>>      "inputs" string => "${masterfiles}/inputs";
>>      "workdir" string => "/var/cfengine";
>> # add policy hosts, we only have one, 192.168.30.58
>>         "phost" string => "192.168.30.58";
>> # define classes
>>     classes:
>>      "policy_hosts" => { "cfengine.domain.com" },
>>            handle => "global_classes";
>> # The following reports section just tests the class definition
>>     reports:
>>      policy_hosts::
>>         "test1";
>>      linux::
>>         "test2";
>> }
>> Thank you
>> This electronic communication and any attachments may contain confidential 
>> and proprietary information of DigitalGlobe, Inc. If you are not the 
>> intended recipient, or an agent or employee responsible for delivering this 
>> communication to the intended recipient, or if you have received this 
>> communication in error, please do not print, copy, retransmit, disseminate 
>> or otherwise use the information. Please indicate to the sender that you 
>> have received this communication in error, and delete the copy you received. 
>> DigitalGlobe reserves the right to monitor any electronic communication sent 
>> or received by its employees, agents or representatives.
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to