Skip to content

Commit

Permalink
adding backup user to fileserver
Browse files Browse the repository at this point in the history
  • Loading branch information
thetillhoff committed Sep 19, 2024
1 parent 899d87e commit a1b7086
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ansible/roles/fileserver-blackhole/files/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ services:
restart: always
ports:
- "445:445"
environment:
- BACKUP_PASSWORD={{ BACKUP_PASSWORD }}
volumes:
- ./smb.conf:/etc/samba/smb.conf:ro
# mount data volumes into /mnt/<sharename>
- /mnt/NVME/public:/mnt/public:rw
- /mnt/NVME/user:/mnt/user:rw
- /mnt/cold/public:/mnt/public:rw
- /mnt/cold/backup:/mnt/backup:rw
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$ANSIBLE_VAULT;1.1;AES256
38623263373562616137333634363863643037656235313836356239613136623364393166303835
3833323637363832386334346632353133613634373231650a386565643834376131616364613662
36623632336632316264396337643962336331616563386133393062326639373831336332356263
6261636632656336360a363539393630313464666534313030363236343336303931393763663734
31653564636239356233333633343538383764333838383537633563623634383563
4 changes: 2 additions & 2 deletions ansible/roles/fileserver-blackhole/files/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# loop over users and passwords to create them in the container and samba - make sure uid and gid are settable from config
# Loop over shares, each with their own config

useradd user
(echo abc; echo abc) | smbpasswd -a user
useradd backup
(echo $BACKUP_PASSWORD; echo $BACKUP_PASSWORD) | smbpasswd -a backup

# /mnt is empty by default, and every share should be mounted into it
chmod 0777 /mnt -R
Expand Down
7 changes: 7 additions & 0 deletions ansible/roles/fileserver-blackhole/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@
mode: '0777'
recurse: yes

# create backup folder and set permissions on it
- file:
path: "/mnt/cold/backup"
state: directory
mode: '0777'
recurse: yes

# Start samba container
- community.docker.docker_compose_v2:
project_src: "{{ role_path }}/files/"
Expand Down

0 comments on commit a1b7086

Please sign in to comment.