Compare commits
1 Commits
v2026.02.0
...
v2026.02.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b3584fa9e |
@@ -61,8 +61,8 @@ def generate_inventory(servers: Dict[str, Server], flows: List[Flow]) -> Dict[st
|
||||
match_count += 1
|
||||
|
||||
# Prepare host entry if new
|
||||
# We use the IP as the key in inventory 'hosts'
|
||||
host_key = server.ip_address
|
||||
# We use the Reference/Hostname as the key in inventory 'hosts'
|
||||
host_key = server.reference or server.hostname or server.ip_address
|
||||
|
||||
if host_key not in inventory_hosts:
|
||||
host_vars = server.get_ansible_vars()
|
||||
|
||||
@@ -23,6 +23,9 @@ class Server:
|
||||
# Default ssh is usually fine, but being explicit doesn't hurt
|
||||
pass
|
||||
|
||||
if self.ip_address:
|
||||
vars['ansible_host'] = self.ip_address
|
||||
|
||||
return vars
|
||||
|
||||
@dataclass
|
||||
|
||||
Reference in New Issue
Block a user