From 12390494cf9e9a6f77e8ed90eb8328c3925c4d0a Mon Sep 17 00:00:00 2001 From: "Matthew X. Economou" Date: Sat, 9 Jul 2016 08:29:33 -0400 Subject: [PATCH 1/2] Add support for s3fs --- salt/files/master.d/f_defaults.conf | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/salt/files/master.d/f_defaults.conf b/salt/files/master.d/f_defaults.conf index 3965fa8..56aaeb5 100644 --- a/salt/files/master.d/f_defaults.conf +++ b/salt/files/master.d/f_defaults.conf @@ -859,6 +859,51 @@ gitfs_env_blacklist: # - feature/* {% endif %} +# S3 File Server Backend Configuration +# +# S3 credentials must be set in the master config file. +# Alternatively, if on EC2 these credentials can be automatically +# loaded from instance metadata. +{% if 's3.keyid' in cfg_master -%} +{{ get_config('s3.keyid', '') }} +{{ get_config('s3.key', '') }} +{% else -%} +# s3.keyid: GKTADJGHEIQSXMKKRBJ08H +# s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs +{% endif %} +# This fileserver supports two modes of operation for the buckets: +# - A single bucket per environment +# - Multiple environments per bucket +# +# Note that bucket names must be all lowercase both in the AWS console +# and in Salt, otherwise you may encounter SignatureDoesNotMatch +# errors. +# +# A multiple-environment bucket must adhere to the following root +# directory structure: +# +# s3://// +# +# This fileserver back-end requires the use of the MD5 hashing +# algorithm. MD5 may not be compliant with all security policies. +{% if 's3.buckets' in cfg_master -%} +{{ get_config('s3.buckets', '') }} +{% else -%} +# s3.buckets: #single bucket per environment +# production: +# - bucket1 +# - bucket2 +# staging: +# - bucket3 +# - bucket4 +# +# s3.buckets: #multiple environments per bucket +# - bucket1 +# - bucket2 +# - bucket3 +# - bucket4 +{% endif %} + ##### Pillar settings ##### ########################################## # Salt Pillars allow for the building of global data that can be made selectively From d7be9aba9f98a34a8acd4894a4b02a32c8813d46 Mon Sep 17 00:00:00 2001 From: "Matthew X. Economou" Date: Sat, 9 Jul 2016 21:23:49 -0400 Subject: [PATCH 2/2] Document sample s3fs configuration --- pillar.example | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pillar.example b/pillar.example index 832f939..6d3058d 100644 --- a/pillar.example +++ b/pillar.example @@ -20,10 +20,18 @@ salt: master: fileserver_backend: - git + - s3fs - roots gitfs_remotes: - git://github.com/saltstack-formulas/salt-formula.git: - base: develop + s3.keyid: GKTADJGHEIQSXMKKRBJ08H + s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs + s3.buckets: + - bucket1 + - bucket2 + - bucket3 + - bucket4 file_roots: base: - /srv/salt