-
Notifications
You must be signed in to change notification settings - Fork 1
/
backblaze_s3fs.sls
56 lines (53 loc) · 1.17 KB
/
backblaze_s3fs.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
s3fs_install:
pkg.installed:
- pkgs:
- libfuse-dev
- fuse
- build-essential
- libcurl4-openssl-dev
- libxml2-dev
- pkg-config
- libssl-dev
- automake
s3fs_git:
git.cloned:
- name: https://github.com/s3fs-fuse/s3fs-fuse
- target: /tmp/s3fs-fuse
install_s3fs:
cmd.run:
- name: |
cd /tmp/s3fs-fuse
./autogen.sh
./configure
make
make install
- cwd: /tmp
- shell: /bin/bash
- timeout: 300
# - require:
# - sls: s3fs_install
/usr/local/bin/s3fs:
file.symlink:
- target: /usr/bin
/etc/fstab:
file.append:
- source: salt://templates/p20_fstab.j2
- template: jinja
/etc/fuse.conf:
file.append:
- text: user_allow_other
/etc/passwd-s3fs_permissions:
file.managed:
- name: /etc/passwd-s3fs
# variables (contexts)
- context:
passwd_s3fs: {{ salt['pillar.get']('secrets:backblaze_secret') }}
- mode: 600
- user: root
- group: root
- replace: True
- template: jinja
- source: salt://templates/passwd-s3fs.cfg
#/etc/passwd-s3fs:
# file.append:
# - text: {{ salt['pillar.get']('secrets:backblaze_secret') }}