I need to create a directory in a Google Cloud Bucket using Ansible. I would like to know where I can find the values to complete "gs_secret_key" and "gs_access_key" to use "gc_storage" module in Ansible.

- name: Create a bucket with key as directory
  become: no
  gc_storage:
    bucket: "my-bucket-name"
    mode: "create"
    region: "US-EAST1"
    object: "/test_directory/"
    gs_access_key: "321012345678-compute@developer.gserviceaccount.com"
    gs_secret_key: "-----BEGIN PRIVATE KEY-----\nMIIblashblah...blahblahmow=\n-----END PRIVATE KEY-----\n"

I'm not sure about the values that I set in the Ansible script. With the current values I get an error message saying:

GSResponseError: 403 Forbidden\nSignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.PUT\n\n\nWed, 10 Oct 2018 16:26:00 GMT\n/my-bucket-name/

thank you!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.