mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-12-05 01:59:14 +00:00
refactor: reorder inventory server type host vars (#427)
Outlines the fact that `type` and `server_type` are the same value.
This commit is contained in:
parent
fe4c924594
commit
e4501c1086
1 changed files with 6 additions and 7 deletions
|
@ -169,16 +169,16 @@ if sys.version_info >= (3, 11):
|
|||
id: int
|
||||
name: str
|
||||
status: str
|
||||
|
||||
# Server Type
|
||||
type: str
|
||||
server_type: str
|
||||
architecture: str
|
||||
|
||||
# Datacenter
|
||||
datacenter: str
|
||||
location: str
|
||||
|
||||
# Server Type
|
||||
server_type: NotRequired[str]
|
||||
|
||||
# Labels
|
||||
labels: dict[str, str]
|
||||
|
||||
|
@ -306,7 +306,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
server_dict["id"] = server.id
|
||||
server_dict["name"] = to_native(server.name)
|
||||
server_dict["status"] = to_native(server.status)
|
||||
|
||||
# Server Type
|
||||
server_dict["type"] = to_native(server.server_type.name)
|
||||
server_dict["server_type"] = to_native(server.server_type.name)
|
||||
server_dict["architecture"] = to_native(server.server_type.architecture)
|
||||
|
||||
# Network
|
||||
|
@ -329,10 +332,6 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
server_dict["private_ipv4"] = to_native(private_net.ip)
|
||||
break
|
||||
|
||||
# Server Type
|
||||
if server.server_type is not None:
|
||||
server_dict["server_type"] = to_native(server.server_type.name)
|
||||
|
||||
# Datacenter
|
||||
server_dict["datacenter"] = to_native(server.datacenter.name)
|
||||
server_dict["location"] = to_native(server.datacenter.location.name)
|
||||
|
|
Loading…
Reference in a new issue