[ansible-project] How to randomize hosts but not repeat the ones that already were selected

2019-01-09 Thread Francis Santos
Hi all, With this script I can randomize any host: --- - hosts: "{{ (groups['all'] | shuffle)[0:1] }}" become: true vars: - ansible_sudo_pass: How can I add the proposition to skip the ones that were selected? So I can use the whole pool of hosts before selecting them again. --

Re: [ansible-project] How to randomize hosts but not repeat the ones that already were selected

2019-01-09 Thread Karl Auer
Do you mean that you want to work through all the hosts in a random order? If so, just shuffle the list, then work through the list in shuffled order. Regards, K. On Thu, Jan 10, 2019 at 12:50 AM Francis Santos wrote: > Hi all, > > With this script I can randomize any host: > > --- > > - host