After finding the missing pages in my reference guide, I got my module 
exporting an slist. Unfortunately, I'm having trouble expanding the list to use 
it. I'm trying to use the "short-circuit" method described in the reference 
manual, not sure why this isn't working ( output is "R: Test: $(homedirs)" );


bundle agent homedirs
{
vars:

    ldap_users::

        "homedirs"    slist   =>  { @(get_ldap_users.userlist) };

commands:

    testhost:: 

        "/var/cfengine/inputs/modules/get_ldap_users"
             module     =>  "true";

reports:
        
    ldap_users::

        "Test: $(homedirs)";
        
}





community>  -> Executing '/var/cfengine/inputs/modules/get_ldap_users' 
...(timeout=-678,owner=-1,group=-1)
community>  -> (Setting umask to 77)
community> Defined variable: userlist in context get_ldap_users with value: { 
"user1", "user2", "user3", "user4" }
community> M "/var/cfengine/inputs/modules/get_ldap_users":
community> Activated classes: ldap_users
community> M "/var/cfengine/inputs/modules/get_ldap_users":
community>  -> Finished command related to promiser 
"/var/cfengine/inputs/modules/get_ldap_users" -- succeeded
community>  -> Completed execution of 
/var/cfengine/inputs/modules/get_ldap_users
community> 
community>    =========================================================
community>    reports in bundle homedirs (1)
community>    =========================================================
community> 
community> 
community>     .........................................................
community>     Promise handle: 
community>     Promise made by: Test: $(homedirs)
community>     .........................................................
community> 
community> Reporting about this...
community> R: Test: $(homedirs)






On Mar 24, 2011, at 10:44 AM, Mark Burgess wrote:

> 
> See the required syntax in
> 
> http://www.cfengine.org/manuals/cf3-reference.html#module-in-commands
> 
> On 03/24/2011 06:35 PM, Michael Stevens wrote:
>> I need to create local homedirs for ldap users. I can't use the built-in 
>> ldap functions, as we don't permit anonymous binding, so I've written a 
>> module that queries the ldap server and returns a list of users and enables 
>> the class "ldap_users." It works fine, however, it returns a scaler and I 
>> need an slist. I've tried a few things based on what's done in 
>> "unit_module_exec" examples, but haven't been able to get anything to work. 
>> What's the trick?
>> 
>> 
>> bundle agent homedirs
>> {
>> commands:
>> 
>>    testhost:: 
>> 
>>        "/var/cfengine/inputs/modules/get_ldap_users"
>>             module     =>  "true";
>> 
>> reports:
>> 
>>    ldap_users::
>> 
>>        "Test: $(get_ldap_users.ldapusers)";
>> 
>> }
>> 
>> 
>> This returns;
>> 
>> R: Test: user1 user2 user3 user4 <etc>
>> 
>> 
>> 
>> _______________________________________________
>> 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

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

Reply via email to