mirror of https://github.com/ansible/ansible.git
New module: GCP Storage Buckets (#37288)
parent
39bf7d3655
commit
58bf4ae611
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
|||||||
|
cloud/gcp
|
||||||
|
unsupported
|
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
# defaults file
|
||||||
|
resource_name: '{{resource_prefix}}'
|
@ -0,0 +1,88 @@
|
|||||||
|
---
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
|
||||||
|
#
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# This file is automatically generated by Magic Modules and manual
|
||||||
|
# changes will be clobbered when the file is regenerated.
|
||||||
|
#
|
||||||
|
# Please read more about how to change this file at
|
||||||
|
# https://www.github.com/GoogleCloudPlatform/magic-modules
|
||||||
|
#
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Pre-test setup
|
||||||
|
- name: delete a bucket
|
||||||
|
gcp_storage_bucket:
|
||||||
|
name: 'ansible-storage-module'
|
||||||
|
project: "{{ gcp_project }}"
|
||||||
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
scopes:
|
||||||
|
- https://www.googleapis.com/auth/devstorage.full_control
|
||||||
|
state: absent
|
||||||
|
#----------------------------------------------------------
|
||||||
|
- name: create a bucket
|
||||||
|
gcp_storage_bucket:
|
||||||
|
name: 'ansible-storage-module'
|
||||||
|
project: "{{ gcp_project }}"
|
||||||
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
scopes:
|
||||||
|
- https://www.googleapis.com/auth/devstorage.full_control
|
||||||
|
state: present
|
||||||
|
register: result
|
||||||
|
- name: assert changed is true
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.changed == true
|
||||||
|
- "result.kind == 'storage#bucket'"
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
- name: create a bucket that already exists
|
||||||
|
gcp_storage_bucket:
|
||||||
|
name: 'ansible-storage-module'
|
||||||
|
project: "{{ gcp_project }}"
|
||||||
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
scopes:
|
||||||
|
- https://www.googleapis.com/auth/devstorage.full_control
|
||||||
|
state: present
|
||||||
|
register: result
|
||||||
|
- name: assert changed is false
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.changed == false
|
||||||
|
- "result.kind == 'storage#bucket'"
|
||||||
|
#----------------------------------------------------------
|
||||||
|
- name: delete a bucket
|
||||||
|
gcp_storage_bucket:
|
||||||
|
name: 'ansible-storage-module'
|
||||||
|
project: "{{ gcp_project }}"
|
||||||
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
scopes:
|
||||||
|
- https://www.googleapis.com/auth/devstorage.full_control
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
- name: assert changed is true
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.changed == true
|
||||||
|
- result.has_key('kind') == False
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
- name: delete a bucket that does not exist
|
||||||
|
gcp_storage_bucket:
|
||||||
|
name: 'ansible-storage-module'
|
||||||
|
project: "{{ gcp_project }}"
|
||||||
|
auth_kind: "{{ gcp_cred_kind }}"
|
||||||
|
service_account_file: "{{ gcp_cred_file }}"
|
||||||
|
scopes:
|
||||||
|
- https://www.googleapis.com/auth/devstorage.full_control
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
- name: assert changed is false
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.changed == false
|
||||||
|
- result.has_key('kind') == False
|
Loading…
Reference in New Issue