support for Amazon s3:// URL in salt.fileclient
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 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:
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:
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.
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.
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.
amazing idea!
@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.
Thanks for the heads up, @archtaku! I am working on this as we speak.
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.
I would add service_url config options so other users for s3-like api could benefit (walrus, eucalyptus)
@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?
This is done.