mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-11-10 06:34:13 +00:00
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:
parent
97c84e93a4
commit
02516d9a7b
47 changed files with 348 additions and 364 deletions
|
@ -38,7 +38,7 @@ resources:
|
||||||
pool: Standard
|
pool: Standard
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
### Sanity
|
### Sanity
|
||||||
- stage: Ansible_devel
|
- stage: Ansible_devel
|
||||||
displayName: Sanity devel
|
displayName: Sanity devel
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
@ -47,8 +47,7 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
targets:
|
targets:
|
||||||
- name: Sanity
|
- name: Sanity
|
||||||
test: 'devel/sanity/1'
|
test: "devel/sanity/1"
|
||||||
|
|
||||||
|
|
||||||
- stage: Ansible_2_15
|
- stage: Ansible_2_15
|
||||||
displayName: Sanity 2.15
|
displayName: Sanity 2.15
|
||||||
|
@ -58,7 +57,7 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
targets:
|
targets:
|
||||||
- name: Sanity
|
- name: Sanity
|
||||||
test: '2.15/sanity/1'
|
test: "2.15/sanity/1"
|
||||||
- stage: Ansible_2_14
|
- stage: Ansible_2_14
|
||||||
displayName: Sanity 2.14
|
displayName: Sanity 2.14
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
@ -67,7 +66,7 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
targets:
|
targets:
|
||||||
- name: Sanity
|
- name: Sanity
|
||||||
test: '2.14/sanity/1'
|
test: "2.14/sanity/1"
|
||||||
- stage: Ansible_2_13
|
- stage: Ansible_2_13
|
||||||
displayName: Sanity 2.13
|
displayName: Sanity 2.13
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
@ -76,7 +75,7 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
targets:
|
targets:
|
||||||
- name: Sanity
|
- name: Sanity
|
||||||
test: '2.13/sanity/1'
|
test: "2.13/sanity/1"
|
||||||
- stage: Ansible_2_12
|
- stage: Ansible_2_12
|
||||||
displayName: Sanity 2.12
|
displayName: Sanity 2.12
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
@ -85,10 +84,9 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
targets:
|
targets:
|
||||||
- name: Sanity
|
- name: Sanity
|
||||||
test: '2.12/sanity/1'
|
test: "2.12/sanity/1"
|
||||||
|
|
||||||
|
## Integration tests (remote)
|
||||||
## Integration tests (remote)
|
|
||||||
- stage: Hetzner_devel
|
- stage: Hetzner_devel
|
||||||
displayName: Hetzner devel
|
displayName: Hetzner devel
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
@ -101,7 +99,7 @@ stages:
|
||||||
- 3
|
- 3
|
||||||
targets:
|
targets:
|
||||||
- name: hcloud
|
- name: hcloud
|
||||||
test: 'devel/hcloud/3.9'
|
test: "devel/hcloud/3.9"
|
||||||
|
|
||||||
- stage: Hetzner_2_15
|
- stage: Hetzner_2_15
|
||||||
displayName: Hetzner 2.15
|
displayName: Hetzner 2.15
|
||||||
|
@ -115,7 +113,7 @@ stages:
|
||||||
- 3
|
- 3
|
||||||
targets:
|
targets:
|
||||||
- name: hcloud
|
- name: hcloud
|
||||||
test: '2.15/hcloud/3.9'
|
test: "2.15/hcloud/3.9"
|
||||||
|
|
||||||
- stage: Hetzner_2_14
|
- stage: Hetzner_2_14
|
||||||
displayName: Hetzner 2.14
|
displayName: Hetzner 2.14
|
||||||
|
@ -129,7 +127,7 @@ stages:
|
||||||
- 3
|
- 3
|
||||||
targets:
|
targets:
|
||||||
- name: hcloud
|
- name: hcloud
|
||||||
test: '2.14/hcloud/3.9'
|
test: "2.14/hcloud/3.9"
|
||||||
|
|
||||||
- stage: Hetzner_2_13
|
- stage: Hetzner_2_13
|
||||||
displayName: Hetzner 2.13
|
displayName: Hetzner 2.13
|
||||||
|
@ -143,7 +141,7 @@ stages:
|
||||||
- 3
|
- 3
|
||||||
targets:
|
targets:
|
||||||
- name: hcloud
|
- name: hcloud
|
||||||
test: '2.13/hcloud/3.9'
|
test: "2.13/hcloud/3.9"
|
||||||
|
|
||||||
- stage: Hetzner_2_12
|
- stage: Hetzner_2_12
|
||||||
displayName: Hetzner 2.12
|
displayName: Hetzner 2.12
|
||||||
|
@ -157,9 +155,9 @@ stages:
|
||||||
- 3
|
- 3
|
||||||
targets:
|
targets:
|
||||||
- name: hcloud
|
- name: hcloud
|
||||||
test: '2.12/hcloud/3.9'
|
test: "2.12/hcloud/3.9"
|
||||||
|
|
||||||
### Finally
|
### Finally
|
||||||
- stage: Summary
|
- stage: Summary
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
dependsOn:
|
dependsOn:
|
||||||
|
|
1
COPYING
1
COPYING
|
@ -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
|
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
|
Public License instead of this License. But first, please read
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,19 @@ notesdir: fragments
|
||||||
prelude_section_name: release_summary
|
prelude_section_name: release_summary
|
||||||
prelude_section_title: Release Summary
|
prelude_section_title: Release Summary
|
||||||
sections:
|
sections:
|
||||||
- - major_changes
|
- - major_changes
|
||||||
- Major Changes
|
- Major Changes
|
||||||
- - minor_changes
|
- - minor_changes
|
||||||
- Minor Changes
|
- Minor Changes
|
||||||
- - breaking_changes
|
- - breaking_changes
|
||||||
- Breaking Changes / Porting Guide
|
- Breaking Changes / Porting Guide
|
||||||
- - deprecated_features
|
- - deprecated_features
|
||||||
- Deprecated Features
|
- Deprecated Features
|
||||||
- - removed_features
|
- - removed_features
|
||||||
- Removed Features (previously deprecated)
|
- Removed Features (previously deprecated)
|
||||||
- - security_fixes
|
- - security_fixes
|
||||||
- Security Fixes
|
- Security Fixes
|
||||||
- - bugfixes
|
- - bugfixes
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
- - known_issues
|
- - known_issues
|
||||||
- Known Issues
|
- Known Issues
|
||||||
|
|
|
@ -11,7 +11,7 @@ tags:
|
||||||
- cloud
|
- cloud
|
||||||
- hcloud
|
- hcloud
|
||||||
dependencies:
|
dependencies:
|
||||||
ansible.netcommon: '>=0.0.1'
|
ansible.netcommon: ">=0.0.1"
|
||||||
repository: https://github.com/ansible-collections/hetzner.hcloud
|
repository: https://github.com/ansible-collections/hetzner.hcloud
|
||||||
documentation: https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud
|
documentation: https://docs.ansible.com/ansible/latest/collections/hetzner/hcloud
|
||||||
homepage: https://github.com/ansible-collections/hetzner.hcloud
|
homepage: https://github.com/ansible-collections/hetzner.hcloud
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
requires_ansible: '>=2.12.0'
|
requires_ansible: ">=2.12.0"
|
||||||
plugin_routing:
|
plugin_routing:
|
||||||
modules:
|
modules:
|
||||||
hcloud_location_facts:
|
hcloud_location_facts:
|
||||||
|
|
|
@ -101,7 +101,7 @@ EXAMPLES = """
|
||||||
hcloud_floating_ip:
|
hcloud_floating_ip:
|
||||||
name: my-floating-ip
|
name: my-floating-ip
|
||||||
server: 1234
|
server: 1234
|
||||||
force: yes
|
force: true
|
||||||
state: present
|
state: present
|
||||||
- name: Floating IP should be absent
|
- name: Floating IP should be absent
|
||||||
hcloud_floating_ip:
|
hcloud_floating_ip:
|
||||||
|
@ -264,7 +264,7 @@ class AnsibleHcloudFloatingIP(Hcloud):
|
||||||
self._mark_as_changed()
|
self._mark_as_changed()
|
||||||
elif server != self.hcloud_floating_ip.server.name:
|
elif server != self.hcloud_floating_ip.server.name:
|
||||||
self.module.warn(
|
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.hcloud_floating_ip.server.name
|
||||||
)
|
)
|
||||||
self._mark_as_changed()
|
self._mark_as_changed()
|
||||||
|
@ -305,7 +305,7 @@ class AnsibleHcloudFloatingIP(Hcloud):
|
||||||
self.client.floating_ips.delete(self.hcloud_floating_ip)
|
self.client.floating_ips.delete(self.hcloud_floating_ip)
|
||||||
else:
|
else:
|
||||||
self.module.warn(
|
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.hcloud_floating_ip.server.name
|
||||||
)
|
)
|
||||||
self._mark_as_changed()
|
self._mark_as_changed()
|
||||||
|
|
|
@ -78,17 +78,17 @@ options:
|
||||||
- Resize the disk size, when resizing a server.
|
- Resize the disk size, when resizing a server.
|
||||||
- If you want to downgrade the server later, this value should be False.
|
- If you want to downgrade the server later, this value should be False.
|
||||||
type: bool
|
type: bool
|
||||||
default: no
|
default: false
|
||||||
enable_ipv4:
|
enable_ipv4:
|
||||||
description:
|
description:
|
||||||
- Enables the public ipv4 address
|
- Enables the public ipv4 address
|
||||||
type: bool
|
type: bool
|
||||||
default: yes
|
default: true
|
||||||
enable_ipv6:
|
enable_ipv6:
|
||||||
description:
|
description:
|
||||||
- Enables the public ipv6 address
|
- Enables the public ipv6 address
|
||||||
type: bool
|
type: bool
|
||||||
default: yes
|
default: true
|
||||||
ipv4:
|
ipv4:
|
||||||
description:
|
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
|
- 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.
|
- Force the update of the server.
|
||||||
- May power off the server if update.
|
- May power off the server if update.
|
||||||
type: bool
|
type: bool
|
||||||
default: no
|
default: false
|
||||||
allow_deprecated_image:
|
allow_deprecated_image:
|
||||||
description:
|
description:
|
||||||
- Allows the creation of servers with deprecated images.
|
- Allows the creation of servers with deprecated images.
|
||||||
type: bool
|
type: bool
|
||||||
default: no
|
default: false
|
||||||
user_data:
|
user_data:
|
||||||
description:
|
description:
|
||||||
- User Data to be passed to the server on creation.
|
- User Data to be passed to the server on creation.
|
||||||
|
@ -181,7 +181,7 @@ EXAMPLES = """
|
||||||
hcloud_server:
|
hcloud_server:
|
||||||
name: my-server
|
name: my-server
|
||||||
server_type: cx21
|
server_type: cx21
|
||||||
upgrade_disk: yes
|
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)
|
||||||
|
@ -522,7 +522,7 @@ class AnsibleHcloudServer(Hcloud):
|
||||||
else:
|
else:
|
||||||
self.module.fail_json(
|
self.module.fail_json(
|
||||||
msg=("You try to use a deprecated image. The image %s will continue to be available until %s." +
|
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')))
|
) % (image.name, available_until.strftime('%Y-%m-%d')))
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
@ -844,7 +844,7 @@ class AnsibleHcloudServer(Hcloud):
|
||||||
return previous_server_status
|
return previous_server_status
|
||||||
else:
|
else:
|
||||||
self.module.warn(
|
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
|
% self.hcloud_server.name
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -95,13 +95,13 @@ EXAMPLES = """
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
name: my-volume
|
name: my-volume
|
||||||
server: my-server
|
server: my-server
|
||||||
automount: yes
|
automount: true
|
||||||
state: present
|
state: present
|
||||||
- name: Mount a existing Volume and automount
|
- name: Mount a existing Volume and automount
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
name: my-volume
|
name: my-volume
|
||||||
server: my-server
|
server: my-server
|
||||||
automount: yes
|
automount: true
|
||||||
state: present
|
state: present
|
||||||
- name: Ensure the Volume is absent (remove if needed)
|
- name: Ensure the Volume is absent (remove if needed)
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
hcloud_certificate:
|
hcloud_certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create certificate
|
- name: verify fail test missing required parameters on create certificate
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
certificate: "{{ certificate_example_com }}"
|
certificate: "{{ certificate_example_com }}"
|
||||||
private_key: "{{ certificate_example_com_key }}"
|
private_key: "{{ certificate_example_com_key }}"
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create certificate with check mode
|
- name: test create certificate with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
id: "{{ certificate.hcloud_certificate.id }}"
|
id: "{{ certificate.hcloud_certificate.id }}"
|
||||||
name: "changed-{{ hcloud_certificate_name }}"
|
name: "changed-{{ hcloud_certificate_name }}"
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create certificate with check mode
|
- name: test create certificate with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
|
# 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)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: create certificate
|
- name: create certificate
|
||||||
hcloud_certificate:
|
hcloud_certificate:
|
||||||
name: "{{ hcloud_certificate_name }}"
|
name: "{{ hcloud_certificate_name }}"
|
||||||
|
@ -22,7 +21,7 @@
|
||||||
- name: test gather hcloud certificate infos in check mode
|
- name: test gather hcloud certificate infos in check mode
|
||||||
hcloud_certificate_info:
|
hcloud_certificate_info:
|
||||||
register: hcloud_certificate
|
register: hcloud_certificate
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test gather hcloud certificate infos in check mode
|
- name: verify test gather hcloud certificate infos in check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -31,7 +30,7 @@
|
||||||
- name: test gather hcloud certificate infos
|
- name: test gather hcloud certificate infos
|
||||||
hcloud_certificate_info:
|
hcloud_certificate_info:
|
||||||
register: hcloud_certificate
|
register: hcloud_certificate
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test gather hcloud certificate infos
|
- name: verify test gather hcloud certificate infos
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
- name: test gather hcloud datacenter infos in check mode
|
- name: test gather hcloud datacenter infos in check mode
|
||||||
hcloud_datacenter_info:
|
hcloud_datacenter_info:
|
||||||
register: hcloud_datacenters
|
register: hcloud_datacenters
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
|
|
||||||
- name: verify test gather hcloud datacenter infos in check mode
|
- name: verify test gather hcloud datacenter infos in check mode
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
- name: test missing required parameters on create firewall
|
- name: test missing required parameters on create firewall
|
||||||
hcloud_firewall:
|
hcloud_firewall:
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create firewall
|
- name: verify fail test missing required parameters on create firewall
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
hcloud_firewall:
|
hcloud_firewall:
|
||||||
name: "{{ hcloud_firewall_name }}"
|
name: "{{ hcloud_firewall_name }}"
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create firewall with check mode
|
- name: test create firewall with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
id: "{{ firewall.hcloud_firewall.id }}"
|
id: "{{ firewall.hcloud_firewall.id }}"
|
||||||
name: "changed-{{ hcloud_firewall_name }}"
|
name: "changed-{{ hcloud_firewall_name }}"
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create firewall with check mode
|
- name: test create firewall with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
hcloud_floating_ip:
|
hcloud_floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing type parameter on create Floating IP
|
- name: verify fail test missing type parameter on create Floating IP
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create Floating IP
|
- name: verify fail test missing required parameters on create Floating IP
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing type parameter on delete Floating IP
|
- name: verify fail test missing type parameter on delete Floating IP
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
type: ipv5
|
type: ipv5
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify invalid type
|
- name: verify invalid type
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "abc"
|
home_location: "abc"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify invalid location
|
- name: verify invalid location
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -110,7 +110,7 @@
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
register: floatingIP
|
register: floatingIP
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test create Floating IP with check mode
|
- name: verify test create Floating IP with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
description: "changed-description"
|
description: "changed-description"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
home_location: "fsn1"
|
home_location: "fsn1"
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: floatingIP
|
register: floatingIP
|
||||||
- name: verify test create Floating IP with check mode
|
- name: verify test create Floating IP with check mode
|
||||||
assert:
|
assert:
|
||||||
|
@ -233,7 +233,7 @@
|
||||||
description: "changed-description"
|
description: "changed-description"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
server: "{{ main_server.hcloud_server.name }}"
|
server: "{{ main_server.hcloud_server.name }}"
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: floatingIP
|
register: floatingIP
|
||||||
- name: verify test assign Floating IP with checkmode
|
- name: verify test assign Floating IP with checkmode
|
||||||
assert:
|
assert:
|
||||||
|
@ -317,7 +317,7 @@
|
||||||
hcloud_floating_ip:
|
hcloud_floating_ip:
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
type: ipv4
|
type: ipv4
|
||||||
force: yes
|
force: true
|
||||||
server: "{{ main_server2.hcloud_server.name }}"
|
server: "{{ main_server2.hcloud_server.name }}"
|
||||||
register: floatingIP
|
register: floatingIP
|
||||||
- name: verify test already assigned Floating IP assign with force
|
- name: verify test already assigned Floating IP assign with force
|
||||||
|
@ -366,7 +366,7 @@
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify test delete floating ip
|
- name: verify test delete floating ip
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -454,7 +454,7 @@
|
||||||
name: "{{ hcloud_floating_ip_name }}"
|
name: "{{ hcloud_floating_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify test delete floating ip
|
- name: verify test delete floating ip
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
- name: test gather hcloud floating ip infos in check mode
|
- name: test gather hcloud floating ip infos in check mode
|
||||||
hcloud_floating_ip_info:
|
hcloud_floating_ip_info:
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: hcloud_floating_ips
|
register: hcloud_floating_ips
|
||||||
|
|
||||||
- name: verify test gather hcloud floating ip infos in check mode
|
- name: verify test gather hcloud floating ip infos in check mode
|
||||||
|
@ -38,7 +38,6 @@
|
||||||
that:
|
that:
|
||||||
- hcloud_floating_ips.hcloud_floating_ip_info| list | count >= 1
|
- hcloud_floating_ips.hcloud_floating_ip_info| list | count >= 1
|
||||||
|
|
||||||
|
|
||||||
- name: test gather hcloud floating ip infos with correct label selector
|
- name: test gather hcloud floating ip infos with correct label selector
|
||||||
hcloud_floating_ip_info:
|
hcloud_floating_ip_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
|
@ -70,7 +69,7 @@
|
||||||
hcloud_floating_ip_info:
|
hcloud_floating_ip_info:
|
||||||
id: "{{test_floating_ip.hcloud_floating_ip.id}}1"
|
id: "{{test_floating_ip.hcloud_floating_ip.id}}1"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify test gather hcloud floating ip with wrong id
|
- name: verify test gather hcloud floating ip with wrong id
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
- name: test gather hcloud image infos in check mode
|
- name: test gather hcloud image infos in check mode
|
||||||
hcloud_image_info:
|
hcloud_image_info:
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: hcloud_images
|
register: hcloud_images
|
||||||
|
|
||||||
- name: verify test gather hcloud image infos in check mode
|
- name: verify test gather hcloud image infos in check mode
|
||||||
|
@ -19,7 +19,6 @@
|
||||||
that:
|
that:
|
||||||
- hcloud_images.hcloud_image_info| list | count > 2
|
- hcloud_images.hcloud_image_info| list | count > 2
|
||||||
|
|
||||||
|
|
||||||
- name: test gather hcloud image infos with correct label selector
|
- name: test gather hcloud image infos with correct label selector
|
||||||
hcloud_image_info:
|
hcloud_image_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
|
@ -54,7 +53,7 @@
|
||||||
hcloud_image_info:
|
hcloud_image_info:
|
||||||
id: "{{hcloud_test_image_id}}1"
|
id: "{{hcloud_test_image_id}}1"
|
||||||
type: snapshot
|
type: snapshot
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify test gather hcloud image with wrong id
|
- name: verify test gather hcloud image with wrong id
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
hcloud_load_balancer:
|
hcloud_load_balancer:
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create Load Balancer
|
- name: verify fail test missing required parameters on create Load Balancer
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
network_zone: eu-central
|
network_zone: eu-central
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create Load Balancer with check mode
|
- name: test create Load Balancer with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -110,7 +110,7 @@
|
||||||
hcloud_load_balancer:
|
hcloud_load_balancer:
|
||||||
name: "{{hcloud_load_balancer_name}}"
|
name: "{{hcloud_load_balancer_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify delete Load Balancer fails if it is protected
|
- name: verify delete Load Balancer fails if it is protected
|
||||||
assert:
|
assert:
|
||||||
|
@ -218,7 +218,7 @@
|
||||||
name: "{{ hcloud_load_balancer_name }}"
|
name: "{{ hcloud_load_balancer_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify test delete Load Balancer
|
- name: verify test delete Load Balancer
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
- name: test gather hcloud Load Balancer infos in check mode
|
- name: test gather hcloud Load Balancer infos in check mode
|
||||||
hcloud_load_balancer_info:
|
hcloud_load_balancer_info:
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: hcloud_load_balancers
|
register: hcloud_load_balancers
|
||||||
|
|
||||||
- name: verify test gather hcloud Load Balancer infos in check mode
|
- name: verify test gather hcloud Load Balancer infos in check mode
|
||||||
|
@ -79,7 +79,6 @@
|
||||||
that:
|
that:
|
||||||
- hcloud_load_balancers.hcloud_load_balancer_info| list | count >= 1
|
- hcloud_load_balancers.hcloud_load_balancer_info| list | count >= 1
|
||||||
|
|
||||||
|
|
||||||
- name: test gather hcloud Load Balancer infos with correct label selector
|
- name: test gather hcloud Load Balancer infos with correct label selector
|
||||||
hcloud_load_balancer_info:
|
hcloud_load_balancer_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
|
@ -111,7 +110,7 @@
|
||||||
hcloud_load_balancer_info:
|
hcloud_load_balancer_info:
|
||||||
id: "{{test_load_balancer.hcloud_load_balancer.id}}1"
|
id: "{{test_load_balancer.hcloud_load_balancer.id}}1"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify test gather hcloud Load Balancer with wrong id
|
- name: verify test gather hcloud Load Balancer with wrong id
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
hcloud_load_balancer_network:
|
hcloud_load_balancer_network:
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create load_balancer network
|
- name: verify fail test missing required parameters on create load_balancer network
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test create load_balancer network with checkmode
|
- name: verify test create load_balancer network with checkmode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test create load_balancer service with checkmode
|
- name: verify test create load_balancer service with checkmode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -103,7 +103,7 @@
|
||||||
listen_port: 80
|
listen_port: 80
|
||||||
http:
|
http:
|
||||||
cookie_name: "Test"
|
cookie_name: "Test"
|
||||||
sticky_sessions: yes
|
sticky_sessions: true
|
||||||
state: present
|
state: present
|
||||||
register: load_balancer_service
|
register: load_balancer_service
|
||||||
- name: verify create load_balancer service
|
- name: verify create load_balancer service
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test create load_balancer target with checkmode
|
- name: verify test create load_balancer target with checkmode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
- name: test gather hcloud Load Balancer type infos in check mode
|
- name: test gather hcloud Load Balancer type infos in check mode
|
||||||
hcloud_load_balancer_type_info:
|
hcloud_load_balancer_type_info:
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: hcloud_load_balancer_types
|
register: hcloud_load_balancer_types
|
||||||
|
|
||||||
- name: verify test gather hcloud Load Balancer type infos in check mode
|
- name: verify test gather hcloud Load Balancer type infos in check mode
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
- name: test gather hcloud location infos in check mode
|
- name: test gather hcloud location infos in check mode
|
||||||
hcloud_location_info:
|
hcloud_location_info:
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: hcloud_location
|
register: hcloud_location
|
||||||
|
|
||||||
- name: verify test gather hcloud location infos in check mode
|
- name: verify test gather hcloud location infos in check mode
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
hcloud_network:
|
hcloud_network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail missing ip_range parameter on create Network result
|
- name: verify fail missing ip_range parameter on create Network result
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
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
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify create Network with check mode result
|
- name: verify create Network with check mode result
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
hcloud_network:
|
hcloud_network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify delete Network
|
- name: verify delete Network
|
||||||
assert:
|
assert:
|
||||||
|
@ -168,7 +168,6 @@
|
||||||
that:
|
that:
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
|
|
||||||
- name: test create Network with delete protection
|
- name: test create Network with delete protection
|
||||||
hcloud_network:
|
hcloud_network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
|
@ -185,7 +184,7 @@
|
||||||
hcloud_network:
|
hcloud_network:
|
||||||
name: "{{hcloud_network_name}}"
|
name: "{{hcloud_network_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify delete Network
|
- name: verify delete Network
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
|
# 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)
|
# 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
|
||||||
hcloud_network:
|
hcloud_network:
|
||||||
name: "{{ hcloud_network_name }}"
|
name: "{{ hcloud_network_name }}"
|
||||||
|
@ -47,14 +46,13 @@
|
||||||
|
|
||||||
- name: test gather hcloud network info in check mode
|
- name: test gather hcloud network info in check mode
|
||||||
hcloud_network_info:
|
hcloud_network_info:
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: hcloud_network
|
register: hcloud_network
|
||||||
- name: verify test gather hcloud network info in check mode
|
- name: verify test gather hcloud network info in check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- hcloud_network.hcloud_network_info | selectattr('name','equalto','{{ hcloud_network_name }}') | list | count >= 1
|
- hcloud_network.hcloud_network_info | selectattr('name','equalto','{{ hcloud_network_name }}') | list | count >= 1
|
||||||
|
|
||||||
|
|
||||||
- name: test gather hcloud network info with correct label selector
|
- name: test gather hcloud network info with correct label selector
|
||||||
hcloud_network_info:
|
hcloud_network_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
- name: test missing required parameters on create placement group
|
- name: test missing required parameters on create placement group
|
||||||
hcloud_placement_group:
|
hcloud_placement_group:
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
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
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
name: "{{ hcloud_placement_group_name }}"
|
name: "{{ hcloud_placement_group_name }}"
|
||||||
type: spread
|
type: spread
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create placement group with check mode
|
- name: test create placement group with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -122,7 +122,7 @@
|
||||||
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
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify update placement group with check mode
|
- name: verify update placement group with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
type: ipv4
|
type: ipv4
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
register: primaryIP
|
register: primaryIP
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test create Primary IP with check mode
|
- name: verify test create Primary IP with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify test delete primary ip
|
- name: verify test delete primary ip
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -218,7 +218,7 @@
|
||||||
name: "{{ hcloud_primary_ip_name }}"
|
name: "{{ hcloud_primary_ip_name }}"
|
||||||
state: "absent"
|
state: "absent"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify test delete primary ip
|
- name: verify test delete primary ip
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
hcloud_rdns:
|
hcloud_rdns:
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters
|
- name: verify fail test missing required parameters
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
ip_address: "127.0.0.1"
|
ip_address: "127.0.0.1"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail on not existing resou
|
- name: verify fail on not existing resou
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
hcloud_route:
|
hcloud_route:
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create route
|
- name: verify fail test missing required parameters on create route
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
gateway: "10.0.1.1"
|
gateway: "10.0.1.1"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test create route with checkmode
|
- name: verify test create route with checkmode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
gateway: "10.0.1.2"
|
gateway: "10.0.1.2"
|
||||||
state: present
|
state: present
|
||||||
register: route
|
register: route
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verfiy fail create route with wrong gateway
|
- name: verfiy fail create route with wrong gateway
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create server server
|
- name: test create server server
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
state: stopped
|
state: stopped
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify stop server with check mode
|
- name: verify stop server with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -309,7 +309,7 @@
|
||||||
hcloud_server:
|
hcloud_server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify delete server fails if it is protected
|
- name: verify delete server fails if it is protected
|
||||||
assert:
|
assert:
|
||||||
|
@ -322,7 +322,7 @@
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
state: rebuild
|
state: rebuild
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify rebuild server fails if it is protected
|
- name: verify rebuild server fails if it is protected
|
||||||
assert:
|
assert:
|
||||||
|
@ -373,7 +373,6 @@
|
||||||
- main_server.hcloud_server.status == "running"
|
- main_server.hcloud_server.status == "running"
|
||||||
- main_server.root_password != ""
|
- main_server.root_password != ""
|
||||||
|
|
||||||
|
|
||||||
- name: test activate rescue mode with check_mode
|
- name: test activate rescue mode with check_mode
|
||||||
hcloud_server:
|
hcloud_server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
|
@ -457,7 +456,6 @@
|
||||||
- main_server.root_password != ""
|
- main_server.root_password != ""
|
||||||
- main_server.hcloud_server.rescue_enabled is sameas true
|
- main_server.hcloud_server.rescue_enabled is sameas true
|
||||||
|
|
||||||
|
|
||||||
- name: absent server
|
- name: absent server
|
||||||
hcloud_server:
|
hcloud_server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
|
@ -581,7 +579,7 @@
|
||||||
hcloud_server:
|
hcloud_server:
|
||||||
name: "{{hcloud_server_name}}"
|
name: "{{hcloud_server_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify delete server fails if it is protected
|
- name: verify delete server fails if it is protected
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
firewalls:
|
firewalls:
|
||||||
- not-existing
|
- not-existing
|
||||||
state: present
|
state: present
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify add not existing firewall should fail
|
- name: verify add not existing firewall should fail
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
ipv4: "{{secondPrimaryIPv4.hcloud_primary_ip.id}}"
|
ipv4: "{{secondPrimaryIPv4.hcloud_primary_ip.id}}"
|
||||||
ipv6: ""
|
ipv6: ""
|
||||||
enable_ipv6: no
|
enable_ipv6: false
|
||||||
ssh_keys:
|
ssh_keys:
|
||||||
- ci@ansible.hetzner.cloud
|
- ci@ansible.hetzner.cloud
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
|
@ -66,8 +66,8 @@
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
enable_ipv4: no
|
enable_ipv4: false
|
||||||
enable_ipv6: no
|
enable_ipv6: false
|
||||||
private_networks:
|
private_networks:
|
||||||
- "{{ primaryNetwork.hcloud_network.name }}"
|
- "{{ primaryNetwork.hcloud_network.name }}"
|
||||||
ssh_keys:
|
ssh_keys:
|
||||||
|
@ -85,8 +85,8 @@
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
enable_ipv4: no
|
enable_ipv4: false
|
||||||
enable_ipv6: no
|
enable_ipv6: false
|
||||||
private_networks:
|
private_networks:
|
||||||
- "{{ primaryNetwork.hcloud_network.name }}"
|
- "{{ primaryNetwork.hcloud_network.name }}"
|
||||||
- "{{ secondaryNetwork.hcloud_network.id }}"
|
- "{{ secondaryNetwork.hcloud_network.id }}"
|
||||||
|
@ -105,8 +105,8 @@
|
||||||
server_type: cpx11
|
server_type: cpx11
|
||||||
datacenter: "fsn1-dc14"
|
datacenter: "fsn1-dc14"
|
||||||
image: "ubuntu-22.04"
|
image: "ubuntu-22.04"
|
||||||
enable_ipv4: no
|
enable_ipv4: false
|
||||||
enable_ipv6: no
|
enable_ipv6: false
|
||||||
private_networks:
|
private_networks:
|
||||||
- "{{ primaryNetwork.hcloud_network.name }}"
|
- "{{ primaryNetwork.hcloud_network.name }}"
|
||||||
- "{{ secondaryNetwork.hcloud_network.id }}"
|
- "{{ secondaryNetwork.hcloud_network.id }}"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
hcloud_server:
|
hcloud_server:
|
||||||
name: "{{ hcloud_server_name }}"
|
name: "{{ hcloud_server_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create server
|
- name: verify fail test missing required parameters on create server
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test create server with not existing server type
|
- name: verify fail test create server with not existing server type
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
image: my-not-existing-image-20.04
|
image: my-not-existing-image-20.04
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test create server with not existing image
|
- name: verify fail test create server with not existing image
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -25,18 +25,16 @@
|
||||||
- main_server.hcloud_server.status == "running"
|
- main_server.hcloud_server.status == "running"
|
||||||
- main_server.root_password != ""
|
- main_server.root_password != ""
|
||||||
|
|
||||||
|
|
||||||
- name: test gather hcloud server infos in check mode
|
- name: test gather hcloud server infos in check mode
|
||||||
hcloud_server_info:
|
hcloud_server_info:
|
||||||
register: server
|
register: server
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
|
|
||||||
- name: verify test gather hcloud server infos in check mode
|
- name: verify test gather hcloud server infos in check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- server.hcloud_server_info|selectattr('name','equalto','{{ hcloud_server_name }}') | list | count == 1
|
- server.hcloud_server_info|selectattr('name','equalto','{{ hcloud_server_name }}') | list | count == 1
|
||||||
|
|
||||||
|
|
||||||
- name: test gather hcloud server infos with correct label selector
|
- name: test gather hcloud server infos with correct label selector
|
||||||
hcloud_server_info:
|
hcloud_server_info:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
|
@ -104,8 +102,8 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
labels:
|
labels:
|
||||||
key: value
|
key: value
|
||||||
enable_ipv4: no
|
enable_ipv4: false
|
||||||
enable_ipv6: no
|
enable_ipv6: false
|
||||||
register: main_server
|
register: main_server
|
||||||
- name: verify create server
|
- name: verify create server
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
hcloud_server_network:
|
hcloud_server_network:
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create server network
|
- name: verify fail test missing required parameters on create server network
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test create server network with checkmode
|
- name: verify test create server network with checkmode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
- name: test gather hcloud server type infos in check mode
|
- name: test gather hcloud server type infos in check mode
|
||||||
hcloud_server_type_info:
|
hcloud_server_type_info:
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: hcloud_server_types
|
register: hcloud_server_types
|
||||||
|
|
||||||
- name: verify test gather hcloud server type infos in check mode
|
- name: verify test gather hcloud server type infos in check mode
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
hcloud_ssh_key:
|
hcloud_ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create ssh_key
|
- name: verify fail test missing required parameters on create ssh_key
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
public_key: "{{ key_material }}"
|
public_key: "{{ key_material }}"
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create ssh key with check mode
|
- name: test create ssh key with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
id: "{{ sshKey.hcloud_ssh_key.id }}"
|
id: "{{ sshKey.hcloud_ssh_key.id }}"
|
||||||
name: "changed-{{ hcloud_ssh_key_name }}"
|
name: "changed-{{ hcloud_ssh_key_name }}"
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: test create ssh key with check mode
|
- name: test create ssh key with check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
name: "{{ hcloud_ssh_key_name }}othername"
|
name: "{{ hcloud_ssh_key_name }}othername"
|
||||||
public_key: "{{ hcloud_doubled_ssh_key_public_key }}"
|
public_key: "{{ hcloud_doubled_ssh_key_public_key }}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify failed correctly
|
- name: verify failed correctly
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
|
# 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)
|
# 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
|
- name: setup ensure ssh key is absent
|
||||||
hcloud_ssh_key:
|
hcloud_ssh_key:
|
||||||
name: "{{ hcloud_ssh_key_name }}"
|
name: "{{ hcloud_ssh_key_name }}"
|
||||||
|
@ -24,7 +23,7 @@
|
||||||
- name: test gather hcloud ssh key infos in check mode
|
- name: test gather hcloud ssh key infos in check mode
|
||||||
hcloud_ssh_key_info:
|
hcloud_ssh_key_info:
|
||||||
register: hcloud_ssh_key
|
register: hcloud_ssh_key
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test gather hcloud ssh key infos in check mode
|
- name: verify test gather hcloud ssh key infos in check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -33,7 +32,7 @@
|
||||||
- name: test gather hcloud ssh key infos
|
- name: test gather hcloud ssh key infos
|
||||||
hcloud_ssh_key_info:
|
hcloud_ssh_key_info:
|
||||||
register: hcloud_ssh_key
|
register: hcloud_ssh_key
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test gather hcloud ssh key infos
|
- name: verify test gather hcloud ssh key infos
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
network: "{{ hcloud_network_name }}"
|
network: "{{ hcloud_network_name }}"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing required parameters on create route
|
- name: verify fail test missing required parameters on create route
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
network_zone: "eu-central"
|
network_zone: "eu-central"
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify test create subnetwork with checkmode
|
- name: verify test create subnetwork with checkmode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
- name: verify fail test missing size parameter on create Volume
|
- name: verify fail test missing size parameter on create Volume
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
size: 10
|
size: 10
|
||||||
location: "fsn1"
|
location: "fsn1"
|
||||||
register: result
|
register: result
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
- name: verify create Volume with check mode result
|
- name: verify create Volume with check mode result
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
server: "{{hcloud_server_name}}"
|
server: "{{hcloud_server_name}}"
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: volume
|
register: volume
|
||||||
- name: verify test attach Volume with checkmode
|
- name: verify test attach Volume with checkmode
|
||||||
assert:
|
assert:
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
- name: test detach Volume with checkmode
|
- name: test detach Volume with checkmode
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
register: volume
|
register: volume
|
||||||
- name: verify detach Volume with checkmode
|
- name: verify detach Volume with checkmode
|
||||||
assert:
|
assert:
|
||||||
|
@ -202,7 +202,7 @@
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify delete Volume fails if it is protected
|
- name: verify delete Volume fails if it is protected
|
||||||
assert:
|
assert:
|
||||||
|
@ -231,7 +231,6 @@
|
||||||
that:
|
that:
|
||||||
- result is success
|
- result is success
|
||||||
|
|
||||||
|
|
||||||
- name: test create Volume with delete protection
|
- name: test create Volume with delete protection
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
|
@ -249,7 +248,7 @@
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
name: "{{hcloud_volume_name}}"
|
name: "{{hcloud_volume_name}}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
- name: verify delete Volume fails if it is protected
|
- name: verify delete Volume fails if it is protected
|
||||||
assert:
|
assert:
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
- name: test gather hcloud volume infos in check mode
|
- name: test gather hcloud volume infos in check mode
|
||||||
hcloud_volume_info:
|
hcloud_volume_info:
|
||||||
register: hcloud_volume
|
register: hcloud_volume
|
||||||
check_mode: yes
|
check_mode: true
|
||||||
|
|
||||||
- name: verify test gather hcloud volume infos in check mode
|
- name: verify test gather hcloud volume infos in check mode
|
||||||
vars:
|
vars:
|
||||||
|
|
|
@ -47,9 +47,9 @@
|
||||||
|
|
||||||
- name: set facts for future roles
|
- name: set facts for future roles
|
||||||
set_fact:
|
set_fact:
|
||||||
sshkey: '{{ sshkey_file.path }}'
|
sshkey: "{{ sshkey_file.path }}"
|
||||||
key_material: "{{ lookup('file', sshkey_file.path ~ '.pub') }}"
|
key_material: "{{ lookup('file', sshkey_file.path ~ '.pub') }}"
|
||||||
another_key_material: "{{ lookup('file', another_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:
|
tags:
|
||||||
- prepare
|
- prepare
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
integration_tests_dependencies:
|
integration_tests_dependencies:
|
||||||
- community.general
|
- community.general
|
||||||
- ansible.netcommon
|
- ansible.netcommon
|
||||||
|
|
Loading…
Reference in a new issue