Skip to content

Commit a19c3e8

Browse files
committed
fixes lablabs/ansible-role-rke2/#333 get rke2_node_name for only hosts in current cluster inventory group
1 parent 602b420 commit a19c3e8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tasks/first_server.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@
168168

169169
- name: Get all node names
170170
ansible.builtin.set_fact:
171-
node_names: "{{ hostvars | dict2items | map(attribute='value.rke2_node_name') }}"
172-
run_once: true
173-
register: node_names
171+
node_names: "{{ groups[rke2_cluster_group_name] | map('extract', hostvars) | map(attribute='rke2_node_name') }}"
174172

175173
- name: Remove old <node>.node-password.rke2 secrets
176174
ansible.builtin.shell: |

0 commit comments

Comments
 (0)