mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
refactor: start using new modules names (#393)
##### SUMMARY Update all references to modules to use the new module names. Continuation of #390
This commit is contained in:
parent
933a16249b
commit
328dfb8b0f
95 changed files with 577 additions and 577 deletions
|
|
@ -23,7 +23,7 @@ The `main` branch is used for the development of the latest versions of the coll
|
||||||
|
|
||||||
The documentation for all modules are available through `ansible-doc`.
|
The documentation for all modules are available through `ansible-doc`.
|
||||||
|
|
||||||
Sample: `ansible-doc hetzner.hcloud.hcloud_server` shows the documentation for the `hcloud_server` module.
|
Sample: `ansible-doc hetzner.hcloud.server` shows the documentation for the `server` module.
|
||||||
|
|
||||||
For all modules that were part of Ansible directly (before Ansible 2.11) we also have the documentation published in the
|
For all modules that were part of Ansible directly (before Ansible 2.11) we also have the documentation published in the
|
||||||
Ansible documentation: https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud/
|
Ansible documentation: https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud/
|
||||||
|
|
@ -56,7 +56,7 @@ After this you should be able to use `ansible-test integration` to perform the i
|
||||||
Sample:
|
Sample:
|
||||||
|
|
||||||
```
|
```
|
||||||
ansible-test integration --color --local -vvv hcloud_server // Executed all integration tests for hcloud_server module
|
ansible-test integration --color --local -vvv hetzner.hcloud.server // Executed all integration tests for server module
|
||||||
```
|
```
|
||||||
|
|
||||||
## Releasing a new version
|
## Releasing a new version
|
||||||
|
|
|
||||||
|
|
@ -68,14 +68,14 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic certificate
|
- name: Create a basic certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: my-certificate
|
name: my-certificate
|
||||||
certificate: -----BEGIN CERTIFICATE-----...
|
certificate: -----BEGIN CERTIFICATE-----...
|
||||||
private_key: -----BEGIN PRIVATE KEY-----...
|
private_key: -----BEGIN PRIVATE KEY-----...
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a certificate with labels
|
- name: Create a certificate with labels
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: my-certificate
|
name: my-certificate
|
||||||
certificate: -----BEGIN CERTIFICATE-----...
|
certificate: -----BEGIN CERTIFICATE-----...
|
||||||
private_key: -----BEGIN PRIVATE KEY-----...
|
private_key: -----BEGIN PRIVATE KEY-----...
|
||||||
|
|
@ -85,7 +85,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a managed certificate
|
- name: Create a managed certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: my-certificate
|
name: my-certificate
|
||||||
type: managed
|
type: managed
|
||||||
domain_names:
|
domain_names:
|
||||||
|
|
@ -94,7 +94,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the certificate is absent (remove if needed)
|
- name: Ensure the certificate is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: my-certificate
|
name: my-certificate
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud certificate infos
|
- name: Gather hcloud certificate infos
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
register: output
|
register: output
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
debug:
|
debug:
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud datacenter info
|
- name: Gather hcloud datacenter info
|
||||||
hetzner.hcloud.hcloud_datacenter_info:
|
hetzner.hcloud.datacenter_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Print the gathered info
|
- name: Print the gathered info
|
||||||
|
|
@ -43,12 +43,12 @@ EXAMPLES = """
|
||||||
- name: List available server_types in a datacenter
|
- name: List available server_types in a datacenter
|
||||||
block:
|
block:
|
||||||
- name: Gather a hcloud datacenter
|
- name: Gather a hcloud datacenter
|
||||||
hetzner.hcloud.hcloud_datacenter_info:
|
hetzner.hcloud.datacenter_info:
|
||||||
name: fsn1-dc14
|
name: fsn1-dc14
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Gather a hcloud datacenter available server_types
|
- name: Gather a hcloud datacenter available server_types
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
id: "{{ item }}"
|
id: "{{ item }}"
|
||||||
loop: "{{ output.hcloud_datacenter_info[0].server_types.available }}"
|
loop: "{{ output.hcloud_datacenter_info[0].server_types.available }}"
|
||||||
register: available_server_types
|
register: available_server_types
|
||||||
|
|
|
||||||
|
|
@ -80,12 +80,12 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic firewall
|
- name: Create a basic firewall
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: my-firewall
|
name: my-firewall
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a firewall with rules
|
- name: Create a firewall with rules
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: my-firewall
|
name: my-firewall
|
||||||
rules:
|
rules:
|
||||||
- direction: in
|
- direction: in
|
||||||
|
|
@ -97,7 +97,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a firewall with labels
|
- name: Create a firewall with labels
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: my-firewall
|
name: my-firewall
|
||||||
labels:
|
labels:
|
||||||
key: value
|
key: value
|
||||||
|
|
@ -105,7 +105,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the firewall is absent (remove if needed)
|
- name: Ensure the firewall is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: my-firewall
|
name: my-firewall
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -73,30 +73,30 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic IPv4 Floating IP
|
- name: Create a basic IPv4 Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: my-floating-ip
|
name: my-floating-ip
|
||||||
home_location: fsn1
|
home_location: fsn1
|
||||||
type: ipv4
|
type: ipv4
|
||||||
state: present
|
state: present
|
||||||
- name: Create a basic IPv6 Floating IP
|
- name: Create a basic IPv6 Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: my-floating-ip
|
name: my-floating-ip
|
||||||
home_location: fsn1
|
home_location: fsn1
|
||||||
type: ipv6
|
type: ipv6
|
||||||
state: present
|
state: present
|
||||||
- name: Assign a Floating IP to a server
|
- name: Assign a Floating IP to a server
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: my-floating-ip
|
name: my-floating-ip
|
||||||
server: 1234
|
server: 1234
|
||||||
state: present
|
state: present
|
||||||
- name: Assign a Floating IP to another server
|
- name: Assign a Floating IP to another server
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: my-floating-ip
|
name: my-floating-ip
|
||||||
server: 1234
|
server: 1234
|
||||||
force: true
|
force: true
|
||||||
state: present
|
state: present
|
||||||
- name: Floating IP should be absent
|
- name: Floating IP should be absent
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: my-floating-ip
|
name: my-floating-ip
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud Floating ip infos
|
- name: Gather hcloud Floating ip infos
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
register: output
|
register: output
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
debug:
|
debug:
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud image infos
|
- name: Gather hcloud image infos
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud ISO type infos
|
- name: Gather hcloud ISO type infos
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.iso_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic Load Balancer
|
- name: Create a basic Load Balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: my-Load Balancer
|
name: my-Load Balancer
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
algorithm: round_robin
|
algorithm: round_robin
|
||||||
|
|
@ -81,7 +81,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the Load Balancer is absent (remove if needed)
|
- name: Ensure the Load Balancer is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: my-Load Balancer
|
name: my-Load Balancer
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud load_balancer infos
|
- name: Gather hcloud load_balancer infos
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
|
|
@ -134,7 +134,7 @@ hcloud_load_balancer_info:
|
||||||
use_private_ip:
|
use_private_ip:
|
||||||
description:
|
description:
|
||||||
- Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network.
|
- Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network.
|
||||||
- Load Balancer needs to be attached to a network. See M(hetzner.hcloud.hcloud_load_balancer_network)
|
- Load Balancer needs to be attached to a network. See M(hetzner.hcloud.load_balancer_network)
|
||||||
type: bool
|
type: bool
|
||||||
sample: true
|
sample: true
|
||||||
returned: always
|
returned: always
|
||||||
|
|
|
||||||
|
|
@ -45,20 +45,20 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic Load Balancer network
|
- name: Create a basic Load Balancer network
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: my-network
|
network: my-network
|
||||||
load_balancer: my-LoadBalancer
|
load_balancer: my-LoadBalancer
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a Load Balancer network and specify the ip address
|
- name: Create a Load Balancer network and specify the ip address
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: my-network
|
network: my-network
|
||||||
load_balancer: my-LoadBalancer
|
load_balancer: my-LoadBalancer
|
||||||
ip: 10.0.0.1
|
ip: 10.0.0.1
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the Load Balancer network is absent (remove if needed)
|
- name: Ensure the Load Balancer network is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: my-network
|
network: my-network
|
||||||
load_balancer: my-LoadBalancer
|
load_balancer: my-LoadBalancer
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -137,14 +137,14 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic Load Balancer service with Port 80
|
- name: Create a basic Load Balancer service with Port 80
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: my-load-balancer
|
load_balancer: my-load-balancer
|
||||||
protocol: http
|
protocol: http
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the Load Balancer is absent (remove if needed)
|
- name: Ensure the Load Balancer is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: my-Load Balancer
|
load_balancer: my-Load Balancer
|
||||||
protocol: http
|
protocol: http
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ options:
|
||||||
use_private_ip:
|
use_private_ip:
|
||||||
description:
|
description:
|
||||||
- Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network.
|
- Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network.
|
||||||
- Load Balancer needs to be attached to a network. See M(hetzner.hcloud.hcloud_load_balancer_network)
|
- Load Balancer needs to be attached to a network. See M(hetzner.hcloud.load_balancer_network)
|
||||||
type: bool
|
type: bool
|
||||||
default: False
|
default: False
|
||||||
state:
|
state:
|
||||||
|
|
@ -63,28 +63,28 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a server Load Balancer target
|
- name: Create a server Load Balancer target
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: server
|
type: server
|
||||||
load_balancer: my-LoadBalancer
|
load_balancer: my-LoadBalancer
|
||||||
server: my-server
|
server: my-server
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a label_selector Load Balancer target
|
- name: Create a label_selector Load Balancer target
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: label_selector
|
type: label_selector
|
||||||
load_balancer: my-LoadBalancer
|
load_balancer: my-LoadBalancer
|
||||||
label_selector: application=backend
|
label_selector: application=backend
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create an IP Load Balancer target
|
- name: Create an IP Load Balancer target
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: ip
|
type: ip
|
||||||
load_balancer: my-LoadBalancer
|
load_balancer: my-LoadBalancer
|
||||||
ip: 127.0.0.1
|
ip: 127.0.0.1
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the Load Balancer target is absent (remove if needed)
|
- name: Ensure the Load Balancer target is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: server
|
type: server
|
||||||
load_balancer: my-LoadBalancer
|
load_balancer: my-LoadBalancer
|
||||||
server: my-server
|
server: my-server
|
||||||
|
|
@ -125,7 +125,7 @@ hcloud_load_balancer_target:
|
||||||
use_private_ip:
|
use_private_ip:
|
||||||
description:
|
description:
|
||||||
- Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network.
|
- Route the traffic over the private IP of the Load Balancer through a Hetzner Cloud Network.
|
||||||
- Load Balancer needs to be attached to a network. See M(hetzner.hcloud.hcloud_load_balancer_network)
|
- Load Balancer needs to be attached to a network. See M(hetzner.hcloud.load_balancer_network)
|
||||||
type: bool
|
type: bool
|
||||||
sample: true
|
sample: true
|
||||||
returned: always
|
returned: always
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud Load Balancer type infos
|
- name: Gather hcloud Load Balancer type infos
|
||||||
hetzner.hcloud.hcloud_load_balancer_type_info:
|
hetzner.hcloud.load_balancer_type_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud location infos
|
- name: Gather hcloud location infos
|
||||||
hetzner.hcloud.hcloud_location_info:
|
hetzner.hcloud.location_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
|
|
|
||||||
|
|
@ -60,13 +60,13 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic network
|
- name: Create a basic network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: my-network
|
name: my-network
|
||||||
ip_range: 10.0.0.0/8
|
ip_range: 10.0.0.0/8
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the Network is absent (remove if needed)
|
- name: Ensure the Network is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: my-network
|
name: my-network
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -49,13 +49,13 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic placement group
|
- name: Create a basic placement group
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
name: my-placement-group
|
name: my-placement-group
|
||||||
state: present
|
state: present
|
||||||
type: spread
|
type: spread
|
||||||
|
|
||||||
- name: Create a placement group with labels
|
- name: Create a placement group with labels
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
name: my-placement-group
|
name: my-placement-group
|
||||||
type: spread
|
type: spread
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -64,7 +64,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the placement group is absent (remove if needed)
|
- name: Ensure the placement group is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
name: my-placement-group
|
name: my-placement-group
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -65,19 +65,19 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic IPv4 Primary IP
|
- name: Create a basic IPv4 Primary IP
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: my-primary-ip
|
name: my-primary-ip
|
||||||
datacenter: fsn1-dc14
|
datacenter: fsn1-dc14
|
||||||
type: ipv4
|
type: ipv4
|
||||||
state: present
|
state: present
|
||||||
- name: Create a basic IPv6 Primary IP
|
- name: Create a basic IPv6 Primary IP
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: my-primary-ip
|
name: my-primary-ip
|
||||||
datacenter: fsn1-dc14
|
datacenter: fsn1-dc14
|
||||||
type: ipv6
|
type: ipv6
|
||||||
state: present
|
state: present
|
||||||
- name: Primary IP should be absent
|
- name: Primary IP should be absent
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: my-primary-ip
|
name: my-primary-ip
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -38,21 +38,21 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud Primary IP infos
|
- name: Gather hcloud Primary IP infos
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Gather hcloud Primary IP infos by id
|
- name: Gather hcloud Primary IP infos by id
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
id: 673954
|
id: 673954
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Gather hcloud Primary IP infos by name
|
- name: Gather hcloud Primary IP infos by name
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
name: srv1-v4
|
name: srv1-v4
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Gather hcloud Primary IP infos by label
|
- name: Gather hcloud Primary IP infos by label
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
label_selector: srv03-ips
|
label_selector: srv03-ips
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,35 +57,35 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a reverse DNS entry for a server
|
- name: Create a reverse DNS entry for a server
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: my-server
|
server: my-server
|
||||||
ip_address: 123.123.123.123
|
ip_address: 123.123.123.123
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a reverse DNS entry for a Floating IP
|
- name: Create a reverse DNS entry for a Floating IP
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
floating_ip: my-floating-ip
|
floating_ip: my-floating-ip
|
||||||
ip_address: 123.123.123.123
|
ip_address: 123.123.123.123
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a reverse DNS entry for a Primary IP
|
- name: Create a reverse DNS entry for a Primary IP
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
primary_ip: my-primary-ip
|
primary_ip: my-primary-ip
|
||||||
ip_address: 123.123.123.123
|
ip_address: 123.123.123.123
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a reverse DNS entry for a Load Balancer
|
- name: Create a reverse DNS entry for a Load Balancer
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
load_balancer: my-load-balancer
|
load_balancer: my-load-balancer
|
||||||
ip_address: 123.123.123.123
|
ip_address: 123.123.123.123
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the reverse DNS entry is absent (remove if needed)
|
- name: Ensure the reverse DNS entry is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: my-server
|
server: my-server
|
||||||
ip_address: 123.123.123.123
|
ip_address: 123.123.123.123
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
|
||||||
|
|
@ -46,14 +46,14 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic route
|
- name: Create a basic route
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
network: my-network
|
network: my-network
|
||||||
destination: 10.100.1.0/24
|
destination: 10.100.1.0/24
|
||||||
gateway: 10.0.1.1
|
gateway: 10.0.1.1
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the route is absent
|
- name: Ensure the route is absent
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
network: my-network
|
network: my-network
|
||||||
destination: 10.100.1.0/24
|
destination: 10.100.1.0/24
|
||||||
gateway: 10.0.1.1
|
gateway: 10.0.1.1
|
||||||
|
|
|
||||||
|
|
@ -157,14 +157,14 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic server
|
- name: Create a basic server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a basic server with ssh key
|
- name: Create a basic server with ssh key
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -174,59 +174,59 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Resize an existing server
|
- name: Resize an existing server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
server_type: cx21
|
server_type: cx21
|
||||||
upgrade_disk: true
|
upgrade_disk: true
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the server is absent (remove if needed)
|
- name: Ensure the server is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Ensure the server is started
|
- name: Ensure the server is started
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Ensure the server is stopped
|
- name: Ensure the server is stopped
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
||||||
- name: Ensure the server is restarted
|
- name: Ensure the server is restarted
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: Ensure the server is will be booted in rescue mode and therefore restarted
|
- name: Ensure the server is will be booted in rescue mode and therefore restarted
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
rescue_mode: linux64
|
rescue_mode: linux64
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: Ensure the server is rebuild
|
- name: Ensure the server is rebuild
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
state: rebuild
|
state: rebuild
|
||||||
|
|
||||||
- name: Add server to placement group
|
- name: Add server to placement group
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
placement_group: my-placement-group
|
placement_group: my-placement-group
|
||||||
force: true
|
force: true
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Remove server from placement group
|
- name: Remove server from placement group
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
placement_group:
|
placement_group:
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Add server with private network only
|
- name: Add server with private network only
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: my-server
|
name: my-server
|
||||||
enable_ipv4: false
|
enable_ipv4: false
|
||||||
enable_ipv6: false
|
enable_ipv6: false
|
||||||
|
|
@ -553,7 +553,7 @@ class AnsibleHCloudServer(AnsibleHCloud):
|
||||||
"no longer be ordered. Existing servers of that plan will continue to "
|
"no longer be ordered. Existing servers of that plan will continue to "
|
||||||
"work as before and no action is required on your part. "
|
"work as before and no action is required on your part. "
|
||||||
"It is possible to migrate this server to another server plan by setting "
|
"It is possible to migrate this server to another server plan by setting "
|
||||||
"the server_type parameter on the hetzner.hcloud.hcloud_server module."
|
"the server_type parameter on the hetzner.hcloud.server module."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
server_type_unavailable_date = server_type.deprecation.unavailable_after.strftime("%Y-%m-%d")
|
server_type_unavailable_date = server_type.deprecation.unavailable_after.strftime("%Y-%m-%d")
|
||||||
|
|
@ -563,7 +563,7 @@ class AnsibleHCloudServer(AnsibleHCloud):
|
||||||
"Existing servers of that plan will continue to work as before and no "
|
"Existing servers of that plan will continue to work as before and no "
|
||||||
"action is required on your part. "
|
"action is required on your part. "
|
||||||
"It is possible to migrate this server to another server plan by setting "
|
"It is possible to migrate this server to another server plan by setting "
|
||||||
"the server_type parameter on the hetzner.hcloud.hcloud_server module."
|
"the server_type parameter on the hetzner.hcloud.server module."
|
||||||
)
|
)
|
||||||
|
|
||||||
def _get_placement_group(self):
|
def _get_placement_group(self):
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud server infos
|
- name: Gather hcloud server infos
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
|
|
|
||||||
|
|
@ -50,20 +50,20 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic server network
|
- name: Create a basic server network
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: my-network
|
network: my-network
|
||||||
server: my-server
|
server: my-server
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a server network and specify the ip address
|
- name: Create a server network and specify the ip address
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: my-network
|
network: my-network
|
||||||
server: my-server
|
server: my-server
|
||||||
ip: 10.0.0.1
|
ip: 10.0.0.1
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a server network and add alias ips
|
- name: Create a server network and add alias ips
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: my-network
|
network: my-network
|
||||||
server: my-server
|
server: my-server
|
||||||
ip: 10.0.0.1
|
ip: 10.0.0.1
|
||||||
|
|
@ -73,7 +73,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the server network is absent (remove if needed)
|
- name: Ensure the server network is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: my-network
|
network: my-network
|
||||||
server: my-server
|
server: my-server
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud server type infos
|
- name: Gather hcloud server type infos
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
|
|
|
||||||
|
|
@ -55,13 +55,13 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic ssh_key
|
- name: Create a basic ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: my-ssh_key
|
name: my-ssh_key
|
||||||
public_key: ssh-rsa AAAjjk76kgf...Xt
|
public_key: ssh-rsa AAAjjk76kgf...Xt
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a ssh_key with labels
|
- name: Create a ssh_key with labels
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: my-ssh_key
|
name: my-ssh_key
|
||||||
public_key: ssh-rsa AAAjjk76kgf...Xt
|
public_key: ssh-rsa AAAjjk76kgf...Xt
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -70,7 +70,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the ssh_key is absent (remove if needed)
|
- name: Ensure the ssh_key is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: my-ssh_key
|
name: my-ssh_key
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud sshkey infos
|
- name: Gather hcloud sshkey infos
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
register: output
|
register: output
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
debug:
|
debug:
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a basic subnetwork
|
- name: Create a basic subnetwork
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: my-network
|
network: my-network
|
||||||
ip_range: 10.0.0.0/16
|
ip_range: 10.0.0.0/16
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -65,7 +65,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create a basic subnetwork
|
- name: Create a basic subnetwork
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: my-vswitch-network
|
network: my-vswitch-network
|
||||||
ip_range: 10.0.0.0/24
|
ip_range: 10.0.0.0/24
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -74,7 +74,7 @@ EXAMPLES = """
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Ensure the subnetwork is absent (remove if needed)
|
- name: Ensure the subnetwork is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: my-network
|
network: my-network
|
||||||
ip_range: 10.0.0.0/8
|
ip_range: 10.0.0.0/8
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
|
||||||
|
|
@ -75,32 +75,32 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create a Volume
|
- name: Create a Volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: my-volume
|
name: my-volume
|
||||||
location: fsn1
|
location: fsn1
|
||||||
size: 100
|
size: 100
|
||||||
state: present
|
state: present
|
||||||
- name: Create a Volume and format it with ext4
|
- name: Create a Volume and format it with ext4
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: my-volume
|
name: my-volume
|
||||||
location: fsn
|
location: fsn
|
||||||
format: ext4
|
format: ext4
|
||||||
size: 100
|
size: 100
|
||||||
state: present
|
state: present
|
||||||
- name: Mount a existing Volume and automount
|
- name: Mount a existing Volume and automount
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: my-volume
|
name: my-volume
|
||||||
server: my-server
|
server: my-server
|
||||||
automount: true
|
automount: true
|
||||||
state: present
|
state: present
|
||||||
- name: Mount a existing Volume and automount
|
- name: Mount a existing Volume and automount
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: my-volume
|
name: my-volume
|
||||||
server: my-server
|
server: my-server
|
||||||
automount: true
|
automount: true
|
||||||
state: present
|
state: present
|
||||||
- name: Ensure the Volume is absent (remove if needed)
|
- name: Ensure the Volume is absent (remove if needed)
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: my-volume
|
name: my-volume
|
||||||
state: absent
|
state: absent
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ extends_documentation_fragment:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Gather hcloud Volume infos
|
- name: Gather hcloud Volume infos
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
register: output
|
register: output
|
||||||
- name: Print the gathered infos
|
- name: Print the gathered infos
|
||||||
debug:
|
debug:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: cleanup test certificate
|
- name: cleanup test certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: test missing required parameters on create certificate
|
- name: test missing required parameters on create certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
- 'result.msg == "missing required arguments: certificate, private_key"'
|
- 'result.msg == "missing required arguments: certificate, private_key"'
|
||||||
|
|
||||||
- name: test create certificate with check mode
|
- name: test create certificate with check mode
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
certificate: "{{ test_certificate_content }}"
|
certificate: "{{ test_certificate_content }}"
|
||||||
private_key: "{{ test_certificate_privatekey_content }}"
|
private_key: "{{ test_certificate_privatekey_content }}"
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create certificate
|
- name: test create certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
certificate: "{{ test_certificate_content }}"
|
certificate: "{{ test_certificate_content }}"
|
||||||
private_key: "{{ test_certificate_privatekey_content }}"
|
private_key: "{{ test_certificate_privatekey_content }}"
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
- certificate.hcloud_certificate.labels.key == "value"
|
- certificate.hcloud_certificate.labels.key == "value"
|
||||||
|
|
||||||
- name: test create certificate idempotence
|
- name: test create certificate idempotence
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
certificate: "{{ test_certificate_content }}"
|
certificate: "{{ test_certificate_content }}"
|
||||||
private_key: "{{ test_certificate_privatekey_content }}"
|
private_key: "{{ test_certificate_privatekey_content }}"
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test update certificate with check mode
|
- name: test update certificate with check mode
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
id: "{{ certificate.hcloud_certificate.id }}"
|
id: "{{ certificate.hcloud_certificate.id }}"
|
||||||
name: "changed-{{ hcloud_certificate_name }}"
|
name: "changed-{{ hcloud_certificate_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test update certificate
|
- name: test update certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
id: "{{ certificate.hcloud_certificate.id }}"
|
id: "{{ certificate.hcloud_certificate.id }}"
|
||||||
name: "changed-{{ hcloud_certificate_name }}"
|
name: "changed-{{ hcloud_certificate_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
- result.hcloud_certificate.name == "changed-{{ hcloud_certificate_name }}"
|
- result.hcloud_certificate.name == "changed-{{ hcloud_certificate_name }}"
|
||||||
|
|
||||||
- name: test update certificate with same labels
|
- name: test update certificate with same labels
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
id: "{{ certificate.hcloud_certificate.id }}"
|
id: "{{ certificate.hcloud_certificate.id }}"
|
||||||
name: "changed-{{ hcloud_certificate_name }}"
|
name: "changed-{{ hcloud_certificate_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test update certificate with other labels
|
- name: test update certificate with other labels
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
id: "{{ certificate.hcloud_certificate.id }}"
|
id: "{{ certificate.hcloud_certificate.id }}"
|
||||||
name: "changed-{{ hcloud_certificate_name }}"
|
name: "changed-{{ hcloud_certificate_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test rename certificate
|
- name: test rename certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
id: "{{ certificate.hcloud_certificate.id }}"
|
id: "{{ certificate.hcloud_certificate.id }}"
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
- result.hcloud_certificate.name == "{{ hcloud_certificate_name }}"
|
- result.hcloud_certificate.name == "{{ hcloud_certificate_name }}"
|
||||||
|
|
||||||
- name: absent certificate
|
- name: absent certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
id: "{{ certificate.hcloud_certificate.id }}"
|
id: "{{ certificate.hcloud_certificate.id }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
hcloud_dns_test_domain: "{{ hcloud_dns_test_domain }}"
|
hcloud_dns_test_domain: "{{ hcloud_dns_test_domain }}"
|
||||||
|
|
||||||
- name: test create managed certificate
|
- name: test create managed certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
domain_names:
|
domain_names:
|
||||||
- "{{ hcloud_dns_test_domain }}"
|
- "{{ hcloud_dns_test_domain }}"
|
||||||
|
|
@ -145,7 +145,7 @@
|
||||||
- result.hcloud_certificate.domain_names[0] == "{{ hcloud_dns_test_domain }}"
|
- result.hcloud_certificate.domain_names[0] == "{{ hcloud_dns_test_domain }}"
|
||||||
|
|
||||||
- name: test delete certificate
|
- name: test delete certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
id: "{{ result.hcloud_certificate.id }}"
|
id: "{{ result.hcloud_certificate.id }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_certificate
|
- name: Cleanup test_certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_certificate
|
- name: Create test_certificate
|
||||||
hetzner.hcloud.hcloud_certificate:
|
hetzner.hcloud.certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
certificate: "{{ test_certificate_content }}"
|
certificate: "{{ test_certificate_content }}"
|
||||||
private_key: "{{ test_certificate_privatekey_content }}"
|
private_key: "{{ test_certificate_privatekey_content }}"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_certificate_info
|
- name: Gather hcloud_certificate_info
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_certificate_info
|
- name: Verify hcloud_certificate_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_certificate_info | list | count >= 1
|
- result.hcloud_certificate_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_certificate_info in check mode
|
- name: Gather hcloud_certificate_info in check mode
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_certificate_info in check mode
|
- name: Verify hcloud_certificate_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_certificate_info | list | count >= 1
|
- result.hcloud_certificate_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_certificate_info with correct id
|
- name: Gather hcloud_certificate_info with correct id
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
id: "{{ test_certificate.hcloud_certificate.id }}"
|
id: "{{ test_certificate.hcloud_certificate.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_certificate_info with correct id
|
- name: Verify hcloud_certificate_info with correct id
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- result.hcloud_certificate_info | list | count == 1
|
- result.hcloud_certificate_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_certificate_info with wrong id
|
- name: Gather hcloud_certificate_info with wrong id
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
id: "{{ test_certificate.hcloud_certificate.id }}4321"
|
id: "{{ test_certificate.hcloud_certificate.id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_certificate_info with correct name
|
- name: Gather hcloud_certificate_info with correct name
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_certificate_info with correct name
|
- name: Verify hcloud_certificate_info with correct name
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
- result.hcloud_certificate_info | list | count == 1
|
- result.hcloud_certificate_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_certificate_info with wrong name
|
- name: Gather hcloud_certificate_info with wrong name
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
name: "{{ hcloud_certificate_name }}-invalid"
|
name: "{{ hcloud_certificate_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_certificate_info with wrong name
|
- name: Verify hcloud_certificate_info with wrong name
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
- result.hcloud_certificate_info | list | count == 0
|
- result.hcloud_certificate_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_certificate_info with correct label selector
|
- name: Gather hcloud_certificate_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_certificate_info with correct label selector
|
- name: Verify hcloud_certificate_info with correct label selector
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_certificate_info with wrong label selector
|
- name: Gather hcloud_certificate_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_certificate_info:
|
hetzner.hcloud.certificate_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_certificate_info with wrong label selector
|
- name: Verify hcloud_certificate_info with wrong label selector
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_datacenter_info
|
- name: Gather hcloud_datacenter_info
|
||||||
hetzner.hcloud.hcloud_datacenter_info:
|
hetzner.hcloud.datacenter_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_datacenter_info
|
- name: Verify hcloud_datacenter_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_datacenter_info | list | count >= 5
|
- result.hcloud_datacenter_info | list | count >= 5
|
||||||
|
|
||||||
- name: Gather hcloud_datacenter_info in check mode
|
- name: Gather hcloud_datacenter_info in check mode
|
||||||
hetzner.hcloud.hcloud_datacenter_info:
|
hetzner.hcloud.datacenter_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_datacenter_info in check mode
|
- name: Verify hcloud_datacenter_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_datacenter_info | list | count >= 5
|
- result.hcloud_datacenter_info | list | count >= 5
|
||||||
|
|
||||||
- name: Gather hcloud_datacenter_info with correct id
|
- name: Gather hcloud_datacenter_info with correct id
|
||||||
hetzner.hcloud.hcloud_datacenter_info:
|
hetzner.hcloud.datacenter_info:
|
||||||
id: "{{ hcloud_datacenter_id }}"
|
id: "{{ hcloud_datacenter_id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_datacenter_info with correct id
|
- name: Verify hcloud_datacenter_info with correct id
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
- result.hcloud_datacenter_info[0].location == hcloud_location_name
|
- result.hcloud_datacenter_info[0].location == hcloud_location_name
|
||||||
|
|
||||||
- name: Gather hcloud_datacenter_info with wrong id
|
- name: Gather hcloud_datacenter_info with wrong id
|
||||||
hetzner.hcloud.hcloud_datacenter_info:
|
hetzner.hcloud.datacenter_info:
|
||||||
id: "{{ hcloud_datacenter_id }}4321"
|
id: "{{ hcloud_datacenter_id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_datacenter_info with correct name
|
- name: Gather hcloud_datacenter_info with correct name
|
||||||
hetzner.hcloud.hcloud_datacenter_info:
|
hetzner.hcloud.datacenter_info:
|
||||||
name: "{{ hcloud_datacenter_name }}"
|
name: "{{ hcloud_datacenter_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_datacenter_info with correct name
|
- name: Verify hcloud_datacenter_info with correct name
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
- result.hcloud_datacenter_info | list | count == 1
|
- result.hcloud_datacenter_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_datacenter_info with wrong name
|
- name: Gather hcloud_datacenter_info with wrong name
|
||||||
hetzner.hcloud.hcloud_datacenter_info:
|
hetzner.hcloud.datacenter_info:
|
||||||
name: "{{ hcloud_datacenter_name }}-invalid"
|
name: "{{ hcloud_datacenter_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_datacenter_info with wrong name
|
- name: Verify hcloud_datacenter_info with wrong name
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup firewall to be absent
|
- name: setup firewall to be absent
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: "{{ hcloud_firewall_name }}"
|
name: "{{ hcloud_firewall_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: test missing required parameters on create firewall
|
- name: test missing required parameters on create firewall
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create firewall
|
- name: verify fail test missing required parameters on create firewall
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
- 'result.msg == "one of the following is required: id, name"'
|
- 'result.msg == "one of the following is required: id, name"'
|
||||||
|
|
||||||
- name: test create firewall with check mode
|
- name: test create firewall with check mode
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: "{{ hcloud_firewall_name }}"
|
name: "{{ hcloud_firewall_name }}"
|
||||||
register: result
|
register: result
|
||||||
check_mode: true
|
check_mode: true
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create firewall
|
- name: test create firewall
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: "{{ hcloud_firewall_name }}"
|
name: "{{ hcloud_firewall_name }}"
|
||||||
rules:
|
rules:
|
||||||
- direction: in
|
- direction: in
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
- firewall.hcloud_firewall.rules | selectattr('description', 'equalto', 'allow icmp in') | list | count == 1
|
- firewall.hcloud_firewall.rules | selectattr('description', 'equalto', 'allow icmp in') | list | count == 1
|
||||||
|
|
||||||
- name: test create firewall idempotence
|
- name: test create firewall idempotence
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: "{{ hcloud_firewall_name }}"
|
name: "{{ hcloud_firewall_name }}"
|
||||||
rules:
|
rules:
|
||||||
- direction: in
|
- direction: in
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test update firewall rules
|
- name: test update firewall rules
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: "{{ hcloud_firewall_name }}"
|
name: "{{ hcloud_firewall_name }}"
|
||||||
rules:
|
rules:
|
||||||
- direction: in
|
- direction: in
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
- firewall.hcloud_firewall.rules | selectattr('description', 'equalto', 'allow tcp out') | list | count == 1
|
- firewall.hcloud_firewall.rules | selectattr('description', 'equalto', 'allow tcp out') | list | count == 1
|
||||||
|
|
||||||
- name: test update firewall rules idempotence
|
- name: test update firewall rules idempotence
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: "{{ hcloud_firewall_name }}"
|
name: "{{ hcloud_firewall_name }}"
|
||||||
rules:
|
rules:
|
||||||
- direction: in
|
- direction: in
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test update firewall with check mode
|
- name: test update firewall with check mode
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
id: "{{ firewall.hcloud_firewall.id }}"
|
id: "{{ firewall.hcloud_firewall.id }}"
|
||||||
name: "changed-{{ hcloud_firewall_name }}"
|
name: "changed-{{ hcloud_firewall_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -151,7 +151,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test update firewall
|
- name: test update firewall
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
id: "{{ firewall.hcloud_firewall.id }}"
|
id: "{{ firewall.hcloud_firewall.id }}"
|
||||||
name: "changed-{{ hcloud_firewall_name }}"
|
name: "changed-{{ hcloud_firewall_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
- result.hcloud_firewall.name == "changed-{{ hcloud_firewall_name }}"
|
- result.hcloud_firewall.name == "changed-{{ hcloud_firewall_name }}"
|
||||||
|
|
||||||
- name: test update firewall with same labels
|
- name: test update firewall with same labels
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
id: "{{ firewall.hcloud_firewall.id }}"
|
id: "{{ firewall.hcloud_firewall.id }}"
|
||||||
name: "changed-{{ hcloud_firewall_name }}"
|
name: "changed-{{ hcloud_firewall_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -176,7 +176,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test update firewall with other labels
|
- name: test update firewall with other labels
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
id: "{{ firewall.hcloud_firewall.id }}"
|
id: "{{ firewall.hcloud_firewall.id }}"
|
||||||
name: "changed-{{ hcloud_firewall_name }}"
|
name: "changed-{{ hcloud_firewall_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -189,7 +189,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test rename firewall
|
- name: test rename firewall
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
id: "{{ firewall.hcloud_firewall.id }}"
|
id: "{{ firewall.hcloud_firewall.id }}"
|
||||||
name: "{{ hcloud_firewall_name }}"
|
name: "{{ hcloud_firewall_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -200,7 +200,7 @@
|
||||||
- result.hcloud_firewall.name == "{{ hcloud_firewall_name }}"
|
- result.hcloud_firewall.name == "{{ hcloud_firewall_name }}"
|
||||||
|
|
||||||
- name: absent firewall
|
- name: absent firewall
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
id: "{{ firewall.hcloud_firewall.id }}"
|
id: "{{ firewall.hcloud_firewall.id }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -2,22 +2,22 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup ensure server is absent
|
- name: setup ensure server is absent
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: setup ensure another server is absent
|
- name: setup ensure another server is absent
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}2"
|
name: "{{ hcloud_server_name }}2"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: setup ensure floating ip is absent
|
- name: setup ensure floating ip is absent
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: setup server
|
- name: setup server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
- main_server is changed
|
- main_server is changed
|
||||||
|
|
||||||
- name: setup another server
|
- name: setup another server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}2"
|
name: "{{ hcloud_server_name }}2"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
- main_server2 is changed
|
- main_server2 is changed
|
||||||
|
|
||||||
- name: test missing type parameter on create Floating IP
|
- name: test missing type parameter on create Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
- 'result.msg == "missing required arguments: type"'
|
- 'result.msg == "missing required arguments: type"'
|
||||||
|
|
||||||
- name: test missing required parameters on create Floating IP
|
- name: test missing required parameters on create Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
- 'result.msg == "one of the following is required: home_location, server"'
|
- 'result.msg == "one of the following is required: home_location, server"'
|
||||||
|
|
||||||
- name: test missing type parameter on delete Floating IP
|
- name: test missing type parameter on delete Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
- 'result.msg == "one of the following is required: id, name"'
|
- 'result.msg == "one of the following is required: id, name"'
|
||||||
|
|
||||||
- name: test invalid type
|
- name: test invalid type
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv5
|
type: ipv5
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
- 'result.msg == "value of type must be one of: ipv4, ipv6, got: ipv5"'
|
- 'result.msg == "value of type must be one of: ipv4, ipv6, got: ipv5"'
|
||||||
|
|
||||||
- name: test invalid location
|
- name: test invalid location
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "abc"
|
home_location: "abc"
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
- result.msg == "invalid input in fields 'server', 'home_location'"
|
- result.msg == "invalid input in fields 'server', 'home_location'"
|
||||||
|
|
||||||
- name: test create Floating IP with check mode
|
- name: test create Floating IP with check mode
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "Web Server"
|
description: "Web Server"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -117,7 +117,7 @@
|
||||||
- floatingIP is changed
|
- floatingIP is changed
|
||||||
|
|
||||||
- name: test create Floating IP
|
- name: test create Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "Web Server"
|
description: "Web Server"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -132,7 +132,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.home_location == "fsn1"
|
- floatingIP.hcloud_floating_ip.home_location == "fsn1"
|
||||||
|
|
||||||
- name: test create Floating IP idempotency
|
- name: test create Floating IP idempotency
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "Web Server"
|
description: "Web Server"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -144,7 +144,7 @@
|
||||||
- floatingIP is not changed
|
- floatingIP is not changed
|
||||||
|
|
||||||
- name: test update Floating IP with check mode
|
- name: test update Floating IP with check mode
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "changed-description"
|
description: "changed-description"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -158,7 +158,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.description == "Web Server"
|
- floatingIP.hcloud_floating_ip.description == "Web Server"
|
||||||
|
|
||||||
- name: test update Floating IP
|
- name: test update Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "changed-description"
|
description: "changed-description"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -173,7 +173,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.description == "changed-description"
|
- floatingIP.hcloud_floating_ip.description == "changed-description"
|
||||||
|
|
||||||
- name: test update Floating IP idempotency
|
- name: test update Floating IP idempotency
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "changed-description"
|
description: "changed-description"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -187,7 +187,7 @@
|
||||||
- floatingIP is not changed
|
- floatingIP is not changed
|
||||||
|
|
||||||
- name: test update Floating IP with same labels
|
- name: test update Floating IP with same labels
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
|
|
@ -200,7 +200,7 @@
|
||||||
- floatingIP is not changed
|
- floatingIP is not changed
|
||||||
|
|
||||||
- name: test update Floating IP with other labels
|
- name: test update Floating IP with other labels
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
|
|
@ -214,7 +214,7 @@
|
||||||
- floatingIP is changed
|
- floatingIP is changed
|
||||||
|
|
||||||
- name: test update Floating IP with other labels in different order
|
- name: test update Floating IP with other labels in different order
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
|
|
@ -228,7 +228,7 @@
|
||||||
- floatingIP is not changed
|
- floatingIP is not changed
|
||||||
|
|
||||||
- name: test assign Floating IP with checkmode
|
- name: test assign Floating IP with checkmode
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "changed-description"
|
description: "changed-description"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -242,7 +242,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.server != "{{ main_server.hcloud_server.name }}"
|
- floatingIP.hcloud_floating_ip.server != "{{ main_server.hcloud_server.name }}"
|
||||||
|
|
||||||
- name: test assign Floating IP
|
- name: test assign Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "changed-description"
|
description: "changed-description"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -255,7 +255,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.server == "{{ main_server.hcloud_server.name }}"
|
- floatingIP.hcloud_floating_ip.server == "{{ main_server.hcloud_server.name }}"
|
||||||
|
|
||||||
- name: test assign Floating IP idempotency
|
- name: test assign Floating IP idempotency
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
description: "changed-description"
|
description: "changed-description"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
@ -267,7 +267,7 @@
|
||||||
- floatingIP is not changed
|
- floatingIP is not changed
|
||||||
|
|
||||||
- name: test unassign Floating IP
|
- name: test unassign Floating IP
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
|
|
@ -279,7 +279,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.server != "{{ main_server.hcloud_server.name }}"
|
- floatingIP.hcloud_floating_ip.server != "{{ main_server.hcloud_server.name }}"
|
||||||
|
|
||||||
- name: test unassign Floating IP idempotency
|
- name: test unassign Floating IP idempotency
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
|
|
@ -290,7 +290,7 @@
|
||||||
- floatingIP is not changed
|
- floatingIP is not changed
|
||||||
|
|
||||||
- name: test assign Floating IP again
|
- name: test assign Floating IP again
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
server: "{{ main_server.hcloud_server.name }}"
|
server: "{{ main_server.hcloud_server.name }}"
|
||||||
|
|
@ -302,7 +302,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.server == "{{ main_server.hcloud_server.name }}"
|
- floatingIP.hcloud_floating_ip.server == "{{ main_server.hcloud_server.name }}"
|
||||||
|
|
||||||
- name: test already assigned Floating IP assign without force
|
- name: test already assigned Floating IP assign without force
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
server: "{{ main_server2.hcloud_server.name }}"
|
server: "{{ main_server2.hcloud_server.name }}"
|
||||||
|
|
@ -314,7 +314,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.server == "{{ main_server.hcloud_server.name }}"
|
- floatingIP.hcloud_floating_ip.server == "{{ main_server.hcloud_server.name }}"
|
||||||
|
|
||||||
- name: test already assigned Floating IP assign with force
|
- name: test already assigned Floating IP assign with force
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
force: true
|
force: true
|
||||||
|
|
@ -327,7 +327,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.server == "{{ main_server2.hcloud_server.name }}"
|
- floatingIP.hcloud_floating_ip.server == "{{ main_server2.hcloud_server.name }}"
|
||||||
|
|
||||||
- name: test update Floating IP delete protection
|
- name: test update Floating IP delete protection
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
|
|
@ -339,7 +339,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.delete_protection is sameas true
|
- floatingIP.hcloud_floating_ip.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test update Floating IP delete protection idempotency
|
- name: test update Floating IP delete protection idempotency
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
|
|
@ -351,7 +351,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.delete_protection is sameas true
|
- floatingIP.hcloud_floating_ip.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test Floating IP without delete protection set to be idempotent
|
- name: test Floating IP without delete protection set to be idempotent
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
register: floatingIP
|
register: floatingIP
|
||||||
|
|
@ -362,7 +362,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.delete_protection is sameas true
|
- floatingIP.hcloud_floating_ip.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test delete Floating IP fails if it is protected
|
- name: test delete Floating IP fails if it is protected
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -374,7 +374,7 @@
|
||||||
- 'result.msg == "Floating IP deletion is protected"'
|
- 'result.msg == "Floating IP deletion is protected"'
|
||||||
|
|
||||||
- name: test update Floating IP delete protection
|
- name: test update Floating IP delete protection
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
|
|
@ -386,7 +386,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.delete_protection is sameas false
|
- floatingIP.hcloud_floating_ip.delete_protection is sameas false
|
||||||
|
|
||||||
- name: test delete floating ip
|
- name: test delete floating ip
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -396,7 +396,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create ipv6 floating ip
|
- name: test create ipv6 floating ip
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv6
|
type: ipv6
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
|
|
@ -408,7 +408,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test delete ipv6 floating ip
|
- name: test delete ipv6 floating ip
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -418,7 +418,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -427,7 +427,7 @@
|
||||||
that:
|
that:
|
||||||
- result is changed
|
- result is changed
|
||||||
- name: cleanup another server
|
- name: cleanup another server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ main_server2.hcloud_server.name }}"
|
name: "{{ main_server2.hcloud_server.name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -437,7 +437,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create Floating IP with delete protection
|
- name: test create Floating IP with delete protection
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: fsn1
|
home_location: fsn1
|
||||||
|
|
@ -450,7 +450,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.delete_protection is sameas true
|
- floatingIP.hcloud_floating_ip.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test delete Floating IP fails if it is protected
|
- name: test delete Floating IP fails if it is protected
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -462,7 +462,7 @@
|
||||||
- 'result.msg == "Floating IP deletion is protected"'
|
- 'result.msg == "Floating IP deletion is protected"'
|
||||||
|
|
||||||
- name: test update Floating IP delete protection
|
- name: test update Floating IP delete protection
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
|
|
@ -474,7 +474,7 @@
|
||||||
- floatingIP.hcloud_floating_ip.delete_protection is sameas false
|
- floatingIP.hcloud_floating_ip.delete_protection is sameas false
|
||||||
|
|
||||||
- name: test delete floating ip
|
- name: test delete floating ip
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_floating_ip
|
- name: Cleanup test_floating_ip
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_floating_ip
|
- name: Create test_floating_ip
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
home_location: fsn1
|
home_location: fsn1
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_floating_ip_info
|
- name: Gather hcloud_floating_ip_info
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_floating_ip_info
|
- name: Verify hcloud_floating_ip_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_floating_ip_info | list | count >= 1
|
- result.hcloud_floating_ip_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_floating_ip_info in check mode
|
- name: Gather hcloud_floating_ip_info in check mode
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_floating_ip_info in check mode
|
- name: Verify hcloud_floating_ip_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_floating_ip_info | list | count >= 1
|
- result.hcloud_floating_ip_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_floating_ip_info with correct id
|
- name: Gather hcloud_floating_ip_info with correct id
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
id: "{{ test_floating_ip.hcloud_floating_ip.id }}"
|
id: "{{ test_floating_ip.hcloud_floating_ip.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_floating_ip_info with correct id
|
- name: Verify hcloud_floating_ip_info with correct id
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- result.hcloud_floating_ip_info | list | count == 1
|
- result.hcloud_floating_ip_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_floating_ip_info with wrong id
|
- name: Gather hcloud_floating_ip_info with wrong id
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
id: "{{ test_floating_ip.hcloud_floating_ip.id }}4321"
|
id: "{{ test_floating_ip.hcloud_floating_ip.id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_floating_ip_info with correct name
|
- name: Gather hcloud_floating_ip_info with correct name
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_floating_ip_info with correct name
|
- name: Verify hcloud_floating_ip_info with correct name
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
- result.hcloud_floating_ip_info | list | count == 1
|
- result.hcloud_floating_ip_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_floating_ip_info with wrong name
|
- name: Gather hcloud_floating_ip_info with wrong name
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
name: "{{ hcloud_floating_ip_name }}-invalid"
|
name: "{{ hcloud_floating_ip_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_floating_ip_info with wrong name
|
- name: Verify hcloud_floating_ip_info with wrong name
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
- result.hcloud_floating_ip_info | list | count == 0
|
- result.hcloud_floating_ip_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_floating_ip_info with correct label selector
|
- name: Gather hcloud_floating_ip_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_floating_ip_info with correct label selector
|
- name: Verify hcloud_floating_ip_info with correct label selector
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_floating_ip_info with wrong label selector
|
- name: Gather hcloud_floating_ip_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_floating_ip_info:
|
hetzner.hcloud.floating_ip_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_floating_ip_info with wrong label selector
|
- name: Verify hcloud_floating_ip_info with wrong label selector
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_server
|
- name: Cleanup test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_server
|
- name: Create test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_image_info
|
- name: Gather hcloud_image_info
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_image_info
|
- name: Verify hcloud_image_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_image_info | list | count >= 3
|
- result.hcloud_image_info | list | count >= 3
|
||||||
|
|
||||||
- name: Gather hcloud_image_info with architecture
|
- name: Gather hcloud_image_info with architecture
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
architecture: arm
|
architecture: arm
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_image_info with architecture
|
- name: Verify hcloud_image_info with architecture
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
- result.hcloud_image_info | selectattr('architecture', 'equalto', 'arm') | list | count > 2
|
- result.hcloud_image_info | selectattr('architecture', 'equalto', 'arm') | list | count > 2
|
||||||
|
|
||||||
- name: Gather hcloud_image_info in check mode
|
- name: Gather hcloud_image_info in check mode
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_image_info in check mode
|
- name: Verify hcloud_image_info in check mode
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
- result.hcloud_image_info | list | count >= 3
|
- result.hcloud_image_info | list | count >= 3
|
||||||
|
|
||||||
- name: Gather hcloud_image_info with correct id
|
- name: Gather hcloud_image_info with correct id
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
id: "{{ test_snapshot_id }}"
|
id: "{{ test_snapshot_id }}"
|
||||||
type: snapshot
|
type: snapshot
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
- result.hcloud_image_info | list | count == 1
|
- result.hcloud_image_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_image_info with wrong id
|
- name: Gather hcloud_image_info with wrong id
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
id: "{{ test_snapshot_id }}4321"
|
id: "{{ test_snapshot_id }}4321"
|
||||||
type: snapshot
|
type: snapshot
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_image_info with correct name
|
- name: Gather hcloud_image_info with correct name
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
name: "{{ hcloud_image_name }}"
|
name: "{{ hcloud_image_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_image_info with correct name
|
- name: Verify hcloud_image_info with correct name
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
- result.hcloud_image_info[0].architecture == "x86"
|
- result.hcloud_image_info[0].architecture == "x86"
|
||||||
|
|
||||||
- name: Gather hcloud_image_info with wrong name
|
- name: Gather hcloud_image_info with wrong name
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
name: "{{ hcloud_image_name }}-invalid"
|
name: "{{ hcloud_image_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_image_info with wrong name
|
- name: Verify hcloud_image_info with wrong name
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
- result.hcloud_image_info | list | count == 0
|
- result.hcloud_image_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_image_info with correct name and architecture
|
- name: Gather hcloud_image_info with correct name and architecture
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
name: "{{ hcloud_image_name }}"
|
name: "{{ hcloud_image_name }}"
|
||||||
architecture: arm
|
architecture: arm
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
- result.hcloud_image_info[0].architecture == "arm"
|
- result.hcloud_image_info[0].architecture == "arm"
|
||||||
|
|
||||||
- name: Gather hcloud_image_info with correct label selector
|
- name: Gather hcloud_image_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
type: snapshot
|
type: snapshot
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_image_info with wrong label selector
|
- name: Gather hcloud_image_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_image_info:
|
hetzner.hcloud.image_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
type: snapshot
|
type: snapshot
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_iso_info
|
- name: Gather hcloud_iso_info
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.iso_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_iso_info
|
- name: Verify hcloud_iso_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_iso_info | list | count >= 1
|
- result.hcloud_iso_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_iso_info in check mode
|
- name: Gather hcloud_iso_info in check mode
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.iso_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_iso_info in check mode
|
- name: Verify hcloud_iso_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_iso_info | list | count >= 1
|
- result.hcloud_iso_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_iso_info with correct id
|
- name: Gather hcloud_iso_info with correct id
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.iso_info:
|
||||||
id: "{{ hcloud_iso_id }}"
|
id: "{{ hcloud_iso_id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_iso_info with correct id
|
- name: Verify hcloud_iso_info with correct id
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
- result.hcloud_iso_info[0].deprecation is none
|
- result.hcloud_iso_info[0].deprecation is none
|
||||||
|
|
||||||
- name: Gather hcloud_iso_info with wrong id
|
- name: Gather hcloud_iso_info with wrong id
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.iso_info:
|
||||||
id: "{{ hcloud_iso_id }}4321"
|
id: "{{ hcloud_iso_id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_iso_info with correct name
|
- name: Gather hcloud_iso_info with correct name
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.iso_info:
|
||||||
name: "{{ hcloud_iso_name }}"
|
name: "{{ hcloud_iso_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_iso_info with correct name
|
- name: Verify hcloud_iso_info with correct name
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
- result.hcloud_iso_info | list | count == 1
|
- result.hcloud_iso_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_iso_info with wrong name
|
- name: Gather hcloud_iso_info with wrong name
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.iso_info:
|
||||||
name: "{{ hcloud_iso_name }}-invalid"
|
name: "{{ hcloud_iso_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_iso_info with wrong name
|
- name: Verify hcloud_iso_info with wrong name
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
- result.hcloud_iso_info | list | count == 0
|
- result.hcloud_iso_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_iso_info with architecture
|
- name: Gather hcloud_iso_info with architecture
|
||||||
hetzner.hcloud.hcloud_iso_info:
|
hetzner.hcloud.iso_info:
|
||||||
architecture: arm
|
architecture: arm
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_iso_info with architecture
|
- name: Verify hcloud_iso_info with architecture
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_load_balancer
|
- name: Cleanup test_load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Test missing required parameters
|
- name: Test missing required parameters
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: present
|
state: present
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
- 'result.msg == "missing required arguments: load_balancer_type"'
|
- 'result.msg == "missing required arguments: load_balancer_type"'
|
||||||
|
|
||||||
- name: Test create with check mode
|
- name: Test create with check mode
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: Test create
|
- name: Test create
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
- result.hcloud_load_balancer.delete_protection == false
|
- result.hcloud_load_balancer.delete_protection == false
|
||||||
|
|
||||||
- name: Test create idempotency
|
- name: Test create idempotency
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: Test update algorithm
|
- name: Test update algorithm
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
algorithm: least_connections
|
algorithm: least_connections
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
- result.hcloud_load_balancer.algorithm == "least_connections"
|
- result.hcloud_load_balancer.algorithm == "least_connections"
|
||||||
|
|
||||||
- name: Test update load_balancer_type
|
- name: Test update load_balancer_type
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
load_balancer_type: lb21
|
load_balancer_type: lb21
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
- result.hcloud_load_balancer.load_balancer_type == "lb21"
|
- result.hcloud_load_balancer.load_balancer_type == "lb21"
|
||||||
|
|
||||||
- name: Test update labels
|
- name: Test update labels
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
labels:
|
labels:
|
||||||
key: changed
|
key: changed
|
||||||
|
|
@ -99,7 +99,7 @@
|
||||||
- result.hcloud_load_balancer.labels.label == "changed123"
|
- result.hcloud_load_balancer.labels.label == "changed123"
|
||||||
|
|
||||||
- name: Test update delete_protection
|
- name: Test update delete_protection
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
- result.hcloud_load_balancer.delete_protection == true
|
- result.hcloud_load_balancer.delete_protection == true
|
||||||
|
|
||||||
- name: Test delete with protection
|
- name: Test delete with protection
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
- 'result.msg == "load balancer deletion is protected"'
|
- 'result.msg == "load balancer deletion is protected"'
|
||||||
|
|
||||||
- name: Test update delete_protection
|
- name: Test update delete_protection
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -135,7 +135,7 @@
|
||||||
- result.hcloud_load_balancer.delete_protection == false
|
- result.hcloud_load_balancer.delete_protection == false
|
||||||
|
|
||||||
- name: Test delete
|
- name: Test delete
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_load_balancer
|
- name: Cleanup test_load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Cleanup test_server
|
- name: Cleanup test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_server
|
- name: Create test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
register: test_server
|
register: test_server
|
||||||
|
|
||||||
- name: Create test_load_balancer
|
- name: Create test_load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
register: test_load_balancer
|
register: test_load_balancer
|
||||||
|
|
||||||
- name: Create test_load_balancer_target
|
- name: Create test_load_balancer_target
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: "server"
|
type: "server"
|
||||||
load_balancer: "{{ hcloud_load_balancer_name }}"
|
load_balancer: "{{ hcloud_load_balancer_name }}"
|
||||||
server: "{{ hcloud_server_name }}"
|
server: "{{ hcloud_server_name }}"
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
register: test_load_balancer_target
|
register: test_load_balancer_target
|
||||||
|
|
||||||
- name: Create test_load_balancer_service
|
- name: Create test_load_balancer_service
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: "{{ hcloud_load_balancer_name }}"
|
load_balancer: "{{ hcloud_load_balancer_name }}"
|
||||||
protocol: "http"
|
protocol: "http"
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_load_balancer_info
|
- name: Gather hcloud_load_balancer_info
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_info
|
- name: Verify hcloud_load_balancer_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_load_balancer_info | list | count >= 1
|
- result.hcloud_load_balancer_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_info in check mode
|
- name: Gather hcloud_load_balancer_info in check mode
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_info in check mode
|
- name: Verify hcloud_load_balancer_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_load_balancer_info | list | count >= 1
|
- result.hcloud_load_balancer_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_info with correct id
|
- name: Gather hcloud_load_balancer_info with correct id
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
id: "{{ test_load_balancer.hcloud_load_balancer.id }}"
|
id: "{{ test_load_balancer.hcloud_load_balancer.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_info with correct id
|
- name: Verify hcloud_load_balancer_info with correct id
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
- result.hcloud_load_balancer_info[0].services | selectattr('destination_port', 'equalto', 80) | list | count == 1
|
- result.hcloud_load_balancer_info[0].services | selectattr('destination_port', 'equalto', 80) | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_info with wrong id
|
- name: Gather hcloud_load_balancer_info with wrong id
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
id: "{{ test_load_balancer.hcloud_load_balancer.id }}4321"
|
id: "{{ test_load_balancer.hcloud_load_balancer.id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_info with correct name
|
- name: Gather hcloud_load_balancer_info with correct name
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_info with correct name
|
- name: Verify hcloud_load_balancer_info with correct name
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
- result.hcloud_load_balancer_info | list | count == 1
|
- result.hcloud_load_balancer_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_info with wrong name
|
- name: Gather hcloud_load_balancer_info with wrong name
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
name: "{{ hcloud_load_balancer_name }}-invalid"
|
name: "{{ hcloud_load_balancer_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_info with wrong name
|
- name: Verify hcloud_load_balancer_info with wrong name
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
- result.hcloud_load_balancer_info | list | count == 0
|
- result.hcloud_load_balancer_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_info with correct label selector
|
- name: Gather hcloud_load_balancer_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_info with correct label selector
|
- name: Verify hcloud_load_balancer_info with correct label selector
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_info with wrong label selector
|
- name: Gather hcloud_load_balancer_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_load_balancer_info:
|
hetzner.hcloud.load_balancer_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_info with wrong label selector
|
- name: Verify hcloud_load_balancer_info with wrong label selector
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup network
|
- name: setup network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
- network is success
|
- network is success
|
||||||
|
|
||||||
- name: setup subnetwork
|
- name: setup subnetwork
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
type: "cloud"
|
type: "cloud"
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
- subnetwork is success
|
- subnetwork is success
|
||||||
|
|
||||||
- name: setup load_balancer
|
- name: setup load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{hcloud_load_balancer_name}}"
|
name: "{{hcloud_load_balancer_name}}"
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
- load_balancer is success
|
- load_balancer is success
|
||||||
|
|
||||||
- name: test missing required parameters on create load_balancer network
|
- name: test missing required parameters on create load_balancer network
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
- '"missing required arguments:" in result.msg'
|
- '"missing required arguments:" in result.msg'
|
||||||
|
|
||||||
- name: test fail load balancer does not exist
|
- name: test fail load balancer does not exist
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
load_balancer: does-not-exist
|
load_balancer: does-not-exist
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
- "result.msg == 'resource (load_balancer) does not exist: does-not-exist'"
|
- "result.msg == 'resource (load_balancer) does not exist: does-not-exist'"
|
||||||
|
|
||||||
- name: test fail network does not exist
|
- name: test fail network does not exist
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: does-not-exist
|
network: does-not-exist
|
||||||
load_balancer: "{{ hcloud_load_balancer_name }}"
|
load_balancer: "{{ hcloud_load_balancer_name }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
- "result.msg == 'resource (network) does not exist: does-not-exist'"
|
- "result.msg == 'resource (network) does not exist: does-not-exist'"
|
||||||
|
|
||||||
- name: test create load_balancer network with checkmode
|
- name: test create load_balancer network with checkmode
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -87,7 +87,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create load_balancer network
|
- name: test create load_balancer network
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
- load_balancerNetwork.hcloud_load_balancer_network.load_balancer == hcloud_load_balancer_name
|
- load_balancerNetwork.hcloud_load_balancer_network.load_balancer == hcloud_load_balancer_name
|
||||||
|
|
||||||
- name: test create load_balancer network idempotency
|
- name: test create load_balancer network idempotency
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
- load_balancerNetwork is not changed
|
- load_balancerNetwork is not changed
|
||||||
|
|
||||||
- name: test absent load_balancer network
|
- name: test absent load_balancer network
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create load_balancer network with specified ip
|
- name: test create load_balancer network with specified ip
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
ip: "10.0.0.2"
|
ip: "10.0.0.2"
|
||||||
|
|
@ -137,7 +137,7 @@
|
||||||
- load_balancerNetwork.hcloud_load_balancer_network.ip == "10.0.0.2"
|
- load_balancerNetwork.hcloud_load_balancer_network.ip == "10.0.0.2"
|
||||||
|
|
||||||
- name: cleanup create load_balancer network with specified ip
|
- name: cleanup create load_balancer network with specified ip
|
||||||
hetzner.hcloud.hcloud_load_balancer_network:
|
hetzner.hcloud.load_balancer_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
@ -148,7 +148,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: cleanup load_balancer
|
- name: cleanup load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -158,7 +158,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: cleanup subnetwork
|
- name: cleanup subnetwork
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
type: "cloud"
|
type: "cloud"
|
||||||
|
|
@ -171,7 +171,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup load_balancer
|
- name: setup load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{hcloud_load_balancer_name}}"
|
name: "{{hcloud_load_balancer_name}}"
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
- load_balancer is success
|
- load_balancer is success
|
||||||
|
|
||||||
- name: test fail load balancer does not exist
|
- name: test fail load balancer does not exist
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: does-not-exist
|
load_balancer: does-not-exist
|
||||||
protocol: http
|
protocol: http
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- "result.msg == 'resource (load_balancer) does not exist: does-not-exist'"
|
- "result.msg == 'resource (load_balancer) does not exist: does-not-exist'"
|
||||||
|
|
||||||
- name: test create load_balancer service with checkmode
|
- name: test create load_balancer service with checkmode
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
protocol: "http"
|
protocol: "http"
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create load_balancer service
|
- name: test create load_balancer service
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
protocol: "http"
|
protocol: "http"
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||||
|
|
||||||
- name: test create load_balancer service idempotency
|
- name: test create load_balancer service idempotency
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
protocol: "http"
|
protocol: "http"
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
- load_balancer_service is not changed
|
- load_balancer_service is not changed
|
||||||
|
|
||||||
- name: test update load_balancer service
|
- name: test update load_balancer service
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
protocol: "tcp"
|
protocol: "tcp"
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||||
|
|
||||||
- name: test absent load_balancer service
|
- name: test absent load_balancer service
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
protocol: "http"
|
protocol: "http"
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create load_balancer service with http
|
- name: test create load_balancer service with http
|
||||||
hetzner.hcloud.hcloud_load_balancer_service:
|
hetzner.hcloud.load_balancer_service:
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
protocol: "http"
|
protocol: "http"
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
|
|
@ -116,7 +116,7 @@
|
||||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||||
|
|
||||||
- name: cleanup load_balancer
|
- name: cleanup load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup server
|
- name: setup server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
- server is success
|
- server is success
|
||||||
|
|
||||||
- name: setup load_balancer
|
- name: setup load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{hcloud_load_balancer_name}}"
|
name: "{{hcloud_load_balancer_name}}"
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
- load_balancer is success
|
- load_balancer is success
|
||||||
|
|
||||||
- name: test fail load balancer does not exist
|
- name: test fail load balancer does not exist
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: server
|
type: server
|
||||||
load_balancer: does-not-exist
|
load_balancer: does-not-exist
|
||||||
server: "{{ hcloud_server_name }}"
|
server: "{{ hcloud_server_name }}"
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
- "result.msg == 'resource (load_balancer) does not exist: does-not-exist'"
|
- "result.msg == 'resource (load_balancer) does not exist: does-not-exist'"
|
||||||
|
|
||||||
- name: test fail server does not exist
|
- name: test fail server does not exist
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: server
|
type: server
|
||||||
load_balancer: "{{ hcloud_load_balancer_name }}"
|
load_balancer: "{{ hcloud_load_balancer_name }}"
|
||||||
server: does-not-exist
|
server: does-not-exist
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
- "result.msg == 'resource (server) does not exist: does-not-exist'"
|
- "result.msg == 'resource (server) does not exist: does-not-exist'"
|
||||||
|
|
||||||
- name: test create load_balancer target with checkmode
|
- name: test create load_balancer target with checkmode
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: "server"
|
type: "server"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create load_balancer target
|
- name: test create load_balancer target
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: "server"
|
type: "server"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||||
|
|
||||||
- name: test create load_balancer target idempotency
|
- name: test create load_balancer target idempotency
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: "server"
|
type: "server"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
- load_balancer_target is not changed
|
- load_balancer_target is not changed
|
||||||
|
|
||||||
- name: test absent load_balancer target
|
- name: test absent load_balancer target
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: "server"
|
type: "server"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create label_selector target
|
- name: test create label_selector target
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: "label_selector"
|
type: "label_selector"
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
label_selector: "application=backend"
|
label_selector: "application=backend"
|
||||||
|
|
@ -120,7 +120,7 @@
|
||||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||||
|
|
||||||
- name: test create ip target
|
- name: test create ip target
|
||||||
hetzner.hcloud.hcloud_load_balancer_target:
|
hetzner.hcloud.load_balancer_target:
|
||||||
type: "ip"
|
type: "ip"
|
||||||
load_balancer: "{{ hcloud_load_balancer_name }}"
|
load_balancer: "{{ hcloud_load_balancer_name }}"
|
||||||
ip: "{{ hetzner_server_ip }}"
|
ip: "{{ hetzner_server_ip }}"
|
||||||
|
|
@ -135,7 +135,7 @@
|
||||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||||
|
|
||||||
- name: cleanup load_balancer
|
- name: cleanup load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -144,7 +144,7 @@
|
||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_load_balancer_type_info
|
- name: Gather hcloud_load_balancer_type_info
|
||||||
hetzner.hcloud.hcloud_load_balancer_type_info:
|
hetzner.hcloud.load_balancer_type_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_type_info
|
- name: Verify hcloud_load_balancer_type_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_load_balancer_type_info | list | count >= 1
|
- result.hcloud_load_balancer_type_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_type_info in check mode
|
- name: Gather hcloud_load_balancer_type_info in check mode
|
||||||
hetzner.hcloud.hcloud_load_balancer_type_info:
|
hetzner.hcloud.load_balancer_type_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_type_info in check mode
|
- name: Verify hcloud_load_balancer_type_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_load_balancer_type_info | list | count >= 1
|
- result.hcloud_load_balancer_type_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_type_info with correct id
|
- name: Gather hcloud_load_balancer_type_info with correct id
|
||||||
hetzner.hcloud.hcloud_load_balancer_type_info:
|
hetzner.hcloud.load_balancer_type_info:
|
||||||
id: "{{ hcloud_load_balancer_type_id }}"
|
id: "{{ hcloud_load_balancer_type_id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_type_info with correct id
|
- name: Verify hcloud_load_balancer_type_info with correct id
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- result.hcloud_load_balancer_type_info | list | count == 1
|
- result.hcloud_load_balancer_type_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_type_info with wrong id
|
- name: Gather hcloud_load_balancer_type_info with wrong id
|
||||||
hetzner.hcloud.hcloud_load_balancer_type_info:
|
hetzner.hcloud.load_balancer_type_info:
|
||||||
id: "{{ hcloud_load_balancer_type_id }}4321"
|
id: "{{ hcloud_load_balancer_type_id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_type_info with correct name
|
- name: Gather hcloud_load_balancer_type_info with correct name
|
||||||
hetzner.hcloud.hcloud_load_balancer_type_info:
|
hetzner.hcloud.load_balancer_type_info:
|
||||||
name: "{{ hcloud_load_balancer_type_name }}"
|
name: "{{ hcloud_load_balancer_type_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_type_info with correct name
|
- name: Verify hcloud_load_balancer_type_info with correct name
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
- result.hcloud_load_balancer_type_info | list | count == 1
|
- result.hcloud_load_balancer_type_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_load_balancer_type_info with wrong name
|
- name: Gather hcloud_load_balancer_type_info with wrong name
|
||||||
hetzner.hcloud.hcloud_load_balancer_type_info:
|
hetzner.hcloud.load_balancer_type_info:
|
||||||
name: "{{ hcloud_load_balancer_type_name }}-invalid"
|
name: "{{ hcloud_load_balancer_type_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_load_balancer_type_info with wrong name
|
- name: Verify hcloud_load_balancer_type_info with wrong name
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_location_info
|
- name: Gather hcloud_location_info
|
||||||
hetzner.hcloud.hcloud_location_info:
|
hetzner.hcloud.location_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_location_info
|
- name: Verify hcloud_location_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_location_info | list | count >= 5
|
- result.hcloud_location_info | list | count >= 5
|
||||||
|
|
||||||
- name: Gather hcloud_location_info in check mode
|
- name: Gather hcloud_location_info in check mode
|
||||||
hetzner.hcloud.hcloud_location_info:
|
hetzner.hcloud.location_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_location_info in check mode
|
- name: Verify hcloud_location_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_location_info | list | count >= 5
|
- result.hcloud_location_info | list | count >= 5
|
||||||
|
|
||||||
- name: Gather hcloud_location_info with correct id
|
- name: Gather hcloud_location_info with correct id
|
||||||
hetzner.hcloud.hcloud_location_info:
|
hetzner.hcloud.location_info:
|
||||||
id: "{{ hcloud_location_id }}"
|
id: "{{ hcloud_location_id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_location_info with correct id
|
- name: Verify hcloud_location_info with correct id
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- result.hcloud_location_info | list | count == 1
|
- result.hcloud_location_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_location_info with wrong id
|
- name: Gather hcloud_location_info with wrong id
|
||||||
hetzner.hcloud.hcloud_location_info:
|
hetzner.hcloud.location_info:
|
||||||
id: "{{ hcloud_location_id }}4321"
|
id: "{{ hcloud_location_id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_location_info with correct name
|
- name: Gather hcloud_location_info with correct name
|
||||||
hetzner.hcloud.hcloud_location_info:
|
hetzner.hcloud.location_info:
|
||||||
name: "{{ hcloud_location_name }}"
|
name: "{{ hcloud_location_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_location_info with correct name
|
- name: Verify hcloud_location_info with correct name
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
- result.hcloud_location_info | list | count == 1
|
- result.hcloud_location_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_location_info with wrong name
|
- name: Gather hcloud_location_info with wrong name
|
||||||
hetzner.hcloud.hcloud_location_info:
|
hetzner.hcloud.location_info:
|
||||||
name: "{{ hcloud_location_name }}-invalid"
|
name: "{{ hcloud_location_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_location_info with wrong name
|
- name: Verify hcloud_location_info with wrong name
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup ensure network is absent
|
- name: setup ensure network is absent
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- "{{ hcloud_network_name_with_vswitch }}"
|
- "{{ hcloud_network_name_with_vswitch }}"
|
||||||
|
|
||||||
- name: test missing ip_range parameter on create Network
|
- name: test missing ip_range parameter on create Network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
- 'result.msg == "missing required arguments: ip_range"'
|
- 'result.msg == "missing required arguments: ip_range"'
|
||||||
|
|
||||||
- name: test create Network with check mode
|
- name: test create Network with check mode
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create Network
|
- name: test create Network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
register: network
|
register: network
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
- network.hcloud_network.ip_range == "10.0.0.0/16"
|
- network.hcloud_network.ip_range == "10.0.0.0/16"
|
||||||
|
|
||||||
- name: test create Network idempotence
|
- name: test create Network idempotence
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
register: network
|
register: network
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
- network is not changed
|
- network is not changed
|
||||||
|
|
||||||
- name: test create Network with expose_routes_to_vswitch
|
- name: test create Network with expose_routes_to_vswitch
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name_with_vswitch}}"
|
name: "{{hcloud_network_name_with_vswitch}}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
expose_routes_to_vswitch: true
|
expose_routes_to_vswitch: true
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
- network.hcloud_network.expose_routes_to_vswitch is true
|
- network.hcloud_network.expose_routes_to_vswitch is true
|
||||||
|
|
||||||
- name: test create Network with expose_routes_to_vswitch idempotence
|
- name: test create Network with expose_routes_to_vswitch idempotence
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name_with_vswitch}}"
|
name: "{{hcloud_network_name_with_vswitch}}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
expose_routes_to_vswitch: true
|
expose_routes_to_vswitch: true
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
- network is not changed
|
- network is not changed
|
||||||
|
|
||||||
- name: test update Network label
|
- name: test update Network label
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
labels:
|
labels:
|
||||||
key: value
|
key: value
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
- network.hcloud_network.labels.key == "value"
|
- network.hcloud_network.labels.key == "value"
|
||||||
|
|
||||||
- name: test update Network label idempotency
|
- name: test update Network label idempotency
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
labels:
|
labels:
|
||||||
key: value
|
key: value
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
- network is not changed
|
- network is not changed
|
||||||
|
|
||||||
- name: test update Network ip range
|
- name: test update Network ip range
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
register: network
|
register: network
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
- network.hcloud_network.ip_range == "10.0.0.0/8"
|
- network.hcloud_network.ip_range == "10.0.0.0/8"
|
||||||
|
|
||||||
- name: test update Network ip range idempotency
|
- name: test update Network ip range idempotency
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
register: network
|
register: network
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
- network is not changed
|
- network is not changed
|
||||||
|
|
||||||
- name: test update Network expose_routes_to_vswitch
|
- name: test update Network expose_routes_to_vswitch
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name_with_vswitch}}"
|
name: "{{hcloud_network_name_with_vswitch}}"
|
||||||
expose_routes_to_vswitch: false
|
expose_routes_to_vswitch: false
|
||||||
register: network
|
register: network
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
- network.hcloud_network.expose_routes_to_vswitch is false
|
- network.hcloud_network.expose_routes_to_vswitch is false
|
||||||
|
|
||||||
- name: test update Network expose_routes_to_vswitch idempotency
|
- name: test update Network expose_routes_to_vswitch idempotency
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name_with_vswitch}}"
|
name: "{{hcloud_network_name_with_vswitch}}"
|
||||||
expose_routes_to_vswitch: false
|
expose_routes_to_vswitch: false
|
||||||
register: network
|
register: network
|
||||||
|
|
@ -144,7 +144,7 @@
|
||||||
- network is not changed
|
- network is not changed
|
||||||
|
|
||||||
- name: test update Network delete protection
|
- name: test update Network delete protection
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
|
|
@ -156,7 +156,7 @@
|
||||||
- network.hcloud_network.delete_protection is sameas true
|
- network.hcloud_network.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test update Network delete protection idempotency
|
- name: test update Network delete protection idempotency
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
|
|
@ -168,7 +168,7 @@
|
||||||
- network.hcloud_network.delete_protection is sameas true
|
- network.hcloud_network.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test Network without delete protection set to be idempotent
|
- name: test Network without delete protection set to be idempotent
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
register: network
|
register: network
|
||||||
|
|
@ -179,7 +179,7 @@
|
||||||
- network.hcloud_network.delete_protection is sameas true
|
- network.hcloud_network.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test delete Network fails if it is protected
|
- name: test delete Network fails if it is protected
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -191,7 +191,7 @@
|
||||||
- 'result.msg == "network deletion is protected"'
|
- 'result.msg == "network deletion is protected"'
|
||||||
|
|
||||||
- name: test update Network delete protection
|
- name: test update Network delete protection
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
|
|
@ -203,7 +203,7 @@
|
||||||
- network.hcloud_network.delete_protection is sameas false
|
- network.hcloud_network.delete_protection is sameas false
|
||||||
|
|
||||||
- name: test delete Network
|
- name: test delete Network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -213,7 +213,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: test create Network with delete protection
|
- name: test create Network with delete protection
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
|
|
@ -225,7 +225,7 @@
|
||||||
- network.hcloud_network.delete_protection is sameas true
|
- network.hcloud_network.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test delete Network fails if it is protected
|
- name: test delete Network fails if it is protected
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -237,7 +237,7 @@
|
||||||
- 'result.msg == "network deletion is protected"'
|
- 'result.msg == "network deletion is protected"'
|
||||||
|
|
||||||
- name: test update Network delete protection
|
- name: test update Network delete protection
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
register: network
|
register: network
|
||||||
|
|
@ -248,7 +248,7 @@
|
||||||
- network.hcloud_network.delete_protection is sameas false
|
- network.hcloud_network.delete_protection is sameas false
|
||||||
|
|
||||||
- name: test delete Network
|
- name: test delete Network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -258,7 +258,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: test delete Network with expose_routes_to_vswitch
|
- name: test delete Network with expose_routes_to_vswitch
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name_with_vswitch}}"
|
name: "{{hcloud_network_name_with_vswitch}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_network
|
- name: Cleanup test_network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_network
|
- name: Create test_network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
ip_range: 10.0.0.0/16
|
ip_range: 10.0.0.0/16
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
register: test_network
|
register: test_network
|
||||||
|
|
||||||
- name: Create test_subnetwork
|
- name: Create test_subnetwork
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
type: server
|
type: server
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
register: test_subnetwork
|
register: test_subnetwork
|
||||||
|
|
||||||
- name: Create test_route
|
- name: Create test_route
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
destination: 10.0.3.0/24
|
destination: 10.0.3.0/24
|
||||||
gateway: 10.0.2.1
|
gateway: 10.0.2.1
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_network_info
|
- name: Gather hcloud_network_info
|
||||||
hetzner.hcloud.hcloud_network_info:
|
hetzner.hcloud.network_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_network_info
|
- name: Verify hcloud_network_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_network_info | list | count >= 1
|
- result.hcloud_network_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_network_info in check mode
|
- name: Gather hcloud_network_info in check mode
|
||||||
hetzner.hcloud.hcloud_network_info:
|
hetzner.hcloud.network_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_network_info in check mode
|
- name: Verify hcloud_network_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_network_info | list | count >= 1
|
- result.hcloud_network_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_network_info with correct id
|
- name: Gather hcloud_network_info with correct id
|
||||||
hetzner.hcloud.hcloud_network_info:
|
hetzner.hcloud.network_info:
|
||||||
id: "{{ test_network.hcloud_network.id }}"
|
id: "{{ test_network.hcloud_network.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_network_info with correct id
|
- name: Verify hcloud_network_info with correct id
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
- result.hcloud_network_info[0].routes | list | count >= 1
|
- result.hcloud_network_info[0].routes | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_network_info with wrong id
|
- name: Gather hcloud_network_info with wrong id
|
||||||
hetzner.hcloud.hcloud_network_info:
|
hetzner.hcloud.network_info:
|
||||||
id: "{{ test_network.hcloud_network.id }}4321"
|
id: "{{ test_network.hcloud_network.id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_network_info with correct name
|
- name: Gather hcloud_network_info with correct name
|
||||||
hetzner.hcloud.hcloud_network_info:
|
hetzner.hcloud.network_info:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_network_info with correct name
|
- name: Verify hcloud_network_info with correct name
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
- result.hcloud_network_info | list | count == 1
|
- result.hcloud_network_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_network_info with wrong name
|
- name: Gather hcloud_network_info with wrong name
|
||||||
hetzner.hcloud.hcloud_network_info:
|
hetzner.hcloud.network_info:
|
||||||
name: "{{ hcloud_network_name }}-invalid"
|
name: "{{ hcloud_network_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_network_info with wrong name
|
- name: Verify hcloud_network_info with wrong name
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
- result.hcloud_network_info | list | count == 0
|
- result.hcloud_network_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_network_info with correct label selector
|
- name: Gather hcloud_network_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_network_info:
|
hetzner.hcloud.network_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_network_info with correct label selector
|
- name: Verify hcloud_network_info with correct label selector
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_network_info with wrong label selector
|
- name: Gather hcloud_network_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_network_info:
|
hetzner.hcloud.network_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_network_info with wrong label selector
|
- name: Verify hcloud_network_info with wrong label selector
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_ssh_key
|
- name: Cleanup test_ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_ssh_key
|
- name: Create test_ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
public_key: "{{ test_ssh_keypair.public_key }}"
|
public_key: "{{ test_ssh_keypair.public_key }}"
|
||||||
register: test_ssh_key
|
register: test_ssh_key
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,17 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup placement group to be absent
|
- name: setup placement group to be absent
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
name: "{{ hcloud_placement_group_name }}"
|
name: "{{ hcloud_placement_group_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: setup server to be absent
|
- name: setup server to be absent
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: test missing required parameters on create placement group
|
- name: test missing required parameters on create placement group
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create placement group
|
- name: verify fail test missing required parameters on create placement group
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
- 'result.msg == "one of the following is required: id, name"'
|
- 'result.msg == "one of the following is required: id, name"'
|
||||||
|
|
||||||
- name: test create placement group with check mode
|
- name: test create placement group with check mode
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
name: "{{ hcloud_placement_group_name }}"
|
name: "{{ hcloud_placement_group_name }}"
|
||||||
type: spread
|
type: spread
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create placement group
|
- name: test create placement group
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
name: "{{ hcloud_placement_group_name }}"
|
name: "{{ hcloud_placement_group_name }}"
|
||||||
type: spread
|
type: spread
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
- placement_group.hcloud_placement_group.servers | list | count == 0
|
- placement_group.hcloud_placement_group.servers | list | count == 0
|
||||||
|
|
||||||
- name: test create placement group idempotence
|
- name: test create placement group idempotence
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
name: "{{ hcloud_placement_group_name }}"
|
name: "{{ hcloud_placement_group_name }}"
|
||||||
type: spread
|
type: spread
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test create server with placement group
|
- name: test create server with placement group
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
placement_group: "{{ hcloud_placement_group_name }}"
|
placement_group: "{{ hcloud_placement_group_name }}"
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
- server.hcloud_server.placement_group == "{{ hcloud_placement_group_name }}"
|
- server.hcloud_server.placement_group == "{{ hcloud_placement_group_name }}"
|
||||||
|
|
||||||
- name: test remove server from placement group
|
- name: test remove server from placement group
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
placement_group: null
|
placement_group: null
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -90,7 +90,7 @@
|
||||||
- result.hcloud_server.placement_group == None
|
- result.hcloud_server.placement_group == None
|
||||||
|
|
||||||
- name: test add server to placement group
|
- name: test add server to placement group
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
placement_group: "{{ hcloud_placement_group_name }}"
|
placement_group: "{{ hcloud_placement_group_name }}"
|
||||||
force: True
|
force: True
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
- result.hcloud_server.status == "running"
|
- result.hcloud_server.status == "running"
|
||||||
|
|
||||||
- name: test add server to placement group idempotence
|
- name: test add server to placement group idempotence
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
placement_group: "{{ hcloud_placement_group_name }}"
|
placement_group: "{{ hcloud_placement_group_name }}"
|
||||||
force: True
|
force: True
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
- result.hcloud_server.status == "running"
|
- result.hcloud_server.status == "running"
|
||||||
|
|
||||||
- name: test update placement group with check mode
|
- name: test update placement group with check mode
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
id: "{{ placement_group.hcloud_placement_group.id }}"
|
id: "{{ placement_group.hcloud_placement_group.id }}"
|
||||||
name: "changed-{{ hcloud_placement_group_name }}"
|
name: "changed-{{ hcloud_placement_group_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test update placement group
|
- name: test update placement group
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
id: "{{ placement_group.hcloud_placement_group.id }}"
|
id: "{{ placement_group.hcloud_placement_group.id }}"
|
||||||
name: "changed-{{ hcloud_placement_group_name }}"
|
name: "changed-{{ hcloud_placement_group_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -142,7 +142,7 @@
|
||||||
- result.hcloud_placement_group.name == "changed-{{ hcloud_placement_group_name }}"
|
- result.hcloud_placement_group.name == "changed-{{ hcloud_placement_group_name }}"
|
||||||
|
|
||||||
- name: test update placement group idempotence
|
- name: test update placement group idempotence
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
id: "{{ placement_group.hcloud_placement_group.id }}"
|
id: "{{ placement_group.hcloud_placement_group.id }}"
|
||||||
name: "changed-{{ hcloud_placement_group_name }}"
|
name: "changed-{{ hcloud_placement_group_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -154,12 +154,12 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: absent server
|
- name: absent server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
id: "{{ server.hcloud_server.id }}"
|
id: "{{ server.hcloud_server.id }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: absent placement group
|
- name: absent placement group
|
||||||
hetzner.hcloud.hcloud_placement_group:
|
hetzner.hcloud.placement_group:
|
||||||
id: "{{ placement_group.hcloud_placement_group.id }}"
|
id: "{{ placement_group.hcloud_placement_group.id }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup ensure primary ip is absent
|
- name: setup ensure primary ip is absent
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: test create Primary IP with check mode
|
- name: test create Primary IP with check mode
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- primaryIP is changed
|
- primaryIP is changed
|
||||||
|
|
||||||
- name: test create Primary IP
|
- name: test create Primary IP
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
- primaryIP.hcloud_primary_ip.datacenter == "fsn1-dc14"
|
- primaryIP.hcloud_primary_ip.datacenter == "fsn1-dc14"
|
||||||
|
|
||||||
- name: test create Primary IP idempotency
|
- name: test create Primary IP idempotency
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
- primaryIP is not changed
|
- primaryIP is not changed
|
||||||
|
|
||||||
- name: test update Primary IP
|
- name: test update Primary IP
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
- primaryIP is changed
|
- primaryIP is changed
|
||||||
|
|
||||||
- name: test update Primary IP idempotency
|
- name: test update Primary IP idempotency
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
- primaryIP is not changed
|
- primaryIP is not changed
|
||||||
|
|
||||||
- name: test update Primary IP with same labels
|
- name: test update Primary IP with same labels
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
- primaryIP is not changed
|
- primaryIP is not changed
|
||||||
|
|
||||||
- name: test update Primary IP with other labels
|
- name: test update Primary IP with other labels
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -96,7 +96,7 @@
|
||||||
- primaryIP is changed
|
- primaryIP is changed
|
||||||
|
|
||||||
- name: test update Primary IP with other labels in different order
|
- name: test update Primary IP with other labels in different order
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
- primaryIP is not changed
|
- primaryIP is not changed
|
||||||
|
|
||||||
- name: test update Primary IP delete protection
|
- name: test update Primary IP delete protection
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
- primaryIP.hcloud_primary_ip.delete_protection is sameas true
|
- primaryIP.hcloud_primary_ip.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test update Primary IP delete protection idempotency
|
- name: test update Primary IP delete protection idempotency
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
- primaryIP.hcloud_primary_ip.delete_protection is sameas true
|
- primaryIP.hcloud_primary_ip.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test Primary IP without delete protection set to be idempotent
|
- name: test Primary IP without delete protection set to be idempotent
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
register: primaryIP
|
register: primaryIP
|
||||||
|
|
@ -145,7 +145,7 @@
|
||||||
- primaryIP.hcloud_primary_ip.delete_protection is sameas true
|
- primaryIP.hcloud_primary_ip.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test delete Primary IP fails if it is protected
|
- name: test delete Primary IP fails if it is protected
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -157,7 +157,7 @@
|
||||||
- 'result.msg == "Primary IP deletion is protected"'
|
- 'result.msg == "Primary IP deletion is protected"'
|
||||||
|
|
||||||
- name: test update Primary IP delete protection
|
- name: test update Primary IP delete protection
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
- primaryIP.hcloud_primary_ip.delete_protection is sameas false
|
- primaryIP.hcloud_primary_ip.delete_protection is sameas false
|
||||||
|
|
||||||
- name: test delete primary ip
|
- name: test delete primary ip
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -179,7 +179,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create ipv6 primary ip
|
- name: test create ipv6 primary ip
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv6
|
type: ipv6
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -191,7 +191,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test delete ipv6 primary ip
|
- name: test delete ipv6 primary ip
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -201,7 +201,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create Primary IP with delete protection
|
- name: test create Primary IP with delete protection
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: fsn1-dc14
|
datacenter: fsn1-dc14
|
||||||
|
|
@ -214,7 +214,7 @@
|
||||||
- primaryIP.hcloud_primary_ip.delete_protection is sameas true
|
- primaryIP.hcloud_primary_ip.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test delete Primary IP fails if it is protected
|
- name: test delete Primary IP fails if it is protected
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -226,7 +226,7 @@
|
||||||
- 'result.msg == "Primary IP deletion is protected"'
|
- 'result.msg == "Primary IP deletion is protected"'
|
||||||
|
|
||||||
- name: test update Primary IP delete protection
|
- name: test update Primary IP delete protection
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
|
|
@ -238,7 +238,7 @@
|
||||||
- primaryIP.hcloud_primary_ip.delete_protection is sameas false
|
- primaryIP.hcloud_primary_ip.delete_protection is sameas false
|
||||||
|
|
||||||
- name: test delete primary ip
|
- name: test delete primary ip
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_primary_ip
|
- name: Cleanup test_primary_ip
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_primary_ip
|
- name: Create test_primary_ip
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
datacenter: fsn1-dc14
|
datacenter: fsn1-dc14
|
||||||
type: ipv4
|
type: ipv4
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_primary_ip_info
|
- name: Gather hcloud_primary_ip_info
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_primary_ip_info
|
- name: Verify hcloud_primary_ip_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_primary_ip_info | list | count >= 1
|
- result.hcloud_primary_ip_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_primary_ip_info in check mode
|
- name: Gather hcloud_primary_ip_info in check mode
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_primary_ip_info in check mode
|
- name: Verify hcloud_primary_ip_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_primary_ip_info | list | count >= 1
|
- result.hcloud_primary_ip_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_primary_ip_info with correct id
|
- name: Gather hcloud_primary_ip_info with correct id
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
id: "{{ test_primary_ip.hcloud_primary_ip.id }}"
|
id: "{{ test_primary_ip.hcloud_primary_ip.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_primary_ip_info with correct id
|
- name: Verify hcloud_primary_ip_info with correct id
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- result.hcloud_primary_ip_info | list | count == 1
|
- result.hcloud_primary_ip_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_primary_ip_info with wrong id
|
- name: Gather hcloud_primary_ip_info with wrong id
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
id: "{{ test_primary_ip.hcloud_primary_ip.id }}4321"
|
id: "{{ test_primary_ip.hcloud_primary_ip.id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_primary_ip_info with correct name
|
- name: Gather hcloud_primary_ip_info with correct name
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_primary_ip_info with correct name
|
- name: Verify hcloud_primary_ip_info with correct name
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
- result.hcloud_primary_ip_info | list | count == 1
|
- result.hcloud_primary_ip_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_primary_ip_info with wrong name
|
- name: Gather hcloud_primary_ip_info with wrong name
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
name: "{{ hcloud_primary_ip_name }}-invalid"
|
name: "{{ hcloud_primary_ip_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_primary_ip_info with wrong name
|
- name: Verify hcloud_primary_ip_info with wrong name
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
- result.hcloud_primary_ip_info | list | count == 0
|
- result.hcloud_primary_ip_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_primary_ip_info with correct label selector
|
- name: Gather hcloud_primary_ip_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_primary_ip_info with correct label selector
|
- name: Verify hcloud_primary_ip_info with correct label selector
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_primary_ip_info with wrong label selector
|
- name: Gather hcloud_primary_ip_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_primary_ip_info:
|
hetzner.hcloud.primary_ip_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_primary_ip_info with wrong label selector
|
- name: Verify hcloud_primary_ip_info with wrong label selector
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_server
|
- name: Cleanup test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Cleanup test_primary_ip
|
- name: Cleanup test_primary_ip
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Cleanup test_floating_ip
|
- name: Cleanup test_floating_ip
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Cleanup test_load_balancer
|
- name: Cleanup test_load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_server
|
- name: Create test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
register: test_server
|
register: test_server
|
||||||
|
|
||||||
- name: Create test_primary_ip
|
- name: Create test_primary_ip
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: fsn1-dc14
|
datacenter: fsn1-dc14
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
register: test_primary_ip
|
register: test_primary_ip
|
||||||
|
|
||||||
- name: Create test_floating_ip
|
- name: Create test_floating_ip
|
||||||
hetzner.hcloud.hcloud_floating_ip:
|
hetzner.hcloud.floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: fsn1
|
home_location: fsn1
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
register: test_floating_ip
|
register: test_floating_ip
|
||||||
|
|
||||||
- name: Create test_load_balancer
|
- name: Create test_load_balancer
|
||||||
hetzner.hcloud.hcloud_load_balancer:
|
hetzner.hcloud.load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
load_balancer_type: lb11
|
load_balancer_type: lb11
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Test missing required parameters
|
- name: Test missing required parameters
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
state: present
|
state: present
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
- 'result.msg == "missing required arguments: ip_address"'
|
- 'result.msg == "missing required arguments: ip_address"'
|
||||||
|
|
||||||
- name: Test create with checkmode
|
- name: Test create with checkmode
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: "{{ hcloud_server_name }}"
|
server: "{{ hcloud_server_name }}"
|
||||||
ip_address: "{{ test_server.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
ip_address: "{{ test_server.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: Test create
|
- name: Test create
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: "{{ hcloud_server_name }}"
|
server: "{{ hcloud_server_name }}"
|
||||||
ip_address: "{{ test_server.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
ip_address: "{{ test_server.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
- result.hcloud_rdns.dns_ptr == "example.com"
|
- result.hcloud_rdns.dns_ptr == "example.com"
|
||||||
|
|
||||||
- name: Test create idempotency
|
- name: Test create idempotency
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: "{{ hcloud_server_name }}"
|
server: "{{ hcloud_server_name }}"
|
||||||
ip_address: "{{ test_server.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
ip_address: "{{ test_server.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: Test create with not existing server
|
- name: Test create with not existing server
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: not-existing
|
server: not-existing
|
||||||
ip_address: "127.0.0.1"
|
ip_address: "127.0.0.1"
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
- 'result.msg == "resource (server) does not exist: not-existing"'
|
- 'result.msg == "resource (server) does not exist: not-existing"'
|
||||||
|
|
||||||
- name: Test update
|
- name: Test update
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: "{{ hcloud_server_name }}"
|
server: "{{ hcloud_server_name }}"
|
||||||
ip_address: "{{ test_server.hcloud_server.ipv4_address }}"
|
ip_address: "{{ test_server.hcloud_server.ipv4_address }}"
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
- result.hcloud_rdns.ip_address == "{{ test_server.hcloud_server.ipv4_address }}"
|
- result.hcloud_rdns.ip_address == "{{ test_server.hcloud_server.ipv4_address }}"
|
||||||
|
|
||||||
- name: Test update reset
|
- name: Test update reset
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: "{{ hcloud_server_name }}"
|
server: "{{ hcloud_server_name }}"
|
||||||
ip_address: "{{ test_server.hcloud_server.ipv4_address }}"
|
ip_address: "{{ test_server.hcloud_server.ipv4_address }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
- result.hcloud_rdns.dns_ptr != "example.com"
|
- result.hcloud_rdns.dns_ptr != "example.com"
|
||||||
|
|
||||||
- name: Test delete
|
- name: Test delete
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
server: "{{ hcloud_server_name }}"
|
server: "{{ hcloud_server_name }}"
|
||||||
ip_address: "{{ test_server.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
ip_address: "{{ test_server.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: Test create with primary ip
|
- name: Test create with primary ip
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
primary_ip: "{{ hcloud_primary_ip_name }}"
|
primary_ip: "{{ hcloud_primary_ip_name }}"
|
||||||
ip_address: "{{ test_primary_ip.hcloud_primary_ip.ip }}"
|
ip_address: "{{ test_primary_ip.hcloud_primary_ip.ip }}"
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
- result.hcloud_rdns.dns_ptr == "example.com"
|
- result.hcloud_rdns.dns_ptr == "example.com"
|
||||||
|
|
||||||
- name: Test create with floating ip
|
- name: Test create with floating ip
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
floating_ip: "{{ hcloud_floating_ip_name }}"
|
floating_ip: "{{ hcloud_floating_ip_name }}"
|
||||||
ip_address: "{{ test_floating_ip.hcloud_floating_ip.ip }}"
|
ip_address: "{{ test_floating_ip.hcloud_floating_ip.ip }}"
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
- result.hcloud_rdns.dns_ptr == "example.com"
|
- result.hcloud_rdns.dns_ptr == "example.com"
|
||||||
|
|
||||||
- name: Test create with load balancer
|
- name: Test create with load balancer
|
||||||
hetzner.hcloud.hcloud_rdns:
|
hetzner.hcloud.rdns:
|
||||||
load_balancer: "{{ hcloud_load_balancer_name }}"
|
load_balancer: "{{ hcloud_load_balancer_name }}"
|
||||||
ip_address: "{{ test_load_balancer.hcloud_load_balancer.ipv4_address }}"
|
ip_address: "{{ test_load_balancer.hcloud_load_balancer.ipv4_address }}"
|
||||||
dns_ptr: example.com
|
dns_ptr: example.com
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup
|
- name: setup
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
- network is success
|
- network is success
|
||||||
|
|
||||||
- name: test missing required parameters on create route
|
- name: test missing required parameters on create route
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
- 'result.msg == "missing required arguments: destination, gateway, network"'
|
- 'result.msg == "missing required arguments: destination, gateway, network"'
|
||||||
|
|
||||||
- name: test create route with checkmode
|
- name: test create route with checkmode
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
destination: "10.100.1.0/24"
|
destination: "10.100.1.0/24"
|
||||||
gateway: "10.0.1.1"
|
gateway: "10.0.1.1"
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create route
|
- name: test create route
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
destination: "10.100.1.0/24"
|
destination: "10.100.1.0/24"
|
||||||
gateway: "10.0.1.1"
|
gateway: "10.0.1.1"
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
- route.hcloud_route.gateway == "10.0.1.1"
|
- route.hcloud_route.gateway == "10.0.1.1"
|
||||||
|
|
||||||
- name: test create route idempotency
|
- name: test create route idempotency
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
destination: "10.100.1.0/24"
|
destination: "10.100.1.0/24"
|
||||||
gateway: "10.0.1.1"
|
gateway: "10.0.1.1"
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test fail create route with wrong gateway
|
- name: test fail create route with wrong gateway
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
destination: "10.100.1.0/24"
|
destination: "10.100.1.0/24"
|
||||||
gateway: "10.0.1.2"
|
gateway: "10.0.1.2"
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
- route is failed
|
- route is failed
|
||||||
|
|
||||||
- name: test absent route
|
- name: test absent route
|
||||||
hetzner.hcloud.hcloud_route:
|
hetzner.hcloud.route:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
destination: "10.100.1.0/24"
|
destination: "10.100.1.0/24"
|
||||||
gateway: "10.0.1.1"
|
gateway: "10.0.1.1"
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_ssh_key
|
- name: Cleanup test_ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_ssh_key
|
- name: Create test_ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
public_key: "{{ test_ssh_keypair.public_key }}"
|
public_key: "{{ test_ssh_keypair.public_key }}"
|
||||||
register: test_ssh_key
|
register: test_ssh_key
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
- name: test create server with check mode
|
- name: test create server with check mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create server
|
- name: test create server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name}}"
|
name: "{{ hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
- main_server.root_password != ""
|
- main_server.root_password != ""
|
||||||
|
|
||||||
- name: test create server idempotence
|
- name: test create server idempotence
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: started
|
state: started
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test stop server with check mode
|
- name: test stop server with check mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
- result.hcloud_server.status == "running"
|
- result.hcloud_server.status == "running"
|
||||||
|
|
||||||
- name: test stop server
|
- name: test stop server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
- result.hcloud_server.status == "off"
|
- result.hcloud_server.status == "off"
|
||||||
|
|
||||||
- name: test start server with check mode
|
- name: test start server with check mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: started
|
state: started
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test start server
|
- name: test start server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: started
|
state: started
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
- result.hcloud_server.status == "running"
|
- result.hcloud_server.status == "running"
|
||||||
|
|
||||||
- name: test start server idempotence
|
- name: test start server idempotence
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: started
|
state: started
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
- result.hcloud_server.status == "running"
|
- result.hcloud_server.status == "running"
|
||||||
|
|
||||||
- name: test stop server by its id
|
- name: test stop server by its id
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
id: "{{ main_server.hcloud_server.id }}"
|
id: "{{ main_server.hcloud_server.id }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
- result.hcloud_server.status == "off"
|
- result.hcloud_server.status == "off"
|
||||||
|
|
||||||
- name: test resize server running without force
|
- name: test resize server running without force
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: "cx21"
|
server_type: "cx21"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -119,7 +119,7 @@
|
||||||
- result.hcloud_server.server_type == "cx11"
|
- result.hcloud_server.server_type == "cx11"
|
||||||
|
|
||||||
- name: test resize server with check mode
|
- name: test resize server with check mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: "cx21"
|
server_type: "cx21"
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
@ -131,7 +131,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test resize server without disk
|
- name: test resize server without disk
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: "cx21"
|
server_type: "cx21"
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
@ -143,7 +143,7 @@
|
||||||
- result.hcloud_server.server_type == "cx21"
|
- result.hcloud_server.server_type == "cx21"
|
||||||
|
|
||||||
- name: test resize server idempotence
|
- name: test resize server idempotence
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: "cx21"
|
server_type: "cx21"
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
@ -154,7 +154,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test resize server to smaller plan
|
- name: test resize server to smaller plan
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: "cx11"
|
server_type: "cx11"
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
@ -166,7 +166,7 @@
|
||||||
- result.hcloud_server.server_type == "cx11"
|
- result.hcloud_server.server_type == "cx11"
|
||||||
|
|
||||||
- name: test resize server with disk
|
- name: test resize server with disk
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: "cx21"
|
server_type: "cx21"
|
||||||
upgrade_disk: true
|
upgrade_disk: true
|
||||||
|
|
@ -179,7 +179,7 @@
|
||||||
- result.hcloud_server.server_type == "cx21"
|
- result.hcloud_server.server_type == "cx21"
|
||||||
|
|
||||||
- name: test enable backups with check mode
|
- name: test enable backups with check mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
backups: true
|
backups: true
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
@ -191,7 +191,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test enable backups
|
- name: test enable backups
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
backups: true
|
backups: true
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
@ -203,7 +203,7 @@
|
||||||
- result.hcloud_server.backup_window != ""
|
- result.hcloud_server.backup_window != ""
|
||||||
|
|
||||||
- name: test enable backups idempotence
|
- name: test enable backups idempotence
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
backups: true
|
backups: true
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
@ -215,7 +215,7 @@
|
||||||
- result.hcloud_server.backup_window != ""
|
- result.hcloud_server.backup_window != ""
|
||||||
|
|
||||||
- name: test backups are not accidentally disabled
|
- name: test backups are not accidentally disabled
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
# Make sure that backups are not disabled because a partial server object without "backups" was supplied somewhere
|
# Make sure that backups are not disabled because a partial server object without "backups" was supplied somewhere
|
||||||
# to update some unrelated properties.
|
# to update some unrelated properties.
|
||||||
|
|
@ -230,7 +230,7 @@
|
||||||
- result.hcloud_server.backup_window != ""
|
- result.hcloud_server.backup_window != ""
|
||||||
|
|
||||||
- name: test rebuild server
|
- name: test rebuild server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
state: rebuild
|
state: rebuild
|
||||||
|
|
@ -242,7 +242,7 @@
|
||||||
- result.hcloud_server.id == result_after_test.hcloud_server.id
|
- result.hcloud_server.id == result_after_test.hcloud_server.id
|
||||||
|
|
||||||
- name: test rebuild server with check mode
|
- name: test rebuild server with check mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
state: rebuild
|
state: rebuild
|
||||||
|
|
@ -254,7 +254,7 @@
|
||||||
- result_after_test is changed
|
- result_after_test is changed
|
||||||
|
|
||||||
- name: test update server protection booth protection arguments are required
|
- name: test update server protection booth protection arguments are required
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -267,7 +267,7 @@
|
||||||
- 'result_after_test.msg == "parameters are required together: delete_protection, rebuild_protection"'
|
- 'result_after_test.msg == "parameters are required together: delete_protection, rebuild_protection"'
|
||||||
|
|
||||||
- name: test update server protection fails if they are not the same
|
- name: test update server protection fails if they are not the same
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
rebuild_protection: false
|
rebuild_protection: false
|
||||||
|
|
@ -280,7 +280,7 @@
|
||||||
- result_after_test is failed
|
- result_after_test is failed
|
||||||
|
|
||||||
- name: test update server protection
|
- name: test update server protection
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
rebuild_protection: true
|
rebuild_protection: true
|
||||||
|
|
@ -295,7 +295,7 @@
|
||||||
- result_after_test.hcloud_server.rebuild_protection is sameas true
|
- result_after_test.hcloud_server.rebuild_protection is sameas true
|
||||||
|
|
||||||
- name: test server without protection set to be idempotent
|
- name: test server without protection set to be idempotent
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
register: result_after_test
|
register: result_after_test
|
||||||
- name: verify test server without protection set to be idempotent
|
- name: verify test server without protection set to be idempotent
|
||||||
|
|
@ -306,7 +306,7 @@
|
||||||
- result_after_test.hcloud_server.rebuild_protection is sameas true
|
- result_after_test.hcloud_server.rebuild_protection is sameas true
|
||||||
|
|
||||||
- name: test delete server fails if it is protected
|
- name: test delete server fails if it is protected
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -318,7 +318,7 @@
|
||||||
- 'result.msg == "server deletion is protected"'
|
- 'result.msg == "server deletion is protected"'
|
||||||
|
|
||||||
- name: test rebuild server fails if it is protected
|
- name: test rebuild server fails if it is protected
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
state: rebuild
|
state: rebuild
|
||||||
|
|
@ -331,7 +331,7 @@
|
||||||
- 'result.msg == "server rebuild is protected"'
|
- 'result.msg == "server rebuild is protected"'
|
||||||
|
|
||||||
- name: test remove server protection
|
- name: test remove server protection
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
rebuild_protection: false
|
rebuild_protection: false
|
||||||
|
|
@ -346,7 +346,7 @@
|
||||||
- result_after_test.hcloud_server.rebuild_protection is sameas false
|
- result_after_test.hcloud_server.rebuild_protection is sameas false
|
||||||
|
|
||||||
- name: absent server
|
- name: absent server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -356,7 +356,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: test create server with ssh key
|
- name: test create server with ssh key
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name}}"
|
name: "{{ hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
|
|
@ -374,7 +374,7 @@
|
||||||
- main_server.root_password != ""
|
- main_server.root_password != ""
|
||||||
|
|
||||||
- name: test activate rescue mode with check_mode
|
- name: test activate rescue mode with check_mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
rescue_mode: "linux64"
|
rescue_mode: "linux64"
|
||||||
ssh_keys:
|
ssh_keys:
|
||||||
|
|
@ -388,7 +388,7 @@
|
||||||
- main_server is changed
|
- main_server is changed
|
||||||
|
|
||||||
- name: test activate rescue mode
|
- name: test activate rescue mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
rescue_mode: "linux64"
|
rescue_mode: "linux64"
|
||||||
ssh_keys:
|
ssh_keys:
|
||||||
|
|
@ -402,7 +402,7 @@
|
||||||
- main_server.hcloud_server.rescue_enabled is sameas true
|
- main_server.hcloud_server.rescue_enabled is sameas true
|
||||||
|
|
||||||
- name: test disable rescue mode
|
- name: test disable rescue mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
ssh_keys:
|
ssh_keys:
|
||||||
- "{{ hcloud_ssh_key_name }}"
|
- "{{ hcloud_ssh_key_name }}"
|
||||||
|
|
@ -415,7 +415,7 @@
|
||||||
- main_server.hcloud_server.rescue_enabled is sameas false
|
- main_server.hcloud_server.rescue_enabled is sameas false
|
||||||
|
|
||||||
- name: test activate rescue mode without ssh keys
|
- name: test activate rescue mode without ssh keys
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
rescue_mode: "linux64"
|
rescue_mode: "linux64"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -427,7 +427,7 @@
|
||||||
- main_server.hcloud_server.rescue_enabled is sameas true
|
- main_server.hcloud_server.rescue_enabled is sameas true
|
||||||
|
|
||||||
- name: absent server
|
- name: absent server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -437,7 +437,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: test create server with rescue_mode
|
- name: test create server with rescue_mode
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name}}"
|
name: "{{ hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
|
|
@ -457,7 +457,7 @@
|
||||||
- main_server.hcloud_server.rescue_enabled is sameas true
|
- main_server.hcloud_server.rescue_enabled is sameas true
|
||||||
|
|
||||||
- name: absent server
|
- name: absent server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -466,7 +466,7 @@
|
||||||
that:
|
that:
|
||||||
- result is success
|
- result is success
|
||||||
- name: test create server with labels
|
- name: test create server with labels
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name}}"
|
name: "{{ hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
|
|
@ -485,7 +485,7 @@
|
||||||
- main_server.hcloud_server.labels.mylabel == "val123"
|
- main_server.hcloud_server.labels.mylabel == "val123"
|
||||||
|
|
||||||
- name: test update server with labels
|
- name: test update server with labels
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name}}"
|
name: "{{ hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
|
|
@ -504,7 +504,7 @@
|
||||||
- main_server.hcloud_server.labels.mylabel == "val123"
|
- main_server.hcloud_server.labels.mylabel == "val123"
|
||||||
|
|
||||||
- name: test update server with labels in other order
|
- name: test update server with labels in other order
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name}}"
|
name: "{{ hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
|
|
@ -521,7 +521,7 @@
|
||||||
- main_server is not changed
|
- main_server is not changed
|
||||||
|
|
||||||
- name: cleanup with labels
|
- name: cleanup with labels
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -531,7 +531,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: test create server with enabled backups
|
- name: test create server with enabled backups
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
backups: true
|
backups: true
|
||||||
|
|
@ -547,7 +547,7 @@
|
||||||
- result.hcloud_server.backup_window != ""
|
- result.hcloud_server.backup_window != ""
|
||||||
|
|
||||||
- name: cleanup test create server with enabled backups
|
- name: cleanup test create server with enabled backups
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -557,7 +557,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: test create server with protection
|
- name: test create server with protection
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
rebuild_protection: true
|
rebuild_protection: true
|
||||||
|
|
@ -576,7 +576,7 @@
|
||||||
- result_after_test.hcloud_server.rebuild_protection is sameas true
|
- result_after_test.hcloud_server.rebuild_protection is sameas true
|
||||||
|
|
||||||
- name: test delete server fails if it is protected
|
- name: test delete server fails if it is protected
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -588,7 +588,7 @@
|
||||||
- 'result.msg == "server deletion is protected"'
|
- 'result.msg == "server deletion is protected"'
|
||||||
|
|
||||||
- name: remove protection from server
|
- name: remove protection from server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
rebuild_protection: false
|
rebuild_protection: false
|
||||||
|
|
@ -603,7 +603,7 @@
|
||||||
- result_after_test.hcloud_server.rebuild_protection is sameas false
|
- result_after_test.hcloud_server.rebuild_protection is sameas false
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: test add not existing firewall should fail
|
- name: test add not existing firewall should fail
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
firewalls:
|
firewalls:
|
||||||
- not-existing
|
- not-existing
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
- 'result.msg == "firewall not-existing was not found"'
|
- 'result.msg == "firewall not-existing was not found"'
|
||||||
- name: setup create firewalls
|
- name: setup create firewalls
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
rules:
|
rules:
|
||||||
- direction: in
|
- direction: in
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- "{{ hcloud_firewall_name }}2"
|
- "{{ hcloud_firewall_name }}2"
|
||||||
|
|
||||||
- name: test create server with firewalls
|
- name: test create server with firewalls
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
firewalls:
|
firewalls:
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create server with firewalls idempotence
|
- name: test create server with firewalls idempotence
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
firewalls:
|
firewalls:
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test update server with firewalls
|
- name: test update server with firewalls
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
firewalls:
|
firewalls:
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test update server with firewalls idempotence
|
- name: test update server with firewalls idempotence
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
firewalls:
|
firewalls:
|
||||||
|
|
@ -92,12 +92,12 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: cleanup server with firewalls
|
- name: cleanup server with firewalls
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: cleanup test create firewall
|
- name: cleanup test create firewall
|
||||||
hetzner.hcloud.hcloud_firewall:
|
hetzner.hcloud.firewall:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,28 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup create primary ipv4
|
- name: setup create primary ipv4
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}v4"
|
name: "{{ hcloud_primary_ip_name }}v4"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
register: primaryIPv4
|
register: primaryIPv4
|
||||||
|
|
||||||
- name: setup create second primary ipv4
|
- name: setup create second primary ipv4
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}v42"
|
name: "{{ hcloud_primary_ip_name }}v42"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
register: secondPrimaryIPv4
|
register: secondPrimaryIPv4
|
||||||
|
|
||||||
- name: setup create primary ipv6
|
- name: setup create primary ipv6
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_primary_ip_name }}v6"
|
name: "{{ hcloud_primary_ip_name }}v6"
|
||||||
type: ipv6
|
type: ipv6
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
register: primaryIPv6
|
register: primaryIPv6
|
||||||
|
|
||||||
- name: test create server with primary ips
|
- name: test create server with primary ips
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test update server with primary ips
|
- name: test update server with primary ips
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -58,23 +58,23 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: cleanup server with primary ips
|
- name: cleanup server with primary ips
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: cleanup test create primary ips
|
- name: cleanup test create primary ips
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_server_name }}v4"
|
name: "{{ hcloud_server_name }}v4"
|
||||||
state: absent
|
state: absent
|
||||||
- name: cleanup test create primary ips
|
- name: cleanup test create primary ips
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_server_name }}v42"
|
name: "{{ hcloud_server_name }}v42"
|
||||||
state: absent
|
state: absent
|
||||||
until: result is not failed
|
until: result is not failed
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 2
|
delay: 2
|
||||||
- name: cleanup test create primary ips
|
- name: cleanup test create primary ips
|
||||||
hetzner.hcloud.hcloud_primary_ip:
|
hetzner.hcloud.primary_ip:
|
||||||
name: "{{ hcloud_server_name }}v6"
|
name: "{{ hcloud_server_name }}v6"
|
||||||
state: absent
|
state: absent
|
||||||
until: result is not failed
|
until: result is not failed
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,28 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup network 1 to be absent
|
- name: setup network 1 to be absent
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}-1"
|
name: "{{ hcloud_network_name }}-1"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: setup network 2 to be absent
|
- name: setup network 2 to be absent
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}-2"
|
name: "{{ hcloud_network_name }}-2"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: setup server to be absent
|
- name: setup server to be absent
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: setup create network
|
- name: setup create network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}-1"
|
name: "{{ hcloud_network_name }}-1"
|
||||||
ip_range: 192.168.0.0/23
|
ip_range: 192.168.0.0/23
|
||||||
register: primaryNetwork
|
register: primaryNetwork
|
||||||
|
|
||||||
- name: setup create network subnet 1
|
- name: setup create network subnet 1
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}-1"
|
network: "{{ hcloud_network_name }}-1"
|
||||||
ip_range: 192.168.0.0/24
|
ip_range: 192.168.0.0/24
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: setup create network subnet 2
|
- name: setup create network subnet 2
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}-1"
|
network: "{{ hcloud_network_name }}-1"
|
||||||
ip_range: 192.168.1.0/24
|
ip_range: 192.168.1.0/24
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -39,13 +39,13 @@
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: setup create secondary network
|
- name: setup create secondary network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}-2"
|
name: "{{ hcloud_network_name }}-2"
|
||||||
ip_range: 192.168.2.0/23
|
ip_range: 192.168.2.0/23
|
||||||
register: secondaryNetwork
|
register: secondaryNetwork
|
||||||
|
|
||||||
- name: setup create secondary network subnet 1
|
- name: setup create secondary network subnet 1
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}-2"
|
network: "{{ hcloud_network_name }}-2"
|
||||||
ip_range: 192.168.2.0/24
|
ip_range: 192.168.2.0/24
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: setup create secondary network subnet 2
|
- name: setup create secondary network subnet 2
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}-2"
|
network: "{{ hcloud_network_name }}-2"
|
||||||
ip_range: 192.168.3.0/24
|
ip_range: 192.168.3.0/24
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: test create server with primary network and no internet
|
- name: test create server with primary network and no internet
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test update server by adding secondary network
|
- name: test update server by adding secondary network
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test update server idem
|
- name: test update server idem
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
|
|
@ -120,11 +120,11 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: cleanup server
|
- name: cleanup server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
- name: cleanup networks
|
- name: cleanup networks
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup
|
- name: setup
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: test missing required parameters on create server
|
- name: test missing required parameters on create server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
- 'result.msg == "missing required arguments: server_type, image"'
|
- 'result.msg == "missing required arguments: server_type, image"'
|
||||||
|
|
||||||
- name: test create server with not existing server type
|
- name: test create server with not existing server type
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: not-existing-server-type
|
server_type: not-existing-server-type
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
- 'result.msg == "server_type not-existing-server-type was not found"'
|
- 'result.msg == "server_type not-existing-server-type was not found"'
|
||||||
|
|
||||||
- name: test create server with not existing image
|
- name: test create server with not existing image
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: my-not-existing-image-20.04
|
image: my-not-existing-image-20.04
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_server
|
- name: Cleanup test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Cleanup test_server2
|
- name: Cleanup test_server2
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}2"
|
name: "{{ hcloud_server_name }}2"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_server
|
- name: Create test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
register: test_server
|
register: test_server
|
||||||
|
|
||||||
- name: Create test_server2 (stopped + without ip)
|
- name: Create test_server2 (stopped + without ip)
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}2"
|
name: "{{ hcloud_server_name }}2"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_server_info
|
- name: Gather hcloud_server_info
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_info
|
- name: Verify hcloud_server_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_server_info | list | count >= 2
|
- result.hcloud_server_info | list | count >= 2
|
||||||
|
|
||||||
- name: Gather hcloud_server_info in check mode
|
- name: Gather hcloud_server_info in check mode
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_info in check mode
|
- name: Verify hcloud_server_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_server_info | list | count >= 2
|
- result.hcloud_server_info | list | count >= 2
|
||||||
|
|
||||||
- name: Gather hcloud_server_info with correct id
|
- name: Gather hcloud_server_info with correct id
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
id: "{{ test_server.hcloud_server.id }}"
|
id: "{{ test_server.hcloud_server.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_info with correct id
|
- name: Verify hcloud_server_info with correct id
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
- result.hcloud_server_info[0].name == hcloud_server_name
|
- result.hcloud_server_info[0].name == hcloud_server_name
|
||||||
|
|
||||||
- name: Gather hcloud_server_info with wrong id
|
- name: Gather hcloud_server_info with wrong id
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
id: "{{ test_server.hcloud_server.id }}4321"
|
id: "{{ test_server.hcloud_server.id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_server_info with correct name
|
- name: Gather hcloud_server_info with correct name
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_info with correct name
|
- name: Verify hcloud_server_info with correct name
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
- result.hcloud_server_info[0].name == hcloud_server_name
|
- result.hcloud_server_info[0].name == hcloud_server_name
|
||||||
|
|
||||||
- name: Gather hcloud_server_info with wrong name
|
- name: Gather hcloud_server_info with wrong name
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
name: "{{ hcloud_server_name }}-invalid"
|
name: "{{ hcloud_server_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_info with wrong name
|
- name: Verify hcloud_server_info with wrong name
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
- result.hcloud_server_info | list | count == 0
|
- result.hcloud_server_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_server_info with correct label selector
|
- name: Gather hcloud_server_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_info with correct label selector
|
- name: Verify hcloud_server_info with correct label selector
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_server_info with wrong label selector
|
- name: Gather hcloud_server_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_info with wrong label selector
|
- name: Verify hcloud_server_info with wrong label selector
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
- result.hcloud_server_info | list | count == 0
|
- result.hcloud_server_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_server_info (without ip)
|
- name: Gather hcloud_server_info (without ip)
|
||||||
hetzner.hcloud.hcloud_server_info:
|
hetzner.hcloud.server_info:
|
||||||
id: "{{ test_server2.hcloud_server.id }}"
|
id: "{{ test_server2.hcloud_server.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_info (without ip)
|
- name: Verify hcloud_server_info (without ip)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup network
|
- name: setup network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
ip_range: "10.0.0.0/8"
|
ip_range: "10.0.0.0/8"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
- network is success
|
- network is success
|
||||||
|
|
||||||
- name: setup subnetwork
|
- name: setup subnetwork
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
type: "server"
|
type: "server"
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
- subnetwork is success
|
- subnetwork is success
|
||||||
|
|
||||||
- name: setup server
|
- name: setup server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
- server is success
|
- server is success
|
||||||
|
|
||||||
- name: test missing required parameters on create server network
|
- name: test missing required parameters on create server network
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
- 'result.msg == "missing required arguments: network, server"'
|
- 'result.msg == "missing required arguments: network, server"'
|
||||||
|
|
||||||
- name: test create server network with checkmode
|
- name: test create server network with checkmode
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create server network
|
- name: test create server network
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||||
|
|
||||||
- name: test create server network idempotency
|
- name: test create server network idempotency
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
state: present
|
state: present
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
- serverNetwork is not changed
|
- serverNetwork is not changed
|
||||||
|
|
||||||
- name: test absent server network
|
- name: test absent server network
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create server network with specified ip
|
- name: test create server network with specified ip
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
ip: "10.0.0.2"
|
ip: "10.0.0.2"
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
- serverNetwork.hcloud_server_network.ip == "10.0.0.2"
|
- serverNetwork.hcloud_server_network.ip == "10.0.0.2"
|
||||||
|
|
||||||
- name: cleanup create server network with specified ip
|
- name: cleanup create server network with specified ip
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create server network with alias ips
|
- name: test create server network with alias ips
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
ip: "10.0.0.2"
|
ip: "10.0.0.2"
|
||||||
|
|
@ -143,7 +143,7 @@
|
||||||
- 'serverNetwork.hcloud_server_network.alias_ips[1] == "10.0.1.2"'
|
- 'serverNetwork.hcloud_server_network.alias_ips[1] == "10.0.1.2"'
|
||||||
|
|
||||||
- name: test update server network with alias ips
|
- name: test update server network with alias ips
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
ip: "10.0.0.2"
|
ip: "10.0.0.2"
|
||||||
|
|
@ -163,7 +163,7 @@
|
||||||
- 'serverNetwork.hcloud_server_network.alias_ips[1] == "10.0.3.1"'
|
- 'serverNetwork.hcloud_server_network.alias_ips[1] == "10.0.3.1"'
|
||||||
|
|
||||||
- name: test update server network with alias ips idempotency
|
- name: test update server network with alias ips idempotency
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
ip: "10.0.0.2"
|
ip: "10.0.0.2"
|
||||||
|
|
@ -178,7 +178,7 @@
|
||||||
- serverNetwork is not changed
|
- serverNetwork is not changed
|
||||||
|
|
||||||
- name: cleanup create server network with alias ips
|
- name: cleanup create server network with alias ips
|
||||||
hetzner.hcloud.hcloud_server_network:
|
hetzner.hcloud.server_network:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
@ -189,7 +189,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: cleanup server
|
- name: cleanup server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -199,7 +199,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: cleanup subnetwork
|
- name: cleanup subnetwork
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
type: "server"
|
type: "server"
|
||||||
|
|
@ -212,7 +212,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_server_type_info
|
- name: Gather hcloud_server_type_info
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_type_info
|
- name: Verify hcloud_server_type_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_server_type_info | list | count >= 3
|
- result.hcloud_server_type_info | list | count >= 3
|
||||||
|
|
||||||
- name: Gather hcloud_server_type_info in check mode
|
- name: Gather hcloud_server_type_info in check mode
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_type_info in check mode
|
- name: Verify hcloud_server_type_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_server_type_info | list | count >= 3
|
- result.hcloud_server_type_info | list | count >= 3
|
||||||
|
|
||||||
- name: Gather hcloud_server_type_info with correct id
|
- name: Gather hcloud_server_type_info with correct id
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
id: "{{ hcloud_server_type_id }}"
|
id: "{{ hcloud_server_type_id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_type_info with correct id
|
- name: Verify hcloud_server_type_info with correct id
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
- result.hcloud_server_type_info[0].deprecation is none # fails if cx11 is ever deprecated
|
- result.hcloud_server_type_info[0].deprecation is none # fails if cx11 is ever deprecated
|
||||||
|
|
||||||
- name: Gather hcloud_server_type_info with wrong id
|
- name: Gather hcloud_server_type_info with wrong id
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
id: "{{ hcloud_server_type_id }}4321"
|
id: "{{ hcloud_server_type_id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_server_type_info with correct name
|
- name: Gather hcloud_server_type_info with correct name
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
name: "{{ hcloud_server_type_name }}"
|
name: "{{ hcloud_server_type_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_type_info with correct name
|
- name: Verify hcloud_server_type_info with correct name
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
- result.hcloud_server_type_info | list | count == 1
|
- result.hcloud_server_type_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_server_type_info with wrong name
|
- name: Gather hcloud_server_type_info with wrong name
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
name: "{{ hcloud_server_type_name }}-invalid"
|
name: "{{ hcloud_server_type_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_type_info with wrong name
|
- name: Verify hcloud_server_type_info with wrong name
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
- result.hcloud_server_type_info | list | count == 0
|
- result.hcloud_server_type_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_server_type_info with deprecated field
|
- name: Gather hcloud_server_type_info with deprecated field
|
||||||
hetzner.hcloud.hcloud_server_type_info:
|
hetzner.hcloud.server_type_info:
|
||||||
id: "{{ hcloud_server_type_id_deprecated }}"
|
id: "{{ hcloud_server_type_id_deprecated }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_server_type_info with deprecated field
|
- name: Verify hcloud_server_type_info with deprecated field
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_ssh_key
|
- name: Cleanup test_ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Cleanup test_server
|
- name: Cleanup test_server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: test missing required parameters on create ssh_key
|
- name: test missing required parameters on create ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
- 'result.msg == "missing required arguments: public_key"'
|
- 'result.msg == "missing required arguments: public_key"'
|
||||||
|
|
||||||
- name: test create ssh key with check mode
|
- name: test create ssh key with check mode
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
public_key: "{{ test_ssh_keypair.public_key }}"
|
public_key: "{{ test_ssh_keypair.public_key }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create ssh key
|
- name: test create ssh key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
public_key: "{{ test_ssh_keypair.public_key }}"
|
public_key: "{{ test_ssh_keypair.public_key }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
- ssh_key.hcloud_ssh_key.labels.key == "value"
|
- ssh_key.hcloud_ssh_key.labels.key == "value"
|
||||||
|
|
||||||
- name: test create ssh key idempotence
|
- name: test create ssh key idempotence
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
public_key: "{{ test_ssh_keypair.public_key }}"
|
public_key: "{{ test_ssh_keypair.public_key }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test update ssh key with check mode
|
- name: test update ssh key with check mode
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
||||||
name: "changed-{{ hcloud_ssh_key_name }}"
|
name: "changed-{{ hcloud_ssh_key_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test update ssh key
|
- name: test update ssh key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
||||||
name: "changed-{{ hcloud_ssh_key_name }}"
|
name: "changed-{{ hcloud_ssh_key_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
- result.hcloud_ssh_key.name == "changed-{{ hcloud_ssh_key_name }}"
|
- result.hcloud_ssh_key.name == "changed-{{ hcloud_ssh_key_name }}"
|
||||||
|
|
||||||
- name: test update ssh key with same labels
|
- name: test update ssh key with same labels
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
||||||
name: "changed-{{ hcloud_ssh_key_name }}"
|
name: "changed-{{ hcloud_ssh_key_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: test update ssh key with other labels
|
- name: test update ssh key with other labels
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
||||||
name: "changed-{{ hcloud_ssh_key_name }}"
|
name: "changed-{{ hcloud_ssh_key_name }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
@ -99,7 +99,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test rename ssh key
|
- name: test rename ssh key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
- result.hcloud_ssh_key.name == "{{ hcloud_ssh_key_name }}"
|
- result.hcloud_ssh_key.name == "{{ hcloud_ssh_key_name }}"
|
||||||
|
|
||||||
- name: test create server with ssh key
|
- name: test create server with ssh key
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
|
|
@ -124,7 +124,7 @@
|
||||||
- main_server is changed
|
- main_server is changed
|
||||||
|
|
||||||
- name: test fail cleanly on double created ssh key
|
- name: test fail cleanly on double created ssh key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}-other-name"
|
name: "{{ hcloud_ssh_key_name }}-other-name"
|
||||||
public_key: "{{ test_ssh_keypair.public_key }}"
|
public_key: "{{ test_ssh_keypair.public_key }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -136,7 +136,7 @@
|
||||||
- 'result.msg == "SSH key with the same fingerprint already exists"'
|
- 'result.msg == "SSH key with the same fingerprint already exists"'
|
||||||
|
|
||||||
- name: test delete ssh key
|
- name: test delete ssh key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_ssh_key
|
- name: Cleanup test_ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_ssh_key
|
- name: Create test_ssh_key
|
||||||
hetzner.hcloud.hcloud_ssh_key:
|
hetzner.hcloud.ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
public_key: "{{ test_ssh_keypair.public_key }}"
|
public_key: "{{ test_ssh_keypair.public_key }}"
|
||||||
labels:
|
labels:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_ssh_key_info
|
- name: Gather hcloud_ssh_key_info
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_ssh_key_info
|
- name: Verify hcloud_ssh_key_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_ssh_key_info | list | count >= 1
|
- result.hcloud_ssh_key_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_ssh_key_info in check mode
|
- name: Gather hcloud_ssh_key_info in check mode
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_ssh_key_info in check mode
|
- name: Verify hcloud_ssh_key_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_ssh_key_info | list | count >= 1
|
- result.hcloud_ssh_key_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_ssh_key_info with correct id
|
- name: Gather hcloud_ssh_key_info with correct id
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
id: "{{ test_ssh_key.hcloud_ssh_key.id }}"
|
id: "{{ test_ssh_key.hcloud_ssh_key.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_ssh_key_info with correct id
|
- name: Verify hcloud_ssh_key_info with correct id
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- result.hcloud_ssh_key_info | list | count == 1
|
- result.hcloud_ssh_key_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_ssh_key_info with wrong id
|
- name: Gather hcloud_ssh_key_info with wrong id
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
id: "{{ test_ssh_key.hcloud_ssh_key.id }}4321"
|
id: "{{ test_ssh_key.hcloud_ssh_key.id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_ssh_key_info with correct name
|
- name: Gather hcloud_ssh_key_info with correct name
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_ssh_key_info with correct name
|
- name: Verify hcloud_ssh_key_info with correct name
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
- result.hcloud_ssh_key_info | list | count == 1
|
- result.hcloud_ssh_key_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_ssh_key_info with wrong name
|
- name: Gather hcloud_ssh_key_info with wrong name
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
name: "{{ hcloud_ssh_key_name }}-invalid"
|
name: "{{ hcloud_ssh_key_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_ssh_key_info with wrong name
|
- name: Verify hcloud_ssh_key_info with wrong name
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
- result.hcloud_ssh_key_info | list | count == 0
|
- result.hcloud_ssh_key_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_ssh_key_info with correct label selector
|
- name: Gather hcloud_ssh_key_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_ssh_key_info with correct label selector
|
- name: Verify hcloud_ssh_key_info with correct label selector
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_ssh_key_info with wrong label selector
|
- name: Gather hcloud_ssh_key_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_ssh_key_info:
|
hetzner.hcloud.ssh_key_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_ssh_key_info with wrong label selector
|
- name: Verify hcloud_ssh_key_info with wrong label selector
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_network
|
- name: Cleanup test_network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_network
|
- name: Create test_network
|
||||||
hetzner.hcloud.hcloud_network:
|
hetzner.hcloud.network:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
ip_range: "10.0.0.0/16"
|
ip_range: "10.0.0.0/16"
|
||||||
state: present
|
state: present
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Test missing required parameters
|
- name: Test missing required parameters
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
state: present
|
state: present
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
- 'result.msg == "missing required arguments: ip_range, network_zone, type"'
|
- 'result.msg == "missing required arguments: ip_range, network_zone, type"'
|
||||||
|
|
||||||
- name: Test create with checkmode
|
- name: Test create with checkmode
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
type: cloud
|
type: cloud
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: Test create
|
- name: Test create
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
type: cloud
|
type: cloud
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
- result.hcloud_subnetwork.ip_range == "10.0.0.0/24"
|
- result.hcloud_subnetwork.ip_range == "10.0.0.0/24"
|
||||||
|
|
||||||
- name: Test create idempotency
|
- name: Test create idempotency
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
type: cloud
|
type: cloud
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
|
|
||||||
- name: Test delete
|
- name: Test delete
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
type: cloud
|
type: cloud
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: Test create with vswitch
|
- name: Test create with vswitch
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
type: vswitch
|
type: vswitch
|
||||||
|
|
@ -90,7 +90,7 @@
|
||||||
- result.hcloud_subnetwork.vswitch_id | string == test_vswitch_id
|
- result.hcloud_subnetwork.vswitch_id | string == test_vswitch_id
|
||||||
|
|
||||||
- name: Test delete with vswitch
|
- name: Test delete with vswitch
|
||||||
hetzner.hcloud.hcloud_subnetwork:
|
hetzner.hcloud.subnetwork:
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
type: vswitch
|
type: vswitch
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: setup server
|
- name: setup server
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
server_type: cx11
|
server_type: cx11
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
- vol_server is changed
|
- vol_server is changed
|
||||||
|
|
||||||
- name: test missing size parameter on create Volume
|
- name: test missing size parameter on create Volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
- 'result.msg == "missing required arguments: size"'
|
- 'result.msg == "missing required arguments: size"'
|
||||||
|
|
||||||
- name: test create Volume with check mode
|
- name: test create Volume with check mode
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
size: 10
|
size: 10
|
||||||
location: "fsn1"
|
location: "fsn1"
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
- result is changed
|
- result is changed
|
||||||
|
|
||||||
- name: test create Volume
|
- name: test create Volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
size: 10
|
size: 10
|
||||||
location: "fsn1"
|
location: "fsn1"
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
- volume.hcloud_volume.linux_device is defined
|
- volume.hcloud_volume.linux_device is defined
|
||||||
|
|
||||||
- name: test create Volume idempotence
|
- name: test create Volume idempotence
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
size: 10
|
size: 10
|
||||||
location: "fsn1"
|
location: "fsn1"
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
- volume is not changed
|
- volume is not changed
|
||||||
|
|
||||||
- name: test attach Volume with checkmode
|
- name: test attach Volume with checkmode
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
check_mode: true
|
check_mode: true
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
- volume.hcloud_volume.server != "{{hcloud_server_name}}"
|
- volume.hcloud_volume.server != "{{hcloud_server_name}}"
|
||||||
|
|
||||||
- name: test attach Volume
|
- name: test attach Volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
- volume.hcloud_volume.server == "{{hcloud_server_name}}"
|
- volume.hcloud_volume.server == "{{hcloud_server_name}}"
|
||||||
|
|
||||||
- name: test attach Volume idempotence
|
- name: test attach Volume idempotence
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
- volume.hcloud_volume.server == "{{hcloud_server_name}}"
|
- volume.hcloud_volume.server == "{{hcloud_server_name}}"
|
||||||
|
|
||||||
- name: test detach Volume with checkmode
|
- name: test detach Volume with checkmode
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
- volume.hcloud_volume.server == "{{hcloud_server_name}}"
|
- volume.hcloud_volume.server == "{{hcloud_server_name}}"
|
||||||
|
|
||||||
- name: test detach Volume
|
- name: test detach Volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
register: volume
|
register: volume
|
||||||
- name: verify detach volume
|
- name: verify detach volume
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
- volume.hcloud_volume.server != "{{hcloud_server_name}}"
|
- volume.hcloud_volume.server != "{{hcloud_server_name}}"
|
||||||
|
|
||||||
- name: test update Volume label
|
- name: test update Volume label
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
labels:
|
labels:
|
||||||
key: value
|
key: value
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
- volume.hcloud_volume.labels.key == "value"
|
- volume.hcloud_volume.labels.key == "value"
|
||||||
|
|
||||||
- name: test update Volume label with the same label
|
- name: test update Volume label with the same label
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
labels:
|
labels:
|
||||||
key: value
|
key: value
|
||||||
|
|
@ -145,7 +145,7 @@
|
||||||
- volume is not changed
|
- volume is not changed
|
||||||
|
|
||||||
- name: test increase Volume size
|
- name: test increase Volume size
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
size: 11
|
size: 11
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -156,7 +156,7 @@
|
||||||
- volume.hcloud_volume.size == 11
|
- volume.hcloud_volume.size == 11
|
||||||
|
|
||||||
- name: test decreace Volume size
|
- name: test decreace Volume size
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
size: 10
|
size: 10
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -167,7 +167,7 @@
|
||||||
- volume.hcloud_volume.size == 11
|
- volume.hcloud_volume.size == 11
|
||||||
|
|
||||||
- name: test update Volume delete protection
|
- name: test update Volume delete protection
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -178,7 +178,7 @@
|
||||||
- volume.hcloud_volume.delete_protection is sameas true
|
- volume.hcloud_volume.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test update Volume delete protection idempotency
|
- name: test update Volume delete protection idempotency
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
delete_protection: true
|
delete_protection: true
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -189,7 +189,7 @@
|
||||||
- volume.hcloud_volume.delete_protection is sameas true
|
- volume.hcloud_volume.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test Volume without delete protection set to be idempotent
|
- name: test Volume without delete protection set to be idempotent
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
register: volume
|
register: volume
|
||||||
- name: verify test Volume without delete protection set to be idempotent
|
- name: verify test Volume without delete protection set to be idempotent
|
||||||
|
|
@ -199,7 +199,7 @@
|
||||||
- volume.hcloud_volume.delete_protection is sameas true
|
- volume.hcloud_volume.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test delete Volume fails if it is protected
|
- name: test delete Volume fails if it is protected
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -211,7 +211,7 @@
|
||||||
- 'result.msg == "volume deletion is protected"'
|
- 'result.msg == "volume deletion is protected"'
|
||||||
|
|
||||||
- name: test update Volume delete protection
|
- name: test update Volume delete protection
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -222,7 +222,7 @@
|
||||||
- volume.hcloud_volume.delete_protection is sameas false
|
- volume.hcloud_volume.delete_protection is sameas false
|
||||||
|
|
||||||
- name: test delete Volume
|
- name: test delete Volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -232,7 +232,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: test create Volume with delete protection
|
- name: test create Volume with delete protection
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
size: 10
|
size: 10
|
||||||
location: "fsn1"
|
location: "fsn1"
|
||||||
|
|
@ -245,7 +245,7 @@
|
||||||
- volume.hcloud_volume.delete_protection is sameas true
|
- volume.hcloud_volume.delete_protection is sameas true
|
||||||
|
|
||||||
- name: test delete Volume fails if it is protected
|
- name: test delete Volume fails if it is protected
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
@ -257,7 +257,7 @@
|
||||||
- 'result.msg == "volume deletion is protected"'
|
- 'result.msg == "volume deletion is protected"'
|
||||||
|
|
||||||
- name: test update Volume delete protection
|
- name: test update Volume delete protection
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
delete_protection: false
|
delete_protection: false
|
||||||
register: volume
|
register: volume
|
||||||
|
|
@ -268,7 +268,7 @@
|
||||||
- volume.hcloud_volume.delete_protection is sameas false
|
- volume.hcloud_volume.delete_protection is sameas false
|
||||||
|
|
||||||
- name: test delete Volume
|
- name: test delete Volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -278,7 +278,7 @@
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
hetzner.hcloud.hcloud_server:
|
hetzner.hcloud.server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: Cleanup test_volume
|
- name: Cleanup test_volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{ hcloud_volume_name }}"
|
name: "{{ hcloud_volume_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Create test_volume
|
- name: Create test_volume
|
||||||
hetzner.hcloud.hcloud_volume:
|
hetzner.hcloud.volume:
|
||||||
name: "{{ hcloud_volume_name }}"
|
name: "{{ hcloud_volume_name }}"
|
||||||
size: 10
|
size: 10
|
||||||
location: fsn1
|
location: fsn1
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: Gather hcloud_volume_info
|
- name: Gather hcloud_volume_info
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_volume_info
|
- name: Verify hcloud_volume_info
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- result.hcloud_volume_info | list | count >= 1
|
- result.hcloud_volume_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_volume_info in check mode
|
- name: Gather hcloud_volume_info in check mode
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_volume_info in check mode
|
- name: Verify hcloud_volume_info in check mode
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- result.hcloud_volume_info | list | count >= 1
|
- result.hcloud_volume_info | list | count >= 1
|
||||||
|
|
||||||
- name: Gather hcloud_volume_info with correct id
|
- name: Gather hcloud_volume_info with correct id
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
id: "{{ test_volume.hcloud_volume.id }}"
|
id: "{{ test_volume.hcloud_volume.id }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_volume_info with correct id
|
- name: Verify hcloud_volume_info with correct id
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
- result.hcloud_volume_info[0].linux_device is defined
|
- result.hcloud_volume_info[0].linux_device is defined
|
||||||
|
|
||||||
- name: Gather hcloud_volume_info with wrong id
|
- name: Gather hcloud_volume_info with wrong id
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
id: "{{ test_volume.hcloud_volume.id }}4321"
|
id: "{{ test_volume.hcloud_volume.id }}4321"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
- result is failed
|
- result is failed
|
||||||
|
|
||||||
- name: Gather hcloud_volume_info with correct name
|
- name: Gather hcloud_volume_info with correct name
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
name: "{{ hcloud_volume_name }}"
|
name: "{{ hcloud_volume_name }}"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_volume_info with correct name
|
- name: Verify hcloud_volume_info with correct name
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
- result.hcloud_volume_info | list | count == 1
|
- result.hcloud_volume_info | list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_volume_info with wrong name
|
- name: Gather hcloud_volume_info with wrong name
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
name: "{{ hcloud_volume_name }}-invalid"
|
name: "{{ hcloud_volume_name }}-invalid"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_volume_info with wrong name
|
- name: Verify hcloud_volume_info with wrong name
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
- result.hcloud_volume_info | list | count == 0
|
- result.hcloud_volume_info | list | count == 0
|
||||||
|
|
||||||
- name: Gather hcloud_volume_info with correct label selector
|
- name: Gather hcloud_volume_info with correct label selector
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_volume_info with correct label selector
|
- name: Verify hcloud_volume_info with correct label selector
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
| list | count == 1
|
| list | count == 1
|
||||||
|
|
||||||
- name: Gather hcloud_volume_info with wrong label selector
|
- name: Gather hcloud_volume_info with wrong label selector
|
||||||
hetzner.hcloud.hcloud_volume_info:
|
hetzner.hcloud.volume_info:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
register: result
|
register: result
|
||||||
- name: Verify hcloud_volume_info with wrong label selector
|
- name: Verify hcloud_volume_info with wrong label selector
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue