1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

fix: also check server type deprecation after server creation (#696)

##### SUMMARY

Because the location of a server is not mandatory for creating a server,
we must also check server type deprecation after server creation.

##### ISSUE TYPE

- Bugfix Pull Request


##### COMPONENT NAME
server
This commit is contained in:
Jonas L. 2025-09-29 14:34:54 +02:00 committed by GitHub
parent 2864379079
commit c4dc19c675
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 7 deletions

View file

@ -475,7 +475,7 @@ class AnsibleHCloudServer(AnsibleHCloud):
if self.module.params.get("state") == "stopped" or self.module.params.get("state") == "created":
params["start_after_create"] = False
deprecated_server_type_warning(
server_type_deprecation_printed = deprecated_server_type_warning(
self.module,
server_type,
server_type_location,
@ -484,6 +484,14 @@ class AnsibleHCloudServer(AnsibleHCloud):
if not self.module.check_mode:
try:
resp = self.client.servers.create(**params)
if not server_type_deprecation_printed:
deprecated_server_type_warning(
self.module,
resp.server.server_type,
resp.server.datacenter.location,
)
self.result["root_password"] = resp.root_password
# Action should take 60 to 90 seconds on average, but can be >10m when creating a
# server from a custom images