mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-12-11 21:12:53 +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
|
||||
|
||||
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:
|
||||
|
|
|
@ -45,11 +45,11 @@ jobs:
|
|||
parameters:
|
||||
jobs:
|
||||
- ${{ if eq(length(parameters.groups), 0) }}:
|
||||
- ${{ each target in parameters.targets }}:
|
||||
- name: ${{ format(parameters.nameFormat, coalesce(target.name, target.test)) }}
|
||||
test: ${{ format(parameters.testFormat, coalesce(target.test, target.name)) }}
|
||||
- ${{ if not(eq(length(parameters.groups), 0)) }}:
|
||||
- ${{ each group in parameters.groups }}:
|
||||
- ${{ each target in parameters.targets }}:
|
||||
- name: ${{ format(format(parameters.nameGroupFormat, parameters.nameFormat), coalesce(target.name, target.test), group) }}
|
||||
test: ${{ format(format(parameters.testGroupFormat, parameters.testFormat), coalesce(target.test, target.name), group) }}
|
||||
- name: ${{ format(parameters.nameFormat, coalesce(target.name, target.test)) }}
|
||||
test: ${{ format(parameters.testFormat, coalesce(target.test, target.name)) }}
|
||||
- ${{ if not(eq(length(parameters.groups), 0)) }}:
|
||||
- ${{ each group in parameters.groups }}:
|
||||
- ${{ each target in parameters.targets }}:
|
||||
- name: ${{ format(format(parameters.nameGroupFormat, parameters.nameFormat), coalesce(target.name, target.test), group) }}
|
||||
test: ${{ format(format(parameters.testGroupFormat, parameters.testFormat), coalesce(target.test, target.name), group) }}
|
||||
|
|
|
@ -9,37 +9,37 @@ parameters:
|
|||
|
||||
jobs:
|
||||
- ${{ each job in parameters.jobs }}:
|
||||
- job: test_${{ replace(replace(replace(job.test, '/', '_'), '.', '_'), '-', '_') }}
|
||||
displayName: ${{ job.name }}
|
||||
container: default
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: $(fetchDepth)
|
||||
path: $(checkoutPath)
|
||||
- bash: .azure-pipelines/scripts/run-tests.sh "$(entryPoint)" "${{ job.test }}" "$(coverageBranches)"
|
||||
displayName: Run Tests
|
||||
- bash: .azure-pipelines/scripts/process-results.sh
|
||||
condition: succeededOrFailed()
|
||||
displayName: Process Results
|
||||
- bash: .azure-pipelines/scripts/aggregate-coverage.sh "$(Agent.TempDirectory)"
|
||||
condition: eq(variables.haveCoverageData, 'true')
|
||||
displayName: Aggregate Coverage Data
|
||||
- task: PublishTestResults@2
|
||||
condition: eq(variables.haveTestResults, 'true')
|
||||
inputs:
|
||||
testResultsFiles: "$(outputPath)/junit/*.xml"
|
||||
displayName: Publish Test Results
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: eq(variables.haveBotResults, 'true')
|
||||
displayName: Publish Bot Results
|
||||
inputs:
|
||||
targetPath: "$(outputPath)/bot/"
|
||||
artifactName: "Bot $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: eq(variables.haveCoverageData, 'true')
|
||||
displayName: Publish Coverage Data
|
||||
inputs:
|
||||
targetPath: "$(Agent.TempDirectory)/coverage/"
|
||||
artifactName: "Coverage $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
|
||||
- job: test_${{ replace(replace(replace(job.test, '/', '_'), '.', '_'), '-', '_') }}
|
||||
displayName: ${{ job.name }}
|
||||
container: default
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: $(fetchDepth)
|
||||
path: $(checkoutPath)
|
||||
- bash: .azure-pipelines/scripts/run-tests.sh "$(entryPoint)" "${{ job.test }}" "$(coverageBranches)"
|
||||
displayName: Run Tests
|
||||
- bash: .azure-pipelines/scripts/process-results.sh
|
||||
condition: succeededOrFailed()
|
||||
displayName: Process Results
|
||||
- bash: .azure-pipelines/scripts/aggregate-coverage.sh "$(Agent.TempDirectory)"
|
||||
condition: eq(variables.haveCoverageData, 'true')
|
||||
displayName: Aggregate Coverage Data
|
||||
- task: PublishTestResults@2
|
||||
condition: eq(variables.haveTestResults, 'true')
|
||||
inputs:
|
||||
testResultsFiles: "$(outputPath)/junit/*.xml"
|
||||
displayName: Publish Test Results
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: eq(variables.haveBotResults, 'true')
|
||||
displayName: Publish Bot Results
|
||||
inputs:
|
||||
targetPath: "$(outputPath)/bot/"
|
||||
artifactName: "Bot $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: eq(variables.haveCoverageData, 'true')
|
||||
displayName: Publish Coverage Data
|
||||
inputs:
|
||||
targetPath: "$(Agent.TempDirectory)/coverage/"
|
||||
artifactName: "Coverage $(System.JobAttempt) $(System.StageDisplayName) $(System.JobDisplayName)"
|
||||
|
|
|
@ -14,7 +14,7 @@ jobs:
|
|||
python-version: "3.10"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install antsibull-changelog
|
||||
python -m pip install --upgrade pip
|
||||
pip install antsibull-changelog
|
||||
- name: test with lint
|
||||
run: antsibull-changelog lint
|
||||
|
|
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
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
|
|
|
@ -10,19 +10,19 @@ notesdir: fragments
|
|||
prelude_section_name: release_summary
|
||||
prelude_section_title: Release Summary
|
||||
sections:
|
||||
- - major_changes
|
||||
- Major Changes
|
||||
- - minor_changes
|
||||
- Minor Changes
|
||||
- - breaking_changes
|
||||
- Breaking Changes / Porting Guide
|
||||
- - deprecated_features
|
||||
- Deprecated Features
|
||||
- - removed_features
|
||||
- Removed Features (previously deprecated)
|
||||
- - security_fixes
|
||||
- Security Fixes
|
||||
- - bugfixes
|
||||
- Bugfixes
|
||||
- - known_issues
|
||||
- Known Issues
|
||||
- - major_changes
|
||||
- Major Changes
|
||||
- - minor_changes
|
||||
- Minor Changes
|
||||
- - breaking_changes
|
||||
- Breaking Changes / Porting Guide
|
||||
- - deprecated_features
|
||||
- Deprecated Features
|
||||
- - removed_features
|
||||
- Removed Features (previously deprecated)
|
||||
- - security_fixes
|
||||
- Security Fixes
|
||||
- - bugfixes
|
||||
- Bugfixes
|
||||
- - known_issues
|
||||
- Known Issues
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
requires_ansible: '>=2.12.0'
|
||||
requires_ansible: ">=2.12.0"
|
||||
plugin_routing:
|
||||
modules:
|
||||
hcloud_location_facts:
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,20 +21,20 @@
|
|||
- 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:
|
||||
- hcloud_certificate.hcloud_certificate_info| list | count >= 1
|
||||
- hcloud_certificate.hcloud_certificate_info| list | count >= 1
|
||||
|
||||
- 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:
|
||||
- hcloud_certificate.hcloud_certificate_info| list | count >= 1
|
||||
- hcloud_certificate.hcloud_certificate_info| list | count >= 1
|
||||
|
||||
- name: test gather hcloud certificate infos with correct label selector
|
||||
hcloud_certificate_info:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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"
|
||||
|
@ -68,9 +67,9 @@
|
|||
|
||||
- name: test gather hcloud floating ip infos with wrong id
|
||||
hcloud_floating_ip_info:
|
||||
id: "{{test_floating_ip.hcloud_floating_ip.id}}1"
|
||||
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:
|
||||
|
@ -84,4 +83,4 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
|
|
@ -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"
|
||||
|
@ -52,9 +51,9 @@
|
|||
|
||||
- name: test gather hcloud image infos with wrong id
|
||||
hcloud_image_info:
|
||||
id: "{{hcloud_test_image_id}}1"
|
||||
type: snapshot
|
||||
ignore_errors: yes
|
||||
id: "{{hcloud_test_image_id}}1"
|
||||
type: snapshot
|
||||
ignore_errors: true
|
||||
register: result
|
||||
- name: verify test gather hcloud image with wrong id
|
||||
assert:
|
||||
|
@ -63,7 +62,7 @@
|
|||
|
||||
- name: test gather hcloud image infos with name
|
||||
hcloud_image_info:
|
||||
name: "{{ hcloud_test_image_name_os }}"
|
||||
name: "{{ hcloud_test_image_name_os }}"
|
||||
register: hcloud_images
|
||||
- name: verify test gather hcloud image infos with name
|
||||
assert:
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
- name: test missing required parameters on create Load Balancer
|
||||
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:
|
||||
|
@ -139,7 +139,7 @@
|
|||
- name: verify absent Load Balancer
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: test create Load Balancer with labels
|
||||
hcloud_load_balancer:
|
||||
|
@ -198,7 +198,7 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: test create Load Balancer with delete protection
|
||||
hcloud_load_balancer:
|
||||
|
@ -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:
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
- name: verify create load_balancer target
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_target is success
|
||||
- load_balancer_target is success
|
||||
- name: test create load_balancer service
|
||||
hcloud_load_balancer_service:
|
||||
load_balancer: "{{hcloud_load_balancer_name}}"
|
||||
|
@ -51,7 +51,7 @@
|
|||
- name: verify create load_balancer service
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_service is success
|
||||
- load_balancer_service is success
|
||||
|
||||
- name: test gather hcloud Load Balancer infos
|
||||
hcloud_load_balancer_info:
|
||||
|
@ -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"
|
||||
|
@ -109,9 +108,9 @@
|
|||
|
||||
- name: test gather hcloud Load Balancer infos with wrong id
|
||||
hcloud_load_balancer_info:
|
||||
id: "{{test_load_balancer.hcloud_load_balancer.id}}1"
|
||||
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:
|
||||
|
@ -125,4 +124,4 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
- name: verify setup network
|
||||
assert:
|
||||
that:
|
||||
- network is success
|
||||
- network is success
|
||||
|
||||
- name: setup subnetwork
|
||||
hcloud_subnetwork:
|
||||
|
@ -23,7 +23,7 @@
|
|||
- name: verify subnetwork
|
||||
assert:
|
||||
that:
|
||||
- subnetwork is success
|
||||
- subnetwork is success
|
||||
|
||||
- name: setup load_balancer
|
||||
hcloud_load_balancer:
|
||||
|
@ -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,11 +80,11 @@
|
|||
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:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create load_balancer network
|
||||
hcloud_load_balancer_network:
|
||||
|
@ -95,9 +95,9 @@
|
|||
- name: verify create load_balancer network
|
||||
assert:
|
||||
that:
|
||||
- load_balancerNetwork is changed
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.network == hcloud_network_name
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.load_balancer == hcloud_load_balancer_name
|
||||
- load_balancerNetwork is changed
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.network == hcloud_network_name
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.load_balancer == hcloud_load_balancer_name
|
||||
|
||||
- name: test create load_balancer network idempotency
|
||||
hcloud_load_balancer_network:
|
||||
|
@ -108,7 +108,7 @@
|
|||
- name: verify create load_balancer network idempotency
|
||||
assert:
|
||||
that:
|
||||
- load_balancerNetwork is not changed
|
||||
- load_balancerNetwork is not changed
|
||||
|
||||
- name: test absent load_balancer network
|
||||
hcloud_load_balancer_network:
|
||||
|
@ -119,7 +119,7 @@
|
|||
- name: verify test absent load_balancer network
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create load_balancer network with specified ip
|
||||
hcloud_load_balancer_network:
|
||||
|
@ -131,10 +131,10 @@
|
|||
- name: verify create load_balancer network with specified ip
|
||||
assert:
|
||||
that:
|
||||
- load_balancerNetwork is changed
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.network == hcloud_network_name
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.load_balancer == hcloud_load_balancer_name
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.ip == "10.0.0.2"
|
||||
- load_balancerNetwork is changed
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.network == hcloud_network_name
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.load_balancer == hcloud_load_balancer_name
|
||||
- load_balancerNetwork.hcloud_load_balancer_network.ip == "10.0.0.2"
|
||||
|
||||
- name: cleanup create load_balancer network with specified ip
|
||||
hcloud_load_balancer_network:
|
||||
|
@ -145,7 +145,7 @@
|
|||
- name: verify cleanup create load_balancer network with specified ip
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: cleanup load_balancer
|
||||
hcloud_load_balancer:
|
||||
|
@ -155,7 +155,7 @@
|
|||
- name: verify cleanup load_balancer
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: cleanup subnetwork
|
||||
hcloud_subnetwork:
|
||||
|
@ -168,7 +168,7 @@
|
|||
- name: verify cleanup subnetwork
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: cleanup
|
||||
hcloud_network:
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
listen_port: 80
|
||||
state: present
|
||||
register: result
|
||||
check_mode: yes
|
||||
check_mode: true
|
||||
- name: verify test create load_balancer service with checkmode
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create load_balancer service
|
||||
hcloud_load_balancer_service:
|
||||
|
@ -50,11 +50,11 @@
|
|||
- name: verify create load_balancer service
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_service is changed
|
||||
- load_balancer_service.hcloud_load_balancer_service.protocol == "http"
|
||||
- load_balancer_service.hcloud_load_balancer_service.listen_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.destination_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||
- load_balancer_service is changed
|
||||
- load_balancer_service.hcloud_load_balancer_service.protocol == "http"
|
||||
- load_balancer_service.hcloud_load_balancer_service.listen_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.destination_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||
|
||||
- name: test create load_balancer service idempotency
|
||||
hcloud_load_balancer_service:
|
||||
|
@ -66,7 +66,7 @@
|
|||
- name: verify create load_balancer service idempotency
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_service is not changed
|
||||
- load_balancer_service is not changed
|
||||
|
||||
- name: test update load_balancer service
|
||||
hcloud_load_balancer_service:
|
||||
|
@ -78,11 +78,11 @@
|
|||
- name: verify create load_balancer service
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_service is changed
|
||||
- load_balancer_service.hcloud_load_balancer_service.protocol == "tcp"
|
||||
- load_balancer_service.hcloud_load_balancer_service.listen_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.destination_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||
- load_balancer_service is changed
|
||||
- load_balancer_service.hcloud_load_balancer_service.protocol == "tcp"
|
||||
- load_balancer_service.hcloud_load_balancer_service.listen_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.destination_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||
|
||||
- name: test absent load_balancer service
|
||||
hcloud_load_balancer_service:
|
||||
|
@ -94,7 +94,7 @@
|
|||
- name: verify test absent load_balancer service
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create load_balancer service with http
|
||||
hcloud_load_balancer_service:
|
||||
|
@ -103,17 +103,17 @@
|
|||
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
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_service is changed
|
||||
- load_balancer_service.hcloud_load_balancer_service.protocol == "http"
|
||||
- load_balancer_service.hcloud_load_balancer_service.listen_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.destination_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||
- load_balancer_service is changed
|
||||
- load_balancer_service.hcloud_load_balancer_service.protocol == "http"
|
||||
- load_balancer_service.hcloud_load_balancer_service.listen_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.destination_port == 80
|
||||
- load_balancer_service.hcloud_load_balancer_service.proxyprotocol is sameas false
|
||||
|
||||
- name: cleanup load_balancer
|
||||
hcloud_load_balancer:
|
||||
|
@ -123,4 +123,4 @@
|
|||
- name: verify cleanup load_balancer
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
|
|
@ -59,11 +59,11 @@
|
|||
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:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create load_balancer target
|
||||
hcloud_load_balancer_target:
|
||||
|
@ -75,10 +75,10 @@
|
|||
- name: verify create load_balancer target
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_target is changed
|
||||
- load_balancer_target.hcloud_load_balancer_target.type == "server"
|
||||
- load_balancer_target.hcloud_load_balancer_target.server == hcloud_server_name
|
||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||
- load_balancer_target is changed
|
||||
- load_balancer_target.hcloud_load_balancer_target.type == "server"
|
||||
- load_balancer_target.hcloud_load_balancer_target.server == hcloud_server_name
|
||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||
|
||||
- name: test create load_balancer target idempotency
|
||||
hcloud_load_balancer_target:
|
||||
|
@ -90,7 +90,7 @@
|
|||
- name: verify create load_balancer target idempotency
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_target is not changed
|
||||
- load_balancer_target is not changed
|
||||
|
||||
- name: test absent load_balancer target
|
||||
hcloud_load_balancer_target:
|
||||
|
@ -102,7 +102,7 @@
|
|||
- name: verify test absent load_balancer target
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create label_selector target
|
||||
hcloud_load_balancer_target:
|
||||
|
@ -114,10 +114,10 @@
|
|||
- name: verify create label_selector target
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_target is changed
|
||||
- load_balancer_target.hcloud_load_balancer_target.type == "label_selector"
|
||||
- load_balancer_target.hcloud_load_balancer_target.label_selector == "application=backend"
|
||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||
- load_balancer_target is changed
|
||||
- load_balancer_target.hcloud_load_balancer_target.type == "label_selector"
|
||||
- load_balancer_target.hcloud_load_balancer_target.label_selector == "application=backend"
|
||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||
|
||||
- name: test create ip target
|
||||
hcloud_load_balancer_target:
|
||||
|
@ -129,10 +129,10 @@
|
|||
- name: verify create ip target
|
||||
assert:
|
||||
that:
|
||||
- load_balancer_target is changed
|
||||
- load_balancer_target.hcloud_load_balancer_target.type == "ip"
|
||||
- load_balancer_target.hcloud_load_balancer_target.ip == hcloud_testing_ip
|
||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||
- load_balancer_target is changed
|
||||
- load_balancer_target.hcloud_load_balancer_target.type == "ip"
|
||||
- load_balancer_target.hcloud_load_balancer_target.ip == hcloud_testing_ip
|
||||
- load_balancer_target.hcloud_load_balancer_target.load_balancer == hcloud_load_balancer_name
|
||||
|
||||
- name: cleanup load_balancer
|
||||
hcloud_load_balancer:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
- name: test gather hcloud location infos with wrong name
|
||||
hcloud_location_info:
|
||||
name: "{{hcloud_location_name}}1"
|
||||
name: "{{hcloud_location_name}}1"
|
||||
register: hcloud_location
|
||||
- name: verify test gather hcloud location with wrong name
|
||||
assert:
|
||||
|
@ -49,7 +49,7 @@
|
|||
|
||||
- name: test gather hcloud location infos with wrong id
|
||||
hcloud_location_info:
|
||||
name: "4711"
|
||||
name: "4711"
|
||||
register: hcloud_location
|
||||
- name: verify test gather hcloud location with wrong id
|
||||
assert:
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: test missing ip_range parameter on create Network
|
||||
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:
|
||||
|
|
|
@ -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"
|
||||
|
@ -86,7 +84,7 @@
|
|||
|
||||
- name: test gather hcloud network info with wrong name
|
||||
hcloud_network_info:
|
||||
name: "{{hcloud_network_name}}1"
|
||||
name: "{{hcloud_network_name}}1"
|
||||
register: hcloud_network
|
||||
- name: verify test gather hcloud network with wrong name
|
||||
assert:
|
||||
|
@ -104,7 +102,7 @@
|
|||
|
||||
- name: test gather hcloud network info with wrong id
|
||||
hcloud_network_info:
|
||||
name: "4711"
|
||||
name: "4711"
|
||||
register: hcloud_network
|
||||
- name: verify test gather hcloud network with wrong id
|
||||
assert:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- setup is success
|
||||
- setup is success
|
||||
|
||||
- name: setup Floating IP
|
||||
hcloud_floating_ip:
|
||||
|
@ -36,7 +36,7 @@
|
|||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- load_balancer is success
|
||||
- load_balancer is success
|
||||
|
||||
- name: setup Primary IP
|
||||
hcloud_primary_ip:
|
||||
|
@ -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:
|
||||
|
@ -81,10 +81,10 @@
|
|||
- name: verify create rdns
|
||||
assert:
|
||||
that:
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.server == "{{ hcloud_server_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ setup.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.server == "{{ hcloud_server_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ setup.hcloud_server.ipv6 | ansible.netcommon.ipaddr('next_usable') }}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
|
||||
- name: test create rdns idempotency
|
||||
hcloud_rdns:
|
||||
|
@ -96,7 +96,7 @@
|
|||
- name: verify create rdns idempotency
|
||||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
- result is not changed
|
||||
|
||||
- name: test absent rdns
|
||||
hcloud_rdns:
|
||||
|
@ -107,7 +107,7 @@
|
|||
- name: verify test absent rdns
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test update rdns
|
||||
hcloud_rdns:
|
||||
|
@ -119,10 +119,10 @@
|
|||
- name: verify update rdns
|
||||
assert:
|
||||
that:
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.server == "{{ hcloud_server_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ setup.hcloud_server.ipv4_address }}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.server == "{{ hcloud_server_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ setup.hcloud_server.ipv4_address }}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
|
||||
- name: test reset rdns
|
||||
hcloud_rdns:
|
||||
|
@ -133,10 +133,10 @@
|
|||
- name: verify reset rdns
|
||||
assert:
|
||||
that:
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.server == "{{ hcloud_server_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ setup.hcloud_server.ipv4_address }}"
|
||||
- rdns.hcloud_rdns.dns_ptr != "example.com"
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.server == "{{ hcloud_server_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ setup.hcloud_server.ipv4_address }}"
|
||||
- rdns.hcloud_rdns.dns_ptr != "example.com"
|
||||
|
||||
- name: test create rdns with floating IP
|
||||
hcloud_rdns:
|
||||
|
@ -148,10 +148,10 @@
|
|||
- name: verify create rdns
|
||||
assert:
|
||||
that:
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.floating_ip == "{{ hcloud_floating_ip_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ floatingIP.hcloud_floating_ip.ip}}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.floating_ip == "{{ hcloud_floating_ip_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ floatingIP.hcloud_floating_ip.ip}}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
|
||||
- name: test create rdns with primary IP
|
||||
hcloud_rdns:
|
||||
|
@ -163,10 +163,10 @@
|
|||
- name: verify create rdns
|
||||
assert:
|
||||
that:
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.primary_ip == "{{ hcloud_primary_ip_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ primaryIP.hcloud_primary_ip.ip}}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.primary_ip == "{{ hcloud_primary_ip_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ primaryIP.hcloud_primary_ip.ip}}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
|
||||
- name: test create rdns with load balancer
|
||||
hcloud_rdns:
|
||||
|
@ -178,10 +178,10 @@
|
|||
- name: verify create rdns with load balancer
|
||||
assert:
|
||||
that:
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.load_balancer == "{{ hcloud_load_balancer_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ load_balancer.hcloud_load_balancer.ipv4_address }}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
- rdns is changed
|
||||
- rdns.hcloud_rdns.load_balancer == "{{ hcloud_load_balancer_name }}"
|
||||
- rdns.hcloud_rdns.ip_address == "{{ load_balancer.hcloud_load_balancer.ipv4_address }}"
|
||||
- rdns.hcloud_rdns.dns_ptr == "example.com"
|
||||
|
||||
- name: cleanup
|
||||
hcloud_server:
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- network is success
|
||||
- network is success
|
||||
|
||||
- name: test missing required parameters on create route
|
||||
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,11 +30,11 @@
|
|||
gateway: "10.0.1.1"
|
||||
state: present
|
||||
register: result
|
||||
check_mode: yes
|
||||
check_mode: true
|
||||
- name: verify test create route with checkmode
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create route
|
||||
hcloud_route:
|
||||
|
@ -46,10 +46,10 @@
|
|||
- name: verify create route
|
||||
assert:
|
||||
that:
|
||||
- route is changed
|
||||
- route.hcloud_route.network == "{{ hcloud_network_name }}"
|
||||
- route.hcloud_route.destination == "10.100.1.0/24"
|
||||
- route.hcloud_route.gateway == "10.0.1.1"
|
||||
- route is changed
|
||||
- route.hcloud_route.network == "{{ hcloud_network_name }}"
|
||||
- route.hcloud_route.destination == "10.100.1.0/24"
|
||||
- route.hcloud_route.gateway == "10.0.1.1"
|
||||
|
||||
- name: test create route idempotency
|
||||
hcloud_route:
|
||||
|
@ -61,7 +61,7 @@
|
|||
- name: verify create route idempotency
|
||||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
- result is not changed
|
||||
|
||||
- name: test fail create route with wrong gateway
|
||||
hcloud_route:
|
||||
|
@ -70,11 +70,11 @@
|
|||
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:
|
||||
- route is failed
|
||||
- route is failed
|
||||
|
||||
- name: test absent route
|
||||
hcloud_route:
|
||||
|
@ -86,7 +86,7 @@
|
|||
- name: verify test absent route
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: cleanup
|
||||
hcloud_network:
|
||||
|
|
|
@ -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:
|
||||
|
@ -353,7 +353,7 @@
|
|||
- name: verify absent server
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: test create server with ssh key
|
||||
hcloud_server:
|
||||
|
@ -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 }}"
|
||||
|
@ -435,7 +434,7 @@
|
|||
- name: verify absent server
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: test create server with rescue_mode
|
||||
hcloud_server:
|
||||
|
@ -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 }}"
|
||||
|
@ -466,7 +464,7 @@
|
|||
- name: verify absent server
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
- name: test create server with labels
|
||||
hcloud_server:
|
||||
name: "{{ hcloud_server_name}}"
|
||||
|
@ -530,7 +528,7 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: test create server with enabled backups
|
||||
hcloud_server:
|
||||
|
@ -556,7 +554,7 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: test create server with protection
|
||||
hcloud_server:
|
||||
|
@ -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:
|
||||
|
@ -612,4 +610,4 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }}"
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: test missing required parameters on create server
|
||||
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:
|
||||
|
|
|
@ -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"
|
||||
|
@ -66,7 +64,7 @@
|
|||
|
||||
- name: test gather hcloud server infos with wrong name
|
||||
hcloud_server_info:
|
||||
name: "{{hcloud_server_name}}1"
|
||||
name: "{{hcloud_server_name}}1"
|
||||
register: server
|
||||
- name: verify test gather hcloud server infos with wrong name
|
||||
assert:
|
||||
|
@ -84,7 +82,7 @@
|
|||
|
||||
- name: test gather hcloud server infos with wrong id
|
||||
hcloud_server_info:
|
||||
name: "4711"
|
||||
name: "4711"
|
||||
register: server
|
||||
- name: verify test gather hcloud server infos with wrong id
|
||||
assert:
|
||||
|
@ -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:
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
- name: verify setup network
|
||||
assert:
|
||||
that:
|
||||
- network is success
|
||||
- network is success
|
||||
|
||||
- name: setup subnetwork
|
||||
hcloud_subnetwork:
|
||||
|
@ -23,7 +23,7 @@
|
|||
- name: verify subnetwork
|
||||
assert:
|
||||
that:
|
||||
- subnetwork is success
|
||||
- subnetwork is success
|
||||
|
||||
- name: setup server
|
||||
hcloud_server:
|
||||
|
@ -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,11 +55,11 @@
|
|||
server: "{{hcloud_server_name}}"
|
||||
state: present
|
||||
register: result
|
||||
check_mode: yes
|
||||
check_mode: true
|
||||
- name: verify test create server network with checkmode
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create server network
|
||||
hcloud_server_network:
|
||||
|
@ -70,9 +70,9 @@
|
|||
- name: verify create server network
|
||||
assert:
|
||||
that:
|
||||
- serverNetwork is changed
|
||||
- serverNetwork.hcloud_server_network.network == hcloud_network_name
|
||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||
- serverNetwork is changed
|
||||
- serverNetwork.hcloud_server_network.network == hcloud_network_name
|
||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||
|
||||
- name: test create server network idempotency
|
||||
hcloud_server_network:
|
||||
|
@ -83,7 +83,7 @@
|
|||
- name: verify create server network idempotency
|
||||
assert:
|
||||
that:
|
||||
- serverNetwork is not changed
|
||||
- serverNetwork is not changed
|
||||
|
||||
- name: test absent server network
|
||||
hcloud_server_network:
|
||||
|
@ -94,7 +94,7 @@
|
|||
- name: verify test absent server network
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create server network with specified ip
|
||||
hcloud_server_network:
|
||||
|
@ -106,10 +106,10 @@
|
|||
- name: verify create server network with specified ip
|
||||
assert:
|
||||
that:
|
||||
- serverNetwork is changed
|
||||
- serverNetwork.hcloud_server_network.network == hcloud_network_name
|
||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||
- serverNetwork.hcloud_server_network.ip == "10.0.0.2"
|
||||
- serverNetwork is changed
|
||||
- serverNetwork.hcloud_server_network.network == hcloud_network_name
|
||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||
- serverNetwork.hcloud_server_network.ip == "10.0.0.2"
|
||||
|
||||
- name: cleanup create server network with specified ip
|
||||
hcloud_server_network:
|
||||
|
@ -120,7 +120,7 @@
|
|||
- name: verify cleanup create server network with specified ip
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create server network with alias ips
|
||||
hcloud_server_network:
|
||||
|
@ -135,12 +135,12 @@
|
|||
- name: verify create server network with alias ips
|
||||
assert:
|
||||
that:
|
||||
- serverNetwork is changed
|
||||
- serverNetwork.hcloud_server_network.network == hcloud_network_name
|
||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||
- serverNetwork.hcloud_server_network.ip == "10.0.0.2"
|
||||
- 'serverNetwork.hcloud_server_network.alias_ips[0] == "10.0.2.3"'
|
||||
- 'serverNetwork.hcloud_server_network.alias_ips[1] == "10.0.1.2"'
|
||||
- serverNetwork is changed
|
||||
- serverNetwork.hcloud_server_network.network == hcloud_network_name
|
||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||
- serverNetwork.hcloud_server_network.ip == "10.0.0.2"
|
||||
- 'serverNetwork.hcloud_server_network.alias_ips[0] == "10.0.2.3"'
|
||||
- 'serverNetwork.hcloud_server_network.alias_ips[1] == "10.0.1.2"'
|
||||
|
||||
- name: test update server network with alias ips
|
||||
hcloud_server_network:
|
||||
|
@ -155,12 +155,12 @@
|
|||
- name: verify create server network with alias ips
|
||||
assert:
|
||||
that:
|
||||
- serverNetwork is changed
|
||||
- serverNetwork.hcloud_server_network.network == hcloud_network_name
|
||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||
- serverNetwork.hcloud_server_network.ip == "10.0.0.2"
|
||||
- 'serverNetwork.hcloud_server_network.alias_ips[0] == "10.0.2.3"'
|
||||
- 'serverNetwork.hcloud_server_network.alias_ips[1] == "10.0.3.1"'
|
||||
- serverNetwork is changed
|
||||
- serverNetwork.hcloud_server_network.network == hcloud_network_name
|
||||
- serverNetwork.hcloud_server_network.server == hcloud_server_name
|
||||
- serverNetwork.hcloud_server_network.ip == "10.0.0.2"
|
||||
- 'serverNetwork.hcloud_server_network.alias_ips[0] == "10.0.2.3"'
|
||||
- 'serverNetwork.hcloud_server_network.alias_ips[1] == "10.0.3.1"'
|
||||
|
||||
- name: test update server network with alias ips idempotency
|
||||
hcloud_server_network:
|
||||
|
@ -175,7 +175,7 @@
|
|||
- name: verify create server network with alias ips idempotency
|
||||
assert:
|
||||
that:
|
||||
- serverNetwork is not changed
|
||||
- serverNetwork is not changed
|
||||
|
||||
- name: cleanup create server network with alias ips
|
||||
hcloud_server_network:
|
||||
|
@ -186,7 +186,7 @@
|
|||
- name: verify cleanup create server network with alias ips
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: cleanup server
|
||||
hcloud_server:
|
||||
|
@ -196,7 +196,7 @@
|
|||
- name: verify cleanup server
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
||||
- name: cleanup subnetwork
|
||||
hcloud_subnetwork:
|
||||
|
@ -209,7 +209,7 @@
|
|||
- name: verify cleanup subnetwork
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: cleanup
|
||||
hcloud_network:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,20 +23,20 @@
|
|||
- 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:
|
||||
- hcloud_ssh_key.hcloud_ssh_key_info| list | count >= 1
|
||||
- hcloud_ssh_key.hcloud_ssh_key_info| list | count >= 1
|
||||
|
||||
- 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:
|
||||
- hcloud_ssh_key.hcloud_ssh_key_info| list | count >= 1
|
||||
- hcloud_ssh_key.hcloud_ssh_key_info| list | count >= 1
|
||||
|
||||
- name: test gather hcloud ssh key infos with correct label selector
|
||||
hcloud_ssh_key_info:
|
||||
|
@ -65,4 +64,4 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
- name: verify setup
|
||||
assert:
|
||||
that:
|
||||
- network is success
|
||||
- network is success
|
||||
|
||||
- name: test missing required parameters on create route
|
||||
hcloud_subnetwork:
|
||||
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,11 +32,11 @@
|
|||
network_zone: "eu-central"
|
||||
state: present
|
||||
register: result
|
||||
check_mode: yes
|
||||
check_mode: true
|
||||
- name: verify test create subnetwork with checkmode
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test create subnetwork
|
||||
hcloud_subnetwork:
|
||||
|
@ -49,11 +49,11 @@
|
|||
- name: verify create subnetwork
|
||||
assert:
|
||||
that:
|
||||
- subnet is changed
|
||||
- subnet.hcloud_subnetwork.network == "{{ hcloud_network_name }}"
|
||||
- subnet.hcloud_subnetwork.ip_range == "10.0.0.0/16"
|
||||
- subnet.hcloud_subnetwork.type == "cloud"
|
||||
- subnet.hcloud_subnetwork.network_zone == "eu-central"
|
||||
- subnet is changed
|
||||
- subnet.hcloud_subnetwork.network == "{{ hcloud_network_name }}"
|
||||
- subnet.hcloud_subnetwork.ip_range == "10.0.0.0/16"
|
||||
- subnet.hcloud_subnetwork.type == "cloud"
|
||||
- subnet.hcloud_subnetwork.network_zone == "eu-central"
|
||||
|
||||
- name: test create subnetwork idempotency
|
||||
hcloud_subnetwork:
|
||||
|
@ -66,7 +66,7 @@
|
|||
- name: verify create subnetwork idempotency
|
||||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
- result is not changed
|
||||
|
||||
- name: test absent subnetwork
|
||||
hcloud_subnetwork:
|
||||
|
@ -79,7 +79,7 @@
|
|||
- name: verify test absent subnetwork
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: test vswitch subnetwork
|
||||
hcloud_subnetwork:
|
||||
|
@ -93,12 +93,12 @@
|
|||
- name: verify test vswitch subnetwork
|
||||
assert:
|
||||
that:
|
||||
- subnet is changed
|
||||
- subnet.hcloud_subnetwork.network == "{{ hcloud_network_name }}"
|
||||
- subnet.hcloud_subnetwork.ip_range == "10.0.0.0/16"
|
||||
- subnet.hcloud_subnetwork.type == "vswitch"
|
||||
- subnet.hcloud_subnetwork.network_zone == "eu-central"
|
||||
- subnet.hcloud_subnetwork.vswitch_id == hetzner_vswitch_id
|
||||
- subnet is changed
|
||||
- subnet.hcloud_subnetwork.network == "{{ hcloud_network_name }}"
|
||||
- subnet.hcloud_subnetwork.ip_range == "10.0.0.0/16"
|
||||
- subnet.hcloud_subnetwork.type == "vswitch"
|
||||
- subnet.hcloud_subnetwork.network_zone == "eu-central"
|
||||
- subnet.hcloud_subnetwork.vswitch_id == hetzner_vswitch_id
|
||||
|
||||
- name: test absent subnetwork
|
||||
hcloud_subnetwork:
|
||||
|
@ -112,7 +112,7 @@
|
|||
- name: verify test absent subnetwork
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result is changed
|
||||
|
||||
- name: cleanup
|
||||
hcloud_network:
|
||||
|
|
|
@ -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:
|
||||
|
@ -286,4 +285,4 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
|
|
@ -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:
|
||||
|
@ -65,7 +65,7 @@
|
|||
|
||||
- name: test gather hcloud volume infos with wrong name
|
||||
hcloud_volume_info:
|
||||
name: "{{hcloud_volume_name}}1"
|
||||
name: "{{hcloud_volume_name}}1"
|
||||
register: hcloud_volume
|
||||
- name: verify test gather hcloud volume infos with wrong name
|
||||
assert:
|
||||
|
@ -83,7 +83,7 @@
|
|||
|
||||
- name: test gather hcloud volume infos with wrong id
|
||||
hcloud_volume_info:
|
||||
name: "4711"
|
||||
name: "4711"
|
||||
register: hcloud_volume
|
||||
- name: verify test gather hcloud volume infos with wrong id
|
||||
assert:
|
||||
|
@ -98,4 +98,4 @@
|
|||
- name: verify cleanup
|
||||
assert:
|
||||
that:
|
||||
- result is success
|
||||
- result is success
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
- name: set facts for future roles
|
||||
set_fact:
|
||||
certificate_example_com: "{{ lookup('file',certificate_example_com.path) }}"
|
||||
certificate_example_com_key: "{{ lookup('file',certificate_example_com_key.path) }}"
|
||||
certificate_example_com_key: "{{ lookup('file',certificate_example_com_key.path) }}"
|
||||
tags:
|
||||
- prepare
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
integration_tests_dependencies:
|
||||
- community.general
|
||||
- ansible.netcommon
|
||||
- community.general
|
||||
- ansible.netcommon
|
||||
|
|
Loading…
Reference in a new issue