gc_storage – This module manages objects/buckets in Google Cloud Storage¶
Synopsis¶
This module allows users to manage their objects/buckets in Google Cloud Storage. It allows upload and download operations and can set some canned permissions. It also allows retrieval of URLs for objects for use in playbooks, and retrieval of string contents of objects. This module requires setting the default project in GCS prior to playbook usage. See https://developers.google.com/storage/docs/reference/v1/apiversion1 for information about setting the default project.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
boto >= 2.9
Parameters¶
Examples¶
- name: Upload some content
gc_storage:
bucket: mybucket
object: key.txt
src: /usr/local/myfile.txt
mode: put
permission: public-read
- name: Upload some headers
gc_storage:
bucket: mybucket
object: key.txt
src: /usr/local/myfile.txt
headers: '{"Content-Encoding": "gzip"}'
- name: Download some content
gc_storage:
bucket: mybucket
object: key.txt
dest: /usr/local/myfile.txt
mode: get
- name: Download an object as a string to use else where in your playbook
gc_storage:
bucket: mybucket
object: key.txt
mode: get_str
- name: Create an empty bucket
gc_storage:
bucket: mybucket
mode: create
- name: Create a bucket with key as directory
gc_storage:
bucket: mybucket
object: /my/directory/path
mode: create
- name: Delete a bucket and all contents
gc_storage:
bucket: mybucket
mode: delete
- name: Create a bucket with versioning enabled
gc_storage:
bucket: "mybucket"
versioning: yes
mode: create
- name: Create a bucket located in the eu
gc_storage:
bucket: "mybucket"
region: "europe-west3"
mode: create
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Benno Joy (@bennojoy)
Lukas Beumer (@Nitaco)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.