1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00
hetzner.hcloud/tests/integration/targets/firewall_info/tasks/prepare.yml
Jonas L. c6d7121e9e
test: ensure location is used for tests (#541)
##### SUMMARY

Make sure that the tests uses the `hcloud_location_name` variable for
the tests.
2024-08-06 11:59:31 +02:00

36 lines
938 B
YAML

---
- name: Create test_server
hetzner.hcloud.server:
name: "{{ hcloud_server_name }}"
server_type: "{{ hcloud_server_type_name }}"
image: "{{ hcloud_image_name }}"
location: "{{ hcloud_location_name }}"
labels:
firewall: "{{ hcloud_firewall_name }}"
state: stopped
register: test_server
- name: Create test_firewall
hetzner.hcloud.firewall:
name: "{{ hcloud_firewall_name }}"
labels:
key: value
rules:
- description: allow icmp from anywhere
direction: in
protocol: icmp
source_ips:
- 0.0.0.0/0
- ::/0
state: present
register: test_firewall
- name: Create test_firewall_resource
hetzner.hcloud.firewall_resource:
firewall: "{{ hcloud_firewall_name }}"
servers:
- "{{ hcloud_server_name }}"
label_selectors:
- firewall={{ hcloud_firewall_name }}
state: present
register: test_firewall_resource