Fix issue around using ip addresses in inventory, download and remove agent service properly

Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Derek Nola
2023-11-10 15:17:13 -08:00
parent e01a8a2a8a
commit 3b9982013a
3 changed files with 21 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
---
- name: Init first server node
when: ansible_hostname == groups['server'][0]
# Handle both hostname OR ip address being supplied in inventory
when: ansible_hostname == groups['server'][0] or groups['server'][0] in ansible_facts['all_ipv4_addresses']
block:
- name: Copy K3s service file [Single]
when: groups['server'] | length == 1