Skip to content

Commit 0f0637f

Browse files
authored
fix: registrations.yaml: Register only the remaining not-registered hosts in the last batch
As oposed to the last `size` ones from the file.
1 parent d7f2126 commit 0f0637f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

playbooks/tests/registrations.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939
that: "containers_used_count | int < containers_count | int"
4040

4141
- name: "Generate list of containers we are going to use"
42-
shell:
43-
head -n "{{ containers_used_count|int + size|int }}" /root/container-ips.shuffled | tail -n "{{ size }}" | cut -d ' ' -f 2 > clients.ini
42+
ansible.builtin.shell: |
43+
awk 'NR > {{ containers_used_count | int }} && NR <= {{ containers_used_count | int + size | int }} {print $NF}' \
44+
/root/container-ips.shuffled \
45+
>clients.ini
4446
4547
- name: "Set base log name"
4648
ansible.builtin.set_fact:

0 commit comments

Comments
 (0)