salt icon indicating copy to clipboard operation
salt copied to clipboard

support for Amazon s3:// URL in salt.fileclient

Open bclermont opened this issue 13 years ago • 12 comments

Now that botocore is a dependency else, it can be used to add Amazon S3 support.

OR

instead of using URL to detect the protocol, just add a new argument and give the ability to have pluggable file downloader.

/etc/somewhere:
  - file.managed:
    - source: /path/in/my/bucket/file
    - type: s3
    - s3_auth: xxx
    - s3_key: yyy

and I get drop a s3.py in my _sources/ folder.

bclermont avatar Feb 27 '13 11:02 bclermont

@bclermont just to clarify, I don't think salt depends on botocore. Could be wrong though since I've been focusing my attention on other projects from SaltStack. salt-cloud does and it's not a hard dependency, it can work perfectly without it.

Cool idea though :smile:

s0undt3ch avatar Feb 27 '13 12:02 s0undt3ch

I know that it's not salt that depends on botocore :laughing: but it's available and can be used if there is "pluggable" data source module.

and while at it, make a hard dependency from one of botocore dependency: requests. and use that instead of the httplib that come with python stdlib :smiling_imp:

bclermont avatar Feb 27 '13 12:02 bclermont

Salt tries to narrow down it's dependencies. bototcore brings lot's of dependencies :smile:

Anyway, if it's plugable, botocore would become an optional dependency.

s0undt3ch avatar Feb 27 '13 13:02 s0undt3ch

botocore requires us to build and maintain a couple dozen packages for other software authors just so we can install it on ubuntu. That experiment has failed. You are far better off installing your own botocore yourself, I assure you.

ghost avatar Feb 27 '13 15:02 ghost

This is a fantastic idea! I can think of several other future additions that would be able to take advantage of this as well.

We're going to try to get this in the 0.14.0 release, although it might be a stretch. If not it will definitely be in the following release.

UtahDave avatar Feb 27 '13 17:02 UtahDave

amazing idea!

inthecloud247 avatar Feb 27 '13 21:02 inthecloud247

@UtahDave When I abstracted out fileclient stuff a while back to bring template support to cron states, I created a module execution function called config.valid_fileproto which will inspect the file URI and tell you if the protocol designation is one of the supported ones. This function is called from many places but I figured I'd mention this function here for whoever ends up implementing this, in the hope that it may save them the time going down the rabbit hole of function calls to see how this works.

terminalmage avatar Feb 28 '13 18:02 terminalmage

Thanks for the heads up, @archtaku! I am working on this as we speak.

techhat avatar Feb 28 '13 18:02 techhat

We now have an execution module in develop branch for S3:

https://github.com/saltstack/salt/blob/develop/salt/modules/s3.py

Just need to tie it into salt.fileclient and we'll be good to go.

techhat avatar Mar 04 '13 19:03 techhat

I would add service_url config options so other users for s3-like api could benefit (walrus, eucalyptus)

elyast avatar Jul 05 '13 20:07 elyast

@techhat - did this get implemented fully and can we close this issue or do we need to keep it open to further track an unfinished task?

ssgward avatar Aug 11 '15 20:08 ssgward

This is done.

cachedout avatar Aug 11 '15 20:08 cachedout