From 87ad95a0add82016dc386ef44c858ba4f8e52d2c Mon Sep 17 00:00:00 2001 From: "Jonas L." Date: Tue, 6 Aug 2024 12:50:58 +0200 Subject: [PATCH] test: use shared network zone variable (#543) ##### SUMMARY Allow to easily update the network zone when changing the location, for testing. --- .../integration/common/defaults/main/common.yml | 2 ++ .../targets/certificate/defaults/main/common.yml | 2 ++ .../certificate_info/defaults/main/common.yml | 2 ++ .../datacenter_info/defaults/main/common.yml | 2 ++ .../targets/firewall/defaults/main/common.yml | 2 ++ .../firewall_info/defaults/main/common.yml | 2 ++ .../firewall_resource/defaults/main/common.yml | 2 ++ .../targets/floating_ip/defaults/main/common.yml | 2 ++ .../floating_ip_info/defaults/main/common.yml | 2 ++ .../targets/image_info/defaults/main/common.yml | 2 ++ .../targets/iso_info/defaults/main/common.yml | 2 ++ .../load_balancer/defaults/main/common.yml | 2 ++ .../targets/load_balancer/tasks/test.yml | 6 +++--- .../load_balancer_info/defaults/main/common.yml | 2 ++ .../targets/load_balancer_info/tasks/prepare.yml | 2 +- .../defaults/main/common.yml | 2 ++ .../targets/load_balancer_network/tasks/test.yml | 4 ++-- .../defaults/main/common.yml | 2 ++ .../defaults/main/common.yml | 2 ++ .../defaults/main/common.yml | 2 ++ .../location_info/defaults/main/common.yml | 2 ++ .../targets/network/defaults/main/common.yml | 2 ++ .../network_info/defaults/main/common.yml | 2 ++ .../targets/network_info/tasks/prepare.yml | 2 +- .../placement_group/defaults/main/common.yml | 2 ++ .../targets/primary_ip/defaults/main/common.yml | 2 ++ .../primary_ip_info/defaults/main/common.yml | 2 ++ .../targets/rdns/defaults/main/common.yml | 2 ++ tests/integration/targets/rdns/tasks/prepare.yml | 2 +- .../targets/route/defaults/main/common.yml | 2 ++ .../targets/server/defaults/main/common.yml | 2 ++ .../targets/server/tasks/test_basic.yml | 1 + .../server/tasks/test_private_network_only.yml | 8 ++++---- .../targets/server_info/defaults/main/common.yml | 2 ++ .../server_network/defaults/main/common.yml | 2 ++ .../targets/server_network/tasks/prepare.yml | 2 +- .../server_type_info/defaults/main/common.yml | 2 ++ .../targets/ssh_key/defaults/main/common.yml | 2 ++ .../ssh_key_info/defaults/main/common.yml | 2 ++ .../targets/subnetwork/defaults/main/common.yml | 2 ++ .../targets/subnetwork/tasks/test.yml | 16 ++++++++-------- .../targets/volume/defaults/main/common.yml | 2 ++ .../targets/volume_info/defaults/main/common.yml | 2 ++ 43 files changed, 90 insertions(+), 21 deletions(-) diff --git a/tests/integration/common/defaults/main/common.yml b/tests/integration/common/defaults/main/common.yml index 89d1a81..e8e4a1b 100644 --- a/tests/integration/common/defaults/main/common.yml +++ b/tests/integration/common/defaults/main/common.yml @@ -22,3 +22,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/certificate/defaults/main/common.yml b/tests/integration/targets/certificate/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/certificate/defaults/main/common.yml +++ b/tests/integration/targets/certificate/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/certificate_info/defaults/main/common.yml b/tests/integration/targets/certificate_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/certificate_info/defaults/main/common.yml +++ b/tests/integration/targets/certificate_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/datacenter_info/defaults/main/common.yml b/tests/integration/targets/datacenter_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/datacenter_info/defaults/main/common.yml +++ b/tests/integration/targets/datacenter_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/firewall/defaults/main/common.yml b/tests/integration/targets/firewall/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/firewall/defaults/main/common.yml +++ b/tests/integration/targets/firewall/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/firewall_info/defaults/main/common.yml b/tests/integration/targets/firewall_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/firewall_info/defaults/main/common.yml +++ b/tests/integration/targets/firewall_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/firewall_resource/defaults/main/common.yml b/tests/integration/targets/firewall_resource/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/firewall_resource/defaults/main/common.yml +++ b/tests/integration/targets/firewall_resource/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/floating_ip/defaults/main/common.yml b/tests/integration/targets/floating_ip/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/floating_ip/defaults/main/common.yml +++ b/tests/integration/targets/floating_ip/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/floating_ip_info/defaults/main/common.yml b/tests/integration/targets/floating_ip_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/floating_ip_info/defaults/main/common.yml +++ b/tests/integration/targets/floating_ip_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/image_info/defaults/main/common.yml b/tests/integration/targets/image_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/image_info/defaults/main/common.yml +++ b/tests/integration/targets/image_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/iso_info/defaults/main/common.yml b/tests/integration/targets/iso_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/iso_info/defaults/main/common.yml +++ b/tests/integration/targets/iso_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/load_balancer/defaults/main/common.yml b/tests/integration/targets/load_balancer/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/load_balancer/defaults/main/common.yml +++ b/tests/integration/targets/load_balancer/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/load_balancer/tasks/test.yml b/tests/integration/targets/load_balancer/tasks/test.yml index 3bce75b..01e7135 100644 --- a/tests/integration/targets/load_balancer/tasks/test.yml +++ b/tests/integration/targets/load_balancer/tasks/test.yml @@ -17,7 +17,7 @@ hetzner.hcloud.load_balancer: name: "{{ hcloud_load_balancer_name }}" load_balancer_type: lb11 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" state: present check_mode: true register: result @@ -30,7 +30,7 @@ hetzner.hcloud.load_balancer: name: "{{ hcloud_load_balancer_name }}" load_balancer_type: lb11 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" labels: key: value label: value123 @@ -51,7 +51,7 @@ hetzner.hcloud.load_balancer: name: "{{ hcloud_load_balancer_name }}" load_balancer_type: lb11 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" state: present register: result - name: Verify create idempotency diff --git a/tests/integration/targets/load_balancer_info/defaults/main/common.yml b/tests/integration/targets/load_balancer_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/load_balancer_info/defaults/main/common.yml +++ b/tests/integration/targets/load_balancer_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/load_balancer_info/tasks/prepare.yml b/tests/integration/targets/load_balancer_info/tasks/prepare.yml index 881cf07..a603f1d 100644 --- a/tests/integration/targets/load_balancer_info/tasks/prepare.yml +++ b/tests/integration/targets/load_balancer_info/tasks/prepare.yml @@ -12,7 +12,7 @@ hetzner.hcloud.load_balancer: name: "{{ hcloud_load_balancer_name }}" load_balancer_type: lb11 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" labels: key: value register: test_load_balancer diff --git a/tests/integration/targets/load_balancer_network/defaults/main/common.yml b/tests/integration/targets/load_balancer_network/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/load_balancer_network/defaults/main/common.yml +++ b/tests/integration/targets/load_balancer_network/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/load_balancer_network/tasks/test.yml b/tests/integration/targets/load_balancer_network/tasks/test.yml index d3a065e..bdda013 100644 --- a/tests/integration/targets/load_balancer_network/tasks/test.yml +++ b/tests/integration/targets/load_balancer_network/tasks/test.yml @@ -17,7 +17,7 @@ network: "{{ hcloud_network_name }}" ip_range: "10.0.0.0/16" type: "cloud" - network_zone: "eu-central" + network_zone: "{{ hcloud_network_zone_name }}" state: present register: subnetwork - name: verify subnetwork @@ -162,7 +162,7 @@ network: "{{ hcloud_network_name }}" ip_range: "10.0.0.0/16" type: "cloud" - network_zone: "eu-central" + network_zone: "{{ hcloud_network_zone_name }}" state: absent register: result - name: verify cleanup subnetwork diff --git a/tests/integration/targets/load_balancer_service/defaults/main/common.yml b/tests/integration/targets/load_balancer_service/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/load_balancer_service/defaults/main/common.yml +++ b/tests/integration/targets/load_balancer_service/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/load_balancer_target/defaults/main/common.yml b/tests/integration/targets/load_balancer_target/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/load_balancer_target/defaults/main/common.yml +++ b/tests/integration/targets/load_balancer_target/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/load_balancer_type_info/defaults/main/common.yml b/tests/integration/targets/load_balancer_type_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/load_balancer_type_info/defaults/main/common.yml +++ b/tests/integration/targets/load_balancer_type_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/location_info/defaults/main/common.yml b/tests/integration/targets/location_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/location_info/defaults/main/common.yml +++ b/tests/integration/targets/location_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/network/defaults/main/common.yml b/tests/integration/targets/network/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/network/defaults/main/common.yml +++ b/tests/integration/targets/network/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/network_info/defaults/main/common.yml b/tests/integration/targets/network_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/network_info/defaults/main/common.yml +++ b/tests/integration/targets/network_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/network_info/tasks/prepare.yml b/tests/integration/targets/network_info/tasks/prepare.yml index 9a6e618..57c6929 100644 --- a/tests/integration/targets/network_info/tasks/prepare.yml +++ b/tests/integration/targets/network_info/tasks/prepare.yml @@ -11,7 +11,7 @@ hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}" type: server - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" ip_range: 10.0.1.0/24 register: test_subnetwork diff --git a/tests/integration/targets/placement_group/defaults/main/common.yml b/tests/integration/targets/placement_group/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/placement_group/defaults/main/common.yml +++ b/tests/integration/targets/placement_group/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/primary_ip/defaults/main/common.yml b/tests/integration/targets/primary_ip/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/primary_ip/defaults/main/common.yml +++ b/tests/integration/targets/primary_ip/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/primary_ip_info/defaults/main/common.yml b/tests/integration/targets/primary_ip_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/primary_ip_info/defaults/main/common.yml +++ b/tests/integration/targets/primary_ip_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/rdns/defaults/main/common.yml b/tests/integration/targets/rdns/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/rdns/defaults/main/common.yml +++ b/tests/integration/targets/rdns/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/rdns/tasks/prepare.yml b/tests/integration/targets/rdns/tasks/prepare.yml index dbfd6f6..0f96f95 100644 --- a/tests/integration/targets/rdns/tasks/prepare.yml +++ b/tests/integration/targets/rdns/tasks/prepare.yml @@ -28,6 +28,6 @@ hetzner.hcloud.load_balancer: name: "{{ hcloud_load_balancer_name }}" load_balancer_type: lb11 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" state: present register: test_load_balancer diff --git a/tests/integration/targets/route/defaults/main/common.yml b/tests/integration/targets/route/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/route/defaults/main/common.yml +++ b/tests/integration/targets/route/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/server/defaults/main/common.yml b/tests/integration/targets/server/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/server/defaults/main/common.yml +++ b/tests/integration/targets/server/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/server/tasks/test_basic.yml b/tests/integration/targets/server/tasks/test_basic.yml index 0cc90a0..5fe9a41 100644 --- a/tests/integration/targets/server/tasks/test_basic.yml +++ b/tests/integration/targets/server/tasks/test_basic.yml @@ -468,6 +468,7 @@ assert: that: - result is success + - name: test create server with labels hetzner.hcloud.server: name: "{{ hcloud_server_name}}" diff --git a/tests/integration/targets/server/tasks/test_private_network_only.yml b/tests/integration/targets/server/tasks/test_private_network_only.yml index 2ae682e..a329fd4 100644 --- a/tests/integration/targets/server/tasks/test_private_network_only.yml +++ b/tests/integration/targets/server/tasks/test_private_network_only.yml @@ -26,7 +26,7 @@ hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}-1" ip_range: 192.168.0.0/24 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: cloud state: present @@ -34,7 +34,7 @@ hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}-1" ip_range: 192.168.1.0/24 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: cloud state: present @@ -48,7 +48,7 @@ hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}-2" ip_range: 192.168.2.0/24 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: cloud state: present @@ -56,7 +56,7 @@ hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}-2" ip_range: 192.168.3.0/24 - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: cloud state: present diff --git a/tests/integration/targets/server_info/defaults/main/common.yml b/tests/integration/targets/server_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/server_info/defaults/main/common.yml +++ b/tests/integration/targets/server_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/server_network/defaults/main/common.yml b/tests/integration/targets/server_network/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/server_network/defaults/main/common.yml +++ b/tests/integration/targets/server_network/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/server_network/tasks/prepare.yml b/tests/integration/targets/server_network/tasks/prepare.yml index 82b8919..3572a3c 100644 --- a/tests/integration/targets/server_network/tasks/prepare.yml +++ b/tests/integration/targets/server_network/tasks/prepare.yml @@ -11,7 +11,7 @@ hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}" type: server - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" ip_range: 10.0.1.0/24 register: test_subnetwork diff --git a/tests/integration/targets/server_type_info/defaults/main/common.yml b/tests/integration/targets/server_type_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/server_type_info/defaults/main/common.yml +++ b/tests/integration/targets/server_type_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/ssh_key/defaults/main/common.yml b/tests/integration/targets/ssh_key/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/ssh_key/defaults/main/common.yml +++ b/tests/integration/targets/ssh_key/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/ssh_key_info/defaults/main/common.yml b/tests/integration/targets/ssh_key_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/ssh_key_info/defaults/main/common.yml +++ b/tests/integration/targets/ssh_key_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/subnetwork/defaults/main/common.yml b/tests/integration/targets/subnetwork/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/subnetwork/defaults/main/common.yml +++ b/tests/integration/targets/subnetwork/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/subnetwork/tasks/test.yml b/tests/integration/targets/subnetwork/tasks/test.yml index acde98f..8f79916 100644 --- a/tests/integration/targets/subnetwork/tasks/test.yml +++ b/tests/integration/targets/subnetwork/tasks/test.yml @@ -16,7 +16,7 @@ - name: Test create with checkmode hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}" - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: cloud ip_range: 10.0.0.0/24 state: present @@ -30,7 +30,7 @@ - name: Test create hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}" - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: cloud ip_range: 10.0.0.0/24 state: present @@ -40,14 +40,14 @@ that: - result is changed - result.hcloud_subnetwork.network == hcloud_network_name - - result.hcloud_subnetwork.network_zone == "eu-central" + - result.hcloud_subnetwork.network_zone == hcloud_network_zone_name - result.hcloud_subnetwork.type == "cloud" - result.hcloud_subnetwork.ip_range == "10.0.0.0/24" - name: Test create idempotency hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}" - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: cloud ip_range: 10.0.0.0/24 state: present @@ -60,7 +60,7 @@ - name: Test delete hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}" - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: cloud ip_range: 10.0.0.0/24 state: absent @@ -73,7 +73,7 @@ - name: Test create with vswitch hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}" - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: vswitch ip_range: 10.0.1.0/24 vswitch_id: "{{ test_vswitch_id }}" @@ -84,7 +84,7 @@ that: - result is changed - result.hcloud_subnetwork.network == hcloud_network_name - - result.hcloud_subnetwork.network_zone == "eu-central" + - result.hcloud_subnetwork.network_zone == hcloud_network_zone_name - result.hcloud_subnetwork.type == "vswitch" - result.hcloud_subnetwork.ip_range == "10.0.1.0/24" - result.hcloud_subnetwork.vswitch_id | string == test_vswitch_id @@ -92,7 +92,7 @@ - name: Test delete with vswitch hetzner.hcloud.subnetwork: network: "{{ hcloud_network_name }}" - network_zone: eu-central + network_zone: "{{ hcloud_network_zone_name }}" type: vswitch ip_range: 10.0.1.0/24 state: absent diff --git a/tests/integration/targets/volume/defaults/main/common.yml b/tests/integration/targets/volume/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/volume/defaults/main/common.yml +++ b/tests/integration/targets/volume/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central diff --git a/tests/integration/targets/volume_info/defaults/main/common.yml b/tests/integration/targets/volume_info/defaults/main/common.yml index 05fb77c..0b15142 100644 --- a/tests/integration/targets/volume_info/defaults/main/common.yml +++ b/tests/integration/targets/volume_info/defaults/main/common.yml @@ -25,3 +25,5 @@ hcloud_location_name: hel1 hcloud_location_id: 3 hcloud_datacenter_name: hel1-dc2 hcloud_datacenter_id: 3 + +hcloud_network_zone_name: eu-central