Re: [Puppet Users] How to randomize the order of server names

2017-07-24 Thread Ramin K
Forgot to reply on list, but we solved it with fqdn_rotate() doing most of the work. $_ldap_servers = ['ldap1','ldap2','ldap3'] $ldap_uri = join(suffix(prefix(fqdn_rotate(sort($_ldap_servers))),'ldaps://'),'/'),' ') Ramin On 7/24/2017 7:24 AM, Rob Nelson wrote: I did just notice this line,

Re: [Puppet Users] How to randomize the order of server names

2017-07-24 Thread Rob Nelson
I did just notice this line, which should remove the .shuffle so it's consistent on every run: server_list = @_ldap_servers.shuffle Rob Nelson rnels...@gmail.com On Mon, Jul 24, 2017 at 7:45 AM, Martijn wrote: > I think that's perfect for the OP's use case. And if you need multiple >

Re: [Puppet Users] How to randomize the order of server names

2017-07-24 Thread Martijn
I think that's perfect for the OP's use case. And if you need multiple random numbers there's a useful second parameter to fqdn_rand(), the "seed", which can be any string or integer and allows you to get multiple different random numbers on the same host. So, you could use the server_list.size

Re: [Puppet Users] How to randomize the order of server names

2017-07-23 Thread Rob Nelson
You could try fqdn_rand(). Fqdn_rand will generate a random number, but the same random number for a given fqdn, so you would get the same value every time rather than it changing. https://docs.puppet.com/puppet/latest/function.html#fqdnrand On Sun, Jul 23, 2017 at 1:20 AM MK wrote: > Does anyon

[Puppet Users] How to randomize the order of server names

2017-07-22 Thread MK
Does anyone have experiences randomizing the order of redundant server names in the client configuration and won't change the order during next puppet agent runs? For example, I have a bunch of ldap slave servers put in an array: $_ldap_servers = ['ldap1' , 'ldap2', 'ldap3'] I want to randomi