Let's start with two example problems:
1) Select the first available value in an address space. For example
openldap syncrepl rid, "ID uniquely identifying the replica .. an
integer which has no more than three decimal digits"[1].
2) Selecting a sticky "random" value from an array of values. In this
example choosing an available server(s) to query for directory
services. Reselection should be limited to a change in array size, or
possibly selected value deletion.

I've got this mostly 'solved' using a combination of exported files, a
lookup function, and a temp variable. But it seems awfully hacky and
wasteful. The problems seems close to RI Pienaars extlookup[2], or
Lukes data loading system[3], or even concatenated file fragments. The
key difference from [2] and [3] is that my source data is dynamically
generated by other nodes. Has anyone solved a similar issue? Or see a
good path to take on this?

So my current 'solution' in quick psuedo manifest:

class openldap::replica {
    File <<| tag == $ldap_cluster |>>
    file { "/var/puppet/lib/ldap_replicas": ensure => directory, purge
=> true; }
    @@file{ "/var/puppet/lib/ldap_replicas/$fqdn": content =>
$ldap_rid, tag => $ldap_cluster }
    $ldap_rid = ext_lookup("ldap_replicas", "available")
    augeas {"slapd.conf_rid": changes => "set /files/etc/openldap/
slapd.conf/syncrepl/rid $ldap_rid" }
}

And what I think it might look like. This could be as simple as
defines, or an actual Type and a function that starts poking into the
compiler/catalog.

@@dkv_put{ $fqdn: key => "ldap_rid", value => $ldap_rid, tag =>
$ldap_cluster }
$ldap_rid = dkv_get( key => "ldap_rid", sort => "available", count =>
"1", tag => $ldap_cluster )

[1] http://www.openldap.org/doc/admin22/syncrepl.html
[2] http://www.devco.net/archives/2009/08/31/complex_data_and_puppet.php
[3] http://projects.reductivelabs.com/issues/2953

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to