mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Adds support for creating GCE persistent disks from images
This commit is contained in:
parent
1e76fe2569
commit
0b45b1256d
2 changed files with 50 additions and 1 deletions
|
@ -124,3 +124,40 @@
|
|||
- 'result.changed'
|
||||
- 'result.name == "{{ instance_name }}"'
|
||||
- 'result.state == "absent"'
|
||||
|
||||
# ============================================================
|
||||
- name: test image given (state=present)
|
||||
gce_pd:
|
||||
name: "{{ instance_name }}"
|
||||
image: debian-7
|
||||
service_account_email: "{{ service_account_email }}"
|
||||
pem_file: "{{ pem_file }}"
|
||||
project_id: "{{ project_id }}"
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- name: assert image given (state=present)
|
||||
assert:
|
||||
that:
|
||||
- 'result.changed'
|
||||
- 'result.name == "{{ instance_name }}"'
|
||||
- 'result.image == "debian-7"'
|
||||
- 'result.state == "present"'
|
||||
|
||||
# ============================================================
|
||||
- name: test image given (state=absent)
|
||||
gce_pd:
|
||||
name: "{{ instance_name }}"
|
||||
image: debian-7
|
||||
service_account_email: "{{ service_account_email }}"
|
||||
pem_file: "{{ pem_file }}"
|
||||
project_id: "{{ project_id }}"
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- name: assert image given (state=absent)
|
||||
assert:
|
||||
that:
|
||||
- 'result.changed'
|
||||
- 'result.name == "{{ instance_name }}"'
|
||||
- 'result.state == "absent"'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue