Ansible collections, google.cloud.gcp_storage_object, increase timeout

129 Views Asked by At

I am running a playbook that uses google.cloud.gcp_storage_object to upload a file to google cloud storage. Some times this module throws timeout exception. What I want, is to increase the timeout while calling this module but I couldn't figure out and understand why the module itself doesn't provide this parameter - unless I am missing something really obvious.

Now, first things first. the module documentation can be found here. I was expecting a little bit more from google to be honest. For instance, at least few more examples, but anyhow. As you can see it doesn't have any parameter for timeout.

I can see in the repo/../gcp_storage_object.py which is the source code for the module that is calling the blob.upload_from_file(file_obj). As expected, it doesn't specify the optional timeout parameter at all. And according Blob class documentation it supports the timeout parameter. (To my understanding this Class uses python requests, and python requests uses urllib3 to make the request.)

So, to recap these are my questions. Is my understanding right? Is it possible that they have developed the ansible module without giving the option to provide custom timeout? If no, what I am doing wrong and where should I specify the timeout? If yes, how I could handle it in a production environment? I do not think it is proper to modify the module bymyself, what I will do everytime there is a new version of this module? Is there any professional and elegant way?

I hope all the above make sense, I am a little bit tired and cloudy at the moment. Thank you in advance for your time! :)

0

There are 0 best solutions below