refactor: prefer true/false over yes/no (#226)

* style: format md and yml files using prettier

* refactor: prefer true/false over yes/no
This commit is contained in:
Jonas L 2023-06-21 10:49:54 +02:00 committed by GitHub
parent 97c84e93a4
commit 02516d9a7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 348 additions and 364 deletions

View file

@ -38,7 +38,7 @@ resources:
pool: Standard
stages:
### Sanity
### Sanity
- stage: Ansible_devel
displayName: Sanity devel
dependsOn: []
@ -47,8 +47,7 @@ stages:
parameters:
targets:
- name: Sanity
test: 'devel/sanity/1'
test: "devel/sanity/1"
- stage: Ansible_2_15
displayName: Sanity 2.15
@ -58,7 +57,7 @@ stages:
parameters:
targets:
- name: Sanity
test: '2.15/sanity/1'
test: "2.15/sanity/1"
- stage: Ansible_2_14
displayName: Sanity 2.14
dependsOn: []
@ -67,7 +66,7 @@ stages:
parameters:
targets:
- name: Sanity
test: '2.14/sanity/1'
test: "2.14/sanity/1"
- stage: Ansible_2_13
displayName: Sanity 2.13
dependsOn: []
@ -76,7 +75,7 @@ stages:
parameters:
targets:
- name: Sanity
test: '2.13/sanity/1'
test: "2.13/sanity/1"
- stage: Ansible_2_12
displayName: Sanity 2.12
dependsOn: []
@ -85,10 +84,9 @@ stages:
parameters:
targets:
- name: Sanity
test: '2.12/sanity/1'
test: "2.12/sanity/1"
## Integration tests (remote)
## Integration tests (remote)
- stage: Hetzner_devel
displayName: Hetzner devel
dependsOn: []
@ -101,7 +99,7 @@ stages:
- 3
targets:
- name: hcloud
test: 'devel/hcloud/3.9'
test: "devel/hcloud/3.9"
- stage: Hetzner_2_15
displayName: Hetzner 2.15
@ -115,7 +113,7 @@ stages:
- 3
targets:
- name: hcloud
test: '2.15/hcloud/3.9'
test: "2.15/hcloud/3.9"
- stage: Hetzner_2_14
displayName: Hetzner 2.14
@ -129,7 +127,7 @@ stages:
- 3
targets:
- name: hcloud
test: '2.14/hcloud/3.9'
test: "2.14/hcloud/3.9"
- stage: Hetzner_2_13
displayName: Hetzner 2.13
@ -143,7 +141,7 @@ stages:
- 3
targets:
- name: hcloud
test: '2.13/hcloud/3.9'
test: "2.13/hcloud/3.9"
- stage: Hetzner_2_12
displayName: Hetzner 2.12
@ -157,9 +155,9 @@ stages:
- 3
targets:
- name: hcloud
test: '2.12/hcloud/3.9'
test: "2.12/hcloud/3.9"
### Finally
### Finally
- stage: Summary
condition: succeededOrFailed()
dependsOn:

View file

@ -672,4 +672,3 @@ may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -10,19 +10,19 @@ notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- - major_changes
- Major Changes
- - minor_changes
- - minor_changes
- Minor Changes
- - breaking_changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- - deprecated_features
- Deprecated Features
- - removed_features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- - security_fixes
- Security Fixes
- - bugfixes
- - bugfixes
- Bugfixes
- - known_issues
- - known_issues
- Known Issues

View file

@ -11,7 +11,7 @@ tags:
- cloud
- hcloud
dependencies:
ansible.netcommon: '>=0.0.1'
ansible.netcommon: ">=0.0.1"
repository: https://github.com/ansible-collections/hetzner.hcloud
documentation: https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud
homepage: https://github.com/ansible-collections/hetzner.hcloud

View file

@ -1,4 +1,4 @@
requires_ansible: '>=2.12.0'
requires_ansible: ">=2.12.0"
plugin_routing:
modules:
hcloud_location_facts:

View file

@ -101,7 +101,7 @@ EXAMPLES = """
hcloud_floating_ip:
name: my-floating-ip
server: 1234
force: yes
force: true
state: present
- name: Floating IP should be absent
hcloud_floating_ip:
@ -264,7 +264,7 @@ class AnsibleHcloudFloatingIP(Hcloud):
self._mark_as_changed()
elif server != self.hcloud_floating_ip.server.name:
self.module.warn(
"Floating IP is already assigned to another server %s. You need to unassign the Floating IP or use force=yes."
"Floating IP is already assigned to another server %s. You need to unassign the Floating IP or use force=true."
% self.hcloud_floating_ip.server.name
)
self._mark_as_changed()
@ -305,7 +305,7 @@ class AnsibleHcloudFloatingIP(Hcloud):
self.client.floating_ips.delete(self.hcloud_floating_ip)
else:
self.module.warn(
"Floating IP is currently assigned to server %s. You need to unassign the Floating IP or use force=yes."
"Floating IP is currently assigned to server %s. You need to unassign the Floating IP or use force=true."
% self.hcloud_floating_ip.server.name
)
self._mark_as_changed()

View file

@ -78,17 +78,17 @@ options:
- Resize the disk size, when resizing a server.
- If you want to downgrade the server later, this value should be False.
type: bool
default: no
default: false
enable_ipv4:
description:
- Enables the public ipv4 address
type: bool
default: yes
default: true
enable_ipv6:
description:
- Enables the public ipv6 address
type: bool
default: yes
default: true
ipv4:
description:
- ID of the ipv4 Primary IP to use. If omitted and enable_ipv4 is true, a new ipv4 Primary IP will automatically be created
@ -115,12 +115,12 @@ options:
- Force the update of the server.
- May power off the server if update.
type: bool
default: no
default: false
allow_deprecated_image:
description:
- Allows the creation of servers with deprecated images.
type: bool
default: no
default: false
user_data:
description:
- User Data to be passed to the server on creation.
@ -181,7 +181,7 @@ EXAMPLES = """
hcloud_server:
name: my-server
server_type: cx21
upgrade_disk: yes
upgrade_disk: true
state: present
- name: Ensure the server is absent (remove if needed)
@ -522,7 +522,7 @@ class AnsibleHcloudServer(Hcloud):
else:
self.module.fail_json(
msg=("You try to use a deprecated image. The image %s will continue to be available until %s." +
" If you want to use this image use allow_deprecated_image=yes."
" If you want to use this image use allow_deprecated_image=true."
) % (image.name, available_until.strftime('%Y-%m-%d')))
return image
@ -844,7 +844,7 @@ class AnsibleHcloudServer(Hcloud):
return previous_server_status
else:
self.module.warn(
"You can not upgrade a running instance %s. You need to stop the instance or use force=yes."
"You can not upgrade a running instance %s. You need to stop the instance or use force=true."
% self.hcloud_server.name
)

View file

@ -95,13 +95,13 @@ EXAMPLES = """
hcloud_volume:
name: my-volume
server: my-server
automount: yes
automount: true
state: present
- name: Mount a existing Volume and automount
hcloud_volume:
name: my-volume
server: my-server
automount: yes
automount: true
state: present
- name: Ensure the Volume is absent (remove if needed)
hcloud_volume:

View file

@ -5,7 +5,7 @@
hcloud_certificate:
name: "{{ hcloud_certificate_name }}"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create certificate
assert:
that:
@ -18,7 +18,7 @@
certificate: "{{ certificate_example_com }}"
private_key: "{{ certificate_example_com_key }}"
register: result
check_mode: yes
check_mode: true
- name: test create certificate with check mode
assert:
that:
@ -57,7 +57,7 @@
id: "{{ certificate.hcloud_certificate.id }}"
name: "changed-{{ hcloud_certificate_name }}"
register: result
check_mode: yes
check_mode: true
- name: test create certificate with check mode
assert:
that:

View file

@ -1,7 +1,6 @@
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- name: create certificate
hcloud_certificate:
name: "{{ hcloud_certificate_name }}"
@ -22,7 +21,7 @@
- name: test gather hcloud certificate infos in check mode
hcloud_certificate_info:
register: hcloud_certificate
check_mode: yes
check_mode: true
- name: verify test gather hcloud certificate infos in check mode
assert:
that:
@ -31,7 +30,7 @@
- name: test gather hcloud certificate infos
hcloud_certificate_info:
register: hcloud_certificate
check_mode: yes
check_mode: true
- name: verify test gather hcloud certificate infos
assert:
that:

View file

@ -13,7 +13,7 @@
- name: test gather hcloud datacenter infos in check mode
hcloud_datacenter_info:
register: hcloud_datacenters
check_mode: yes
check_mode: true
- name: verify test gather hcloud datacenter infos in check mode
assert:

View file

@ -9,7 +9,7 @@
- name: test missing required parameters on create firewall
hcloud_firewall:
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create firewall
assert:
that:
@ -20,7 +20,7 @@
hcloud_firewall:
name: "{{ hcloud_firewall_name }}"
register: result
check_mode: yes
check_mode: true
- name: test create firewall with check mode
assert:
that:
@ -144,7 +144,7 @@
id: "{{ firewall.hcloud_firewall.id }}"
name: "changed-{{ hcloud_firewall_name }}"
register: result
check_mode: yes
check_mode: true
- name: test create firewall with check mode
assert:
that:

View file

@ -45,7 +45,7 @@
hcloud_floating_ip:
name: "{{ hcloud_floating_ip_name }}"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing type parameter on create Floating IP
assert:
that:
@ -57,7 +57,7 @@
name: "{{ hcloud_floating_ip_name }}"
type: ipv4
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create Floating IP
assert:
that:
@ -70,7 +70,7 @@
home_location: "fsn1"
state: "absent"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing type parameter on delete Floating IP
assert:
that:
@ -83,7 +83,7 @@
type: ipv5
home_location: "fsn1"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify invalid type
assert:
that:
@ -96,7 +96,7 @@
type: ipv4
home_location: "abc"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify invalid location
assert:
that:
@ -110,7 +110,7 @@
type: ipv4
home_location: "fsn1"
register: floatingIP
check_mode: yes
check_mode: true
- name: verify test create Floating IP with check mode
assert:
that:
@ -149,7 +149,7 @@
description: "changed-description"
type: ipv4
home_location: "fsn1"
check_mode: yes
check_mode: true
register: floatingIP
- name: verify test create Floating IP with check mode
assert:
@ -233,7 +233,7 @@
description: "changed-description"
type: ipv4
server: "{{ main_server.hcloud_server.name }}"
check_mode: yes
check_mode: true
register: floatingIP
- name: verify test assign Floating IP with checkmode
assert:
@ -317,7 +317,7 @@
hcloud_floating_ip:
name: "{{ hcloud_floating_ip_name }}"
type: ipv4
force: yes
force: true
server: "{{ main_server2.hcloud_server.name }}"
register: floatingIP
- name: verify test already assigned Floating IP assign with force
@ -366,7 +366,7 @@
name: "{{ hcloud_floating_ip_name }}"
state: "absent"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify test delete floating ip
assert:
that:
@ -454,7 +454,7 @@
name: "{{ hcloud_floating_ip_name }}"
state: "absent"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify test delete floating ip
assert:
that:

View file

@ -30,7 +30,7 @@
- name: test gather hcloud floating ip infos in check mode
hcloud_floating_ip_info:
check_mode: yes
check_mode: true
register: hcloud_floating_ips
- name: verify test gather hcloud floating ip infos in check mode
@ -38,7 +38,6 @@
that:
- hcloud_floating_ips.hcloud_floating_ip_info| list | count >= 1
- name: test gather hcloud floating ip infos with correct label selector
hcloud_floating_ip_info:
label_selector: "key=value"
@ -70,7 +69,7 @@
hcloud_floating_ip_info:
id: "{{test_floating_ip.hcloud_floating_ip.id}}1"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify test gather hcloud floating ip with wrong id
assert:
that:

View file

@ -11,7 +11,7 @@
- name: test gather hcloud image infos in check mode
hcloud_image_info:
check_mode: yes
check_mode: true
register: hcloud_images
- name: verify test gather hcloud image infos in check mode
@ -19,7 +19,6 @@
that:
- hcloud_images.hcloud_image_info| list | count > 2
- name: test gather hcloud image infos with correct label selector
hcloud_image_info:
label_selector: "key=value"
@ -54,7 +53,7 @@
hcloud_image_info:
id: "{{hcloud_test_image_id}}1"
type: snapshot
ignore_errors: yes
ignore_errors: true
register: result
- name: verify test gather hcloud image with wrong id
assert:

View file

@ -14,7 +14,7 @@
hcloud_load_balancer:
name: "{{ hcloud_load_balancer_name }}"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create Load Balancer
assert:
that:
@ -28,7 +28,7 @@
network_zone: eu-central
state: present
register: result
check_mode: yes
check_mode: true
- name: test create Load Balancer with check mode
assert:
that:
@ -110,7 +110,7 @@
hcloud_load_balancer:
name: "{{hcloud_load_balancer_name}}"
state: absent
ignore_errors: yes
ignore_errors: true
register: result
- name: verify delete Load Balancer fails if it is protected
assert:
@ -218,7 +218,7 @@
name: "{{ hcloud_load_balancer_name }}"
state: "absent"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify test delete Load Balancer
assert:
that:

View file

@ -71,7 +71,7 @@
- name: test gather hcloud Load Balancer infos in check mode
hcloud_load_balancer_info:
check_mode: yes
check_mode: true
register: hcloud_load_balancers
- name: verify test gather hcloud Load Balancer infos in check mode
@ -79,7 +79,6 @@
that:
- hcloud_load_balancers.hcloud_load_balancer_info| list | count >= 1
- name: test gather hcloud Load Balancer infos with correct label selector
hcloud_load_balancer_info:
label_selector: "key=value"
@ -111,7 +110,7 @@
hcloud_load_balancer_info:
id: "{{test_load_balancer.hcloud_load_balancer.id}}1"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify test gather hcloud Load Balancer with wrong id
assert:
that:

View file

@ -41,7 +41,7 @@
hcloud_load_balancer_network:
state: present
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create load_balancer network
assert:
that:
@ -80,7 +80,7 @@
load_balancer: "{{hcloud_load_balancer_name}}"
state: present
register: result
check_mode: yes
check_mode: true
- name: verify test create load_balancer network with checkmode
assert:
that:

View file

@ -34,7 +34,7 @@
listen_port: 80
state: present
register: result
check_mode: yes
check_mode: true
- name: verify test create load_balancer service with checkmode
assert:
that:
@ -103,7 +103,7 @@
listen_port: 80
http:
cookie_name: "Test"
sticky_sessions: yes
sticky_sessions: true
state: present
register: load_balancer_service
- name: verify create load_balancer service

View file

@ -59,7 +59,7 @@
server: "{{hcloud_server_name}}"
state: present
register: result
check_mode: yes
check_mode: true
- name: verify test create load_balancer target with checkmode
assert:
that:

View file

@ -11,7 +11,7 @@
- name: test gather hcloud Load Balancer type infos in check mode
hcloud_load_balancer_type_info:
check_mode: yes
check_mode: true
register: hcloud_load_balancer_types
- name: verify test gather hcloud Load Balancer type infos in check mode

View file

@ -12,7 +12,7 @@
- name: test gather hcloud location infos in check mode
hcloud_location_info:
check_mode: yes
check_mode: true
register: hcloud_location
- name: verify test gather hcloud location infos in check mode

View file

@ -15,7 +15,7 @@
hcloud_network:
name: "{{hcloud_network_name}}"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail missing ip_range parameter on create Network result
assert:
that:
@ -27,7 +27,7 @@
name: "{{hcloud_network_name}}"
ip_range: "10.0.0.0/16"
register: result
check_mode: yes
check_mode: true
- name: verify create Network with check mode result
assert:
that:
@ -138,7 +138,7 @@
hcloud_network:
name: "{{hcloud_network_name}}"
state: absent
ignore_errors: yes
ignore_errors: true
register: result
- name: verify delete Network
assert:
@ -168,7 +168,6 @@
that:
- result is success
- name: test create Network with delete protection
hcloud_network:
name: "{{hcloud_network_name}}"
@ -185,7 +184,7 @@
hcloud_network:
name: "{{hcloud_network_name}}"
state: absent
ignore_errors: yes
ignore_errors: true
register: result
- name: verify delete Network
assert:

View file

@ -1,7 +1,6 @@
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- name: setup ensure network is absent
hcloud_network:
name: "{{ hcloud_network_name }}"
@ -47,14 +46,13 @@
- name: test gather hcloud network info in check mode
hcloud_network_info:
check_mode: yes
check_mode: true
register: hcloud_network
- name: verify test gather hcloud network info in check mode
assert:
that:
- hcloud_network.hcloud_network_info | selectattr('name','equalto','{{ hcloud_network_name }}') | list | count >= 1
- name: test gather hcloud network info with correct label selector
hcloud_network_info:
label_selector: "key=value"

View file

@ -14,7 +14,7 @@
- name: test missing required parameters on create placement group
hcloud_placement_group:
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create placement group
assert:
that:
@ -26,7 +26,7 @@
name: "{{ hcloud_placement_group_name }}"
type: spread
register: result
check_mode: yes
check_mode: true
- name: test create placement group with check mode
assert:
that:
@ -122,7 +122,7 @@
id: "{{ placement_group.hcloud_placement_group.id }}"
name: "changed-{{ hcloud_placement_group_name }}"
register: result
check_mode: yes
check_mode: true
- name: verify update placement group with check mode
assert:
that:

View file

@ -12,7 +12,7 @@
type: ipv4
datacenter: "fsn1-dc14"
register: primaryIP
check_mode: yes
check_mode: true
- name: verify test create Primary IP with check mode
assert:
that:
@ -149,7 +149,7 @@
name: "{{ hcloud_primary_ip_name }}"
state: "absent"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify test delete primary ip
assert:
that:
@ -218,7 +218,7 @@
name: "{{ hcloud_primary_ip_name }}"
state: "absent"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify test delete primary ip
assert:
that:

View file

@ -53,7 +53,7 @@
hcloud_rdns:
state: present
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters
assert:
that:
@ -65,7 +65,7 @@
ip_address: "127.0.0.1"
state: present
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail on not existing resou
assert:
that:

View file

@ -16,7 +16,7 @@
hcloud_route:
state: present
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create route
assert:
that:
@ -30,7 +30,7 @@
gateway: "10.0.1.1"
state: present
register: result
check_mode: yes
check_mode: true
- name: verify test create route with checkmode
assert:
that:
@ -70,7 +70,7 @@
gateway: "10.0.1.2"
state: present
register: route
ignore_errors: yes
ignore_errors: true
- name: verfiy fail create route with wrong gateway
assert:
that:

View file

@ -5,7 +5,7 @@
image: ubuntu-22.04
state: present
register: result
check_mode: yes
check_mode: true
- name: test create server server
assert:
that:
@ -43,7 +43,7 @@
name: "{{ hcloud_server_name }}"
state: stopped
register: result
check_mode: yes
check_mode: true
- name: verify stop server with check mode
assert:
that:
@ -309,7 +309,7 @@
hcloud_server:
name: "{{hcloud_server_name}}"
state: absent
ignore_errors: yes
ignore_errors: true
register: result
- name: verify delete server fails if it is protected
assert:
@ -322,7 +322,7 @@
name: "{{hcloud_server_name}}"
image: ubuntu-22.04
state: rebuild
ignore_errors: yes
ignore_errors: true
register: result
- name: verify rebuild server fails if it is protected
assert:
@ -373,7 +373,6 @@
- main_server.hcloud_server.status == "running"
- main_server.root_password != ""
- name: test activate rescue mode with check_mode
hcloud_server:
name: "{{ hcloud_server_name }}"
@ -457,7 +456,6 @@
- main_server.root_password != ""
- main_server.hcloud_server.rescue_enabled is sameas true
- name: absent server
hcloud_server:
name: "{{ hcloud_server_name }}"
@ -581,7 +579,7 @@
hcloud_server:
name: "{{hcloud_server_name}}"
state: absent
ignore_errors: yes
ignore_errors: true
register: result
- name: verify delete server fails if it is protected
assert:

View file

@ -7,7 +7,7 @@
firewalls:
- not-existing
state: present
ignore_errors: yes
ignore_errors: true
register: result
- name: verify add not existing firewall should fail
assert:

View file

@ -47,7 +47,7 @@
image: "ubuntu-22.04"
ipv4: "{{secondPrimaryIPv4.hcloud_primary_ip.id}}"
ipv6: ""
enable_ipv6: no
enable_ipv6: false
ssh_keys:
- ci@ansible.hetzner.cloud
state: stopped

View file

@ -66,8 +66,8 @@
server_type: cpx11
datacenter: "fsn1-dc14"
image: "ubuntu-22.04"
enable_ipv4: no
enable_ipv6: no
enable_ipv4: false
enable_ipv6: false
private_networks:
- "{{ primaryNetwork.hcloud_network.name }}"
ssh_keys:
@ -85,8 +85,8 @@
server_type: cpx11
datacenter: "fsn1-dc14"
image: "ubuntu-22.04"
enable_ipv4: no
enable_ipv6: no
enable_ipv4: false
enable_ipv6: false
private_networks:
- "{{ primaryNetwork.hcloud_network.name }}"
- "{{ secondaryNetwork.hcloud_network.id }}"
@ -105,8 +105,8 @@
server_type: cpx11
datacenter: "fsn1-dc14"
image: "ubuntu-22.04"
enable_ipv4: no
enable_ipv6: no
enable_ipv4: false
enable_ipv6: false
private_networks:
- "{{ primaryNetwork.hcloud_network.name }}"
- "{{ secondaryNetwork.hcloud_network.id }}"

View file

@ -15,7 +15,7 @@
hcloud_server:
name: "{{ hcloud_server_name }}"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create server
assert:
that:
@ -29,7 +29,7 @@
image: ubuntu-22.04
state: present
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test create server with not existing server type
assert:
that:
@ -43,7 +43,7 @@
image: my-not-existing-image-20.04
state: present
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test create server with not existing image
assert:
that:

View file

@ -25,18 +25,16 @@
- main_server.hcloud_server.status == "running"
- main_server.root_password != ""
- name: test gather hcloud server infos in check mode
hcloud_server_info:
register: server
check_mode: yes
check_mode: true
- name: verify test gather hcloud server infos in check mode
assert:
that:
- server.hcloud_server_info|selectattr('name','equalto','{{ hcloud_server_name }}') | list | count == 1
- name: test gather hcloud server infos with correct label selector
hcloud_server_info:
label_selector: "key=value"
@ -104,8 +102,8 @@
state: stopped
labels:
key: value
enable_ipv4: no
enable_ipv6: no
enable_ipv4: false
enable_ipv6: false
register: main_server
- name: verify create server
assert:

View file

@ -42,7 +42,7 @@
hcloud_server_network:
state: present
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create server network
assert:
that:
@ -55,7 +55,7 @@
server: "{{hcloud_server_name}}"
state: present
register: result
check_mode: yes
check_mode: true
- name: verify test create server network with checkmode
assert:
that:

View file

@ -11,7 +11,7 @@
- name: test gather hcloud server type infos in check mode
hcloud_server_type_info:
check_mode: yes
check_mode: true
register: hcloud_server_types
- name: verify test gather hcloud server type infos in check mode

View file

@ -5,7 +5,7 @@
hcloud_ssh_key:
name: "{{ hcloud_ssh_key_name }}"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create ssh_key
assert:
that:
@ -17,7 +17,7 @@
name: "{{ hcloud_ssh_key_name }}"
public_key: "{{ key_material }}"
register: result
check_mode: yes
check_mode: true
- name: test create ssh key with check mode
assert:
that:
@ -54,7 +54,7 @@
id: "{{ sshKey.hcloud_ssh_key.id }}"
name: "changed-{{ hcloud_ssh_key_name }}"
register: result
check_mode: yes
check_mode: true
- name: test create ssh key with check mode
assert:
that:
@ -138,7 +138,7 @@
name: "{{ hcloud_ssh_key_name }}othername"
public_key: "{{ hcloud_doubled_ssh_key_public_key }}"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify failed correctly
assert:
that:

View file

@ -1,7 +1,6 @@
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- name: setup ensure ssh key is absent
hcloud_ssh_key:
name: "{{ hcloud_ssh_key_name }}"
@ -24,7 +23,7 @@
- name: test gather hcloud ssh key infos in check mode
hcloud_ssh_key_info:
register: hcloud_ssh_key
check_mode: yes
check_mode: true
- name: verify test gather hcloud ssh key infos in check mode
assert:
that:
@ -33,7 +32,7 @@
- name: test gather hcloud ssh key infos
hcloud_ssh_key_info:
register: hcloud_ssh_key
check_mode: yes
check_mode: true
- name: verify test gather hcloud ssh key infos
assert:
that:

View file

@ -17,7 +17,7 @@
network: "{{ hcloud_network_name }}"
state: present
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing required parameters on create route
assert:
that:
@ -32,7 +32,7 @@
network_zone: "eu-central"
state: present
register: result
check_mode: yes
check_mode: true
- name: verify test create subnetwork with checkmode
assert:
that:

View file

@ -19,7 +19,7 @@
name: "{{hcloud_volume_name}}"
server: "{{hcloud_server_name}}"
register: result
ignore_errors: yes
ignore_errors: true
- name: verify fail test missing size parameter on create Volume
assert:
that:
@ -32,7 +32,7 @@
size: 10
location: "fsn1"
register: result
check_mode: yes
check_mode: true
- name: verify create Volume with check mode result
assert:
that:
@ -69,7 +69,7 @@
hcloud_volume:
name: "{{hcloud_volume_name}}"
server: "{{hcloud_server_name}}"
check_mode: yes
check_mode: true
register: volume
- name: verify test attach Volume with checkmode
assert:
@ -102,7 +102,7 @@
- name: test detach Volume with checkmode
hcloud_volume:
name: "{{hcloud_volume_name}}"
check_mode: yes
check_mode: true
register: volume
- name: verify detach Volume with checkmode
assert:
@ -202,7 +202,7 @@
hcloud_volume:
name: "{{hcloud_volume_name}}"
state: absent
ignore_errors: yes
ignore_errors: true
register: result
- name: verify delete Volume fails if it is protected
assert:
@ -231,7 +231,6 @@
that:
- result is success
- name: test create Volume with delete protection
hcloud_volume:
name: "{{hcloud_volume_name}}"
@ -249,7 +248,7 @@
hcloud_volume:
name: "{{hcloud_volume_name}}"
state: absent
ignore_errors: yes
ignore_errors: true
register: result
- name: verify delete Volume fails if it is protected
assert:

View file

@ -23,7 +23,7 @@
- name: test gather hcloud volume infos in check mode
hcloud_volume_info:
register: hcloud_volume
check_mode: yes
check_mode: true
- name: verify test gather hcloud volume infos in check mode
vars:

View file

@ -47,9 +47,9 @@
- name: set facts for future roles
set_fact:
sshkey: '{{ sshkey_file.path }}'
sshkey: "{{ sshkey_file.path }}"
key_material: "{{ lookup('file', sshkey_file.path ~ '.pub') }}"
another_key_material: "{{ lookup('file', another_sshkey_file.path ~ '.pub') }}"
fingerprint: '{{ fingerprint.stdout.split()[1] }}'
fingerprint: "{{ fingerprint.stdout.split()[1] }}"
tags:
- prepare

View file

@ -1,3 +1,3 @@
integration_tests_dependencies:
- community.general
- ansible.netcommon
- community.general
- ansible.netcommon