mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
fix: make the roles work even when hosts are aliased in the inventory (#399)
Signed-off-by: Michal Stanke <michal@stanke.cz>
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
register: _server_config_result
|
||||
|
||||
- name: Init first server node
|
||||
when: inventory_hostname == groups[server_group][0]
|
||||
when: inventory_hostname == groups[server_group][0] or ansible_host == groups[server_group][0]
|
||||
block:
|
||||
- name: Copy K3s service file [Single]
|
||||
when: groups[server_group] | length == 1 or use_external_database
|
||||
@@ -205,7 +205,7 @@
|
||||
- name: Start other server if any and verify status
|
||||
when:
|
||||
- (groups[server_group] | length) > 1
|
||||
- inventory_hostname != groups[server_group][0]
|
||||
- inventory_hostname != groups[server_group][0] and ansible_host != groups[server_group][0]
|
||||
block:
|
||||
- name: Get the token from the first server
|
||||
ansible.builtin.set_fact:
|
||||
|
||||
Reference in New Issue
Block a user