File path for s3fs in standalone minions.

108 views
Skip to first unread message

ty...@ospreyinformatics.com

unread,
Mar 27, 2015, 2:24:46 PM3/27/15
to salt-...@googlegroups.com
Hi, 

We are attempting to use s3fs as a fileserver backend and I'm having issues finding the files with file.managed. 

Typically our states are tested in a standalone minion on a Vagrant machine before being pushed to our production saltmaster (development VMs are also created using standalone minions). 

In the minion config file I have added the following: 

fileserver_backend:
 
- s3fs #nothing is cached if s3 is used as is suggested by the documentation


s3
.keyid: <keyid>
s3
.key: <key>


s3
.buckets:
 
- <target_bucket>


The bucket has the following directory structure: 

<target_bucket>/base/<file>
<target_bucket>/dev/<file>

When I run a state the output on the minion indicates that s3 is being cached and I can see the files being downloaded (additionally, the files are in /var/cache/salt/minion/s3cache). However if we try to use file.manage with the s3 file as the source an error is returned saying the file can't be found. The state looks like:

/path/to/file:
  file
.managed:
   
- source: salt://<target_bucket>/<file>

I've tried adding the bucket to base or dev environments in the config file with no difference. 

Is the target path correct? Any guidance into how to further debug the issue would be appreciated. 

Cheers,
Tyler

Alan Garfield

unread,
Mar 29, 2015, 7:50:56 PM3/29/15
to salt-...@googlegroups.com
Hi,

Does the bucket dirs "base" and "dev" match the naming of the saltenvs you're using?

Also you don't need to use the "bucket" name in the file.managed. Salt just sees the files like they exist in the root, so the dir pattern for the file.managed's "root" is actually "<target_bucket>/<env>/".

For example in the "dev" saltenv:

s3://my_target_bucket/dev/pkgs/magic_file.txt

would then be:

file.managed:
  - source: salt://pkgs/magic_file.txt

Hope that helps.

-A.

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tyler Field

unread,
Mar 30, 2015, 1:30:33 PM3/30/15
to salt-...@googlegroups.com
Hi Alan, 

"base" and "dev" did match the environments we've defined. Using the paths you've suggested above its working. Thanks for the help. 

Cheers,
Tyler

--
You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/aEzC8V3rs_Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Tyler Field
Dev/Ops Specialist
--------------------------
This e-mail and any attachments may contain information that is confidential and/or privileged. If you are not the intended recipient and appear to have received this e-mail in error, please notify us immediately and then delete all copies from your computer system. Any unauthorized use, copying or further distribution is prohibited. Please also note that if you send us e-mails containing time-sensitive or important instructions, you should ensure that receipt has been timely acknowledged in view of the potential for misdirection or inadvertent interception. Thank you.
Reply all
Reply to author
Forward
0 new messages