# How can I get gs\_secret\_key and gs\_access\_key to use gc\_storage module in Ansible?

**URL:** <https://forum.ansible.com/t/how-can-i-get-gs-secret-key-and-gs-access-key-to-use-gc-storage-module-in-ansible/28758>\
**Category:** Ansible Project\
**Created:** [October 10, 2018, 5:39pm UTC](https://forum.ansible.com/t/how-can-i-get-gs-secret-key-and-gs-access-key-to-use-gc-storage-module-in-ansible/28758 "2018-10-10T17:39:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Augusto\_M](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Augusto\_M](https://forum.ansible.com/u/Augusto_M)\
**Post date:** [October 10, 2018, 5:39pm UTC](https://forum.ansible.com/t/how-can-i-get-gs-secret-key-and-gs-access-key-to-use-gc-storage-module-in-ansible/28758/1 "2018-10-10T17:39:14Z")

</div>

I would 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.

`

```auto
- 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: "012345678901-compute@developer.gserviceaccount.com"
    gs_secret_key: "-----BEGIN PRIVATE KEY-----\nMIIblashblah...blahblahmow=\n-----END PRIVATE KEY-----\n"
    gs_access_key: "e6ablahblah...blahblahfc0"

```

`

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\n`SignatureDoesNotMatch`The 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!

---

<div class="post-metadata">

**Author:** ![Sushena\_Parthasarath](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@Sushena\_Parthasarath](https://forum.ansible.com/u/Sushena_Parthasarath)\
**Post date:** [May 15, 2019, 10:55am UTC](https://forum.ansible.com/t/how-can-i-get-gs-secret-key-and-gs-access-key-to-use-gc-storage-module-in-ansible/28758/2 "2019-05-15T10:55:15Z")

</div>

Hi,  
Issue got fixed ? am getting below error

he full traceback is:  
Traceback (most recent call last):  
File “/home/ansible/.ansible/tmp/ansible-tmp-1557917701.18-170733216464166/AnsiballZ\_gc\_storage.py”, line 113, in   
\_ansiballz\_main()  
File “/home/ansible/.ansible/tmp/ansible-tmp-1557917701.18-170733216464166/AnsiballZ\_gc\_storage.py”, line 105, in \_ansiballz\_main  
invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)  
File “/home/ansible/.ansible/tmp/ansible-tmp-1557917701.18-170733216464166/AnsiballZ\_gc\_storage.py”, line 48, in invoke\_module  
imp.load\_module(‘ **main** ’, mod, module, MOD\_DESC)  
File “/tmp/ansible\_gc\_storage\_payload\_kwkWnD/ **main**.py”, line 491, in   
File “/tmp/ansible\_gc\_storage\_payload\_kwkWnD/ **main**.py”, line 461, in main  
File “/tmp/ansible\_gc\_storage\_payload\_kwkWnD/ **main**.py”, line 344, in handle\_put  
File “/tmp/ansible\_gc\_storage\_payload\_kwkWnD/ **main**.py”, line 186, in key\_check  
AttributeError: ‘NoneType’ object has no attribute ‘get\_key’

fatal: [localhost]: FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “Traceback (most recent call last):\n File "/home/ansible/.ansible/tmp/ansible-tmp-1557917701.18-170733216464166/AnsiballZ\_gc\_storage.py", line 113, in \n \_ansiballz\_main()\n File "/home/ansible/.ansible/tmp/ansible-tmp-1557917701.18-170733216464166/AnsiballZ\_gc\_storage.py", line 105, in \_ansiballz\_main\n invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)\n File "/home/ansible/.ansible/tmp/ansible-tmp-1557917701.18-170733216464166/AnsiballZ\_gc\_storage.py", line 48, in invoke\_module\n imp.load\_module(‘ **main** ’, mod, module, MOD\_DESC)\n File "/tmp/ansible\_gc\_storage\_payload\_kwkWnD/ **main**.py", line 491, in \n File "/tmp/ansible\_gc\_storage\_payload\_kwkWnD/ **main**.py", line 461, in main\n File "/tmp/ansible\_gc\_storage\_payload\_kwkWnD/ **main**.py", line 344, in handle\_put\n File "/tmp/ansible\_gc\_storage\_payload\_kwkWnD/ **main**.py", line 186, in key\_check\nAttributeError: ‘NoneType’ object has no attribute ‘get\_key’\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}
