-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julien BORDELLIER
committed
Apr 13, 2020
1 parent
4067f1b
commit 75fadb3
Showing
5 changed files
with
287 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cloud/vultr/vultr_lb.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cloud/vultr | ||
unsupported |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) 2020, Julien BORDELLIER <git@julienbordellier.com> | ||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
--- | ||
vultr_lb_name: "test-ansible" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Copyright (c) 2020, Julien BORDELLIER <git@julienbordellier.com> | ||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
--- | ||
- name: setup | ||
vultr_lb: | ||
name: "{{ vultr_lb_name }}" | ||
dcid: 1 | ||
state: absent | ||
register: result | ||
- name: verify setup | ||
assert: | ||
that: | ||
- result is success | ||
|
||
- name: test fail if missing name | ||
vultr_lb: | ||
dcid: 1 | ||
register: result | ||
ignore_errors: true | ||
- name: verify test fail if missing name | ||
assert: | ||
that: | ||
- result is failed | ||
- 'result.msg == "missing required arguments: name"' | ||
|
||
- name: test fail if missing dcid | ||
vultr_lb: | ||
name: "{{ vultr_lb_name }}" | ||
register: result | ||
ignore_errors: true | ||
- name: verify test fail if missing dcid | ||
assert: | ||
that: | ||
- result is failed | ||
- 'result.msg == "missing required arguments: dcid"' | ||
|
||
- name: test create loadbalancer in check mode | ||
vultr_lb: | ||
name: "{{ vultr_lb_name }}" | ||
dcid: 1 | ||
register: result | ||
check_mode: true | ||
- name: verify test create loadbalancer in check mode | ||
assert: | ||
that: | ||
- result is changed | ||
|
||
- name: test create loadbalancer | ||
vultr_lb: | ||
name: "{{ vultr_lb_name }}" | ||
dcid: 1 | ||
register: result | ||
- name: verify test create loadbalancer | ||
assert: | ||
that: | ||
- result is changed | ||
- result.vultr_lb.name == '{{ vultr_lb_name }}' | ||
|
||
- name: test create loadbalancer idempotence | ||
vultr_lb: | ||
name: "{{ vultr_lb_name }}" | ||
dcid: 1 | ||
register: result | ||
- name: verify test create loadbalancer idempotence | ||
assert: | ||
that: | ||
- result is not changed | ||
- result.vultr_lb.name == '{{ vultr_lb_name }}' | ||
|
||
- name: test absent loadbalancer in check mode | ||
vultr_lb: | ||
name: "{{ vultr_lb_name }}" | ||
state: absent | ||
register: result | ||
check_mode: true | ||
- name: verify test absent loadbalancer in check mode | ||
assert: | ||
that: | ||
- result is changed | ||
- result.vultr_lb.name == '{{ vultr_lb_name }}' | ||
|
||
- name: test absent loadbalancer | ||
vultr_lb: | ||
name: "{{ vultr_lb_name }}" | ||
state: absent | ||
register: result | ||
- name: verify test absent loadbalancer | ||
assert: | ||
that: | ||
- result is changed | ||
- result.vultr_lb.name == '{{ vultr_lb_name }}' | ||
|
||
- name: test absent loadbalancer idempotence | ||
vultr_lb: | ||
name: "{{ vultr_lb_name }}" | ||
state: absent | ||
register: result | ||
- name: verify test absent loadbalancer idempotence | ||
assert: | ||
that: | ||
- result is not changed |