Skip to content

Commit

Permalink
ci: improve domain handling (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
resmo committed May 25, 2022
1 parent a52ed5e commit 79a58b5
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 55 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ jobs:
fail-fast: false
matrix:
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- devel
python:
- 2.7 # required by Ansible see https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#python-compatibility
- 3.6 # required by Ansible see https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#python-compatibility
- 3.8
exclude:
- ansible: stable-2.11
python: 3.8

- ansible: stable-2.12
python: 2.7
- ansible: stable-2.12
Expand All @@ -46,11 +47,6 @@ jobs:
python: 2.7
- ansible: stable-2.13
python: 3.6

- ansible: devel
python: 2.7
- ansible: devel
python: 3.6
steps:
- name: Check out code
uses: actions/checkout@v3
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ jobs:
strategy:
matrix:
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- devel
steps:
- name: Check out code
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This repository contains the `vultr.cloud` Ansible Collection . The collection w

## Ansible Version Compatibility

Tested with Ansible versions >= 2.9.
Tested with Ansible Core versions >= 2.11.

## Release Notes

Expand Down
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
requires_ansible: ">=2.9.10"
requires_ansible: ">=2.11"
action_groups:
vultr:
- account_info
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/dns_domain/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018, René Moser <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
vultr_dns_domain_name: "{{ vultr_resource_prefix }}-example-ansible.com"
vultr_dns_domain_name: "{{ vultr_resource_prefix }}-t1-vultr.com"
6 changes: 6 additions & 0 deletions tests/integration/targets/dns_domain/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
- block:
- ansible.builtin.import_tasks: tests.yml
always:
- name: cleanup dns domain
vultr.cloud.dns_domain:
name: "{{ vultr_dns_domain_name }}"
state: absent
ignore_errors: true

- ansible.builtin.import_role:
name: cleanup
tasks_from: cleanup_dns_domain
5 changes: 0 additions & 5 deletions tests/integration/targets/dns_domain/tasks/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
vultr.cloud.dns_domain:
name: "{{ vultr_dns_domain_name }}"
state: absent
register: result
- name: verify setup
ansible.builtin.assert:
that:
- result is success

- name: test fail if missing name
vultr.cloud.dns_domain:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
dns_domain_name: "{{ vultr_resource_prefix }}-example-ansible.com"
dns_domain_name: "{{ vultr_resource_prefix }}-t2-vultr.com"
dns_domain_server_ip: 104.24.16.59
6 changes: 6 additions & 0 deletions tests/integration/targets/dns_domain_info/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
- block:
- ansible.builtin.import_tasks: tests.yml
always:
- name: cleanup the domain
vultr.cloud.dns_domain:
name: "{{ dns_domain_name }}"
state: absent
ignore_errors: true

- ansible.builtin.import_role:
name: cleanup
tasks_from: cleanup_dns_domain
8 changes: 1 addition & 7 deletions tests/integration/targets/dns_domain_info/tasks/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- name: test gather vultr dns domain info in check mode
vultr.cloud.dns_domain_info:
check_mode: yes
check_mode: true
register: result

- name: verify test gather vultr dns domain info in check mode
Expand All @@ -25,9 +25,3 @@
ansible.builtin.assert:
that:
- result.vultr_dns_domain_info|selectattr('domain','equalto','{{ dns_domain_name }}') | list | count == 1

- name: Delete the record
vultr.cloud.dns_domain:
name: "{{ dns_domain_name }}"
server_ip: "{{ dns_domain_server_ip }}"
state: absent
59 changes: 30 additions & 29 deletions tests/integration/targets/dns_record/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# Copyright (c) 2021 René Moser <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
vultr_dns_domain_name: "{{ vultr_resource_prefix }}-example-ansible.com"
vultr_dns_domain_name: "{{ vultr_resource_prefix }}-t3-vultr.com"

vultr_dns_record_items:
# Single A record
- name: test-www
data: 10.10.10.10
ttl: 400
update_data: 10.10.10.11
update_ttl: 200
# Single A record
- name: test-www
data: 10.10.10.10
ttl: 400
update_data: 10.10.10.11
update_ttl: 200

# Multiple A records
- name: test-www-multiple
data: 10.10.11.10
update_data: 10.10.11.11
multiple: true
# Multiple A records
- name: test-www-multiple
data: 10.10.11.10
update_data: 10.10.11.11
multiple: true

# CNAME
- name: test-cname
data: www.ansible.com
update_data: www.ansible.ch
record_type: CNAME
# CNAME
- name: test-cname
data: www.ansible.com
update_data: www.ansible.ch
record_type: CNAME

# Single Multiple MX record
- data: mx1.example-ansible.com
priority: 10
update_priority: 20
record_type: MX
# Single Multiple MX record
- data: mx1.example-ansible.com
priority: 10
update_priority: 20
record_type: MX

# Multiple MX records
- data: mx2.example-ansible.com
priority: 10
update_data: mx1.example-ansible.com
update_priority: 20
record_type: MX
multiple: true
# Multiple MX records
- data: mx2.example-ansible.com
priority: 10
update_data: mx1.example-ansible.com
update_priority: 20
record_type: MX
multiple: true
6 changes: 6 additions & 0 deletions tests/integration/targets/dns_record/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
- block:
- ansible.builtin.import_tasks: tests.yml
always:
- name: cleanup dns domain
vultr.cloud.dns_domain:
name: "{{ vultr_dns_domain_name }}"
state: absent
ignore_errors: true

- ansible.builtin.import_role:
name: cleanup
tasks_from: cleanup_dns_domain

0 comments on commit 79a58b5

Please sign in to comment.