mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
6 years ago
|
# SCW_API_KEY='XXX' SCW_ORG='YYY' ansible-playbook ./test/legacy/scaleway_volume.yml
|
||
|
|
||
|
- name: Test compute instance lifecyle on a Scaleway account
|
||
|
hosts: localhost
|
||
|
gather_facts: no
|
||
|
environment:
|
||
|
SCW_API_KEY: "{{ lookup('env', 'SCW_API_KEY') }}"
|
||
|
vars:
|
||
|
scw_org: "{{ lookup('env', 'SCW_ORG') }}"
|
||
|
|
||
|
tasks:
|
||
|
|
||
|
- name: Make sure volume is not there before tests
|
||
|
scaleway_volume:
|
||
|
name: ansible-test-volume
|
||
|
state: absent
|
||
|
region: par1
|
||
|
organization: "{{ scw_org }}"
|
||
|
register: server_creation_check_task
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- server_creation_check_task is success
|
||
|
|
||
|
- name: Create volume
|
||
|
scaleway_volume:
|
||
|
name: ansible-test-volume
|
||
|
state: present
|
||
|
region: par1
|
||
|
organization: "{{ scw_org }}"
|
||
|
"size": 10000000000
|
||
|
volume_type: l_ssd
|
||
|
register: server_creation_check_task
|
||
|
|
||
|
- debug: var=server_creation_check_task
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- server_creation_check_task is success
|
||
|
- server_creation_check_task is changed
|
||
|
|
||
|
- name: Make sure volume is deleted
|
||
|
scaleway_volume:
|
||
|
name: ansible-test-volume
|
||
|
state: absent
|
||
|
region: par1
|
||
|
organization: "{{ scw_org }}"
|
||
|
register: server_creation_check_task
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- server_creation_check_task is success
|
||
|
- server_creation_check_task is changed
|