Skip to content

Commit

Permalink
Change photo archive permissions and mount options
Browse files Browse the repository at this point in the history
  • Loading branch information
kdkasad committed Dec 25, 2024
1 parent 9b1b253 commit ed65369
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions roles/photos_archive/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,36 @@
name: cifs-utils
state: present

- name: Create photos archive group
ansible.builtin.group:
name: photosarchive
state: present
system: no

- name: Add users to photos archive group
ansible.builtin.user:
name: "{{ item }}"
groups:
- photosarchive
append: yes
loop:
- "{{ users.worker }}"
- kian

- name: Render systemd unit files
ansible.builtin.template:
src: "{{ item }}"
dest: /etc/systemd/system/{{ item }}
owner: root
group: root
mode: 0600
mode: 0600 # not world-readable because they contain passwords

Check warning on line 29 in roles/photos_archive/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint code

29:16 [comments] too few spaces before comment
loop:
- mnt-photosarchive.mount
- mnt-photosarchive.automount
notify: Restart units

- name: Start and enable systemd automount unit
ansible.builtin.systemd:
daemon_reload: yes
name: mnt-photosarchive.automount
state: started
enabled: yes
2 changes: 1 addition & 1 deletion roles/photos_archive/templates/mnt-photosarchive.mount
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Wants=network-online.target
What=//SNEETCH/Pictures
Where=/mnt/photosarchive
Type=cifs
Options=ro,username={{ photos_archive_user }},password={{ photos_archive_password }},workgroup=WORKGROUP,uid={{ users.worker }},gid={{ users.worker }},iocharset=utf8,file_mode=0600,dir_mode=0700
Options=ro,username={{ photos_archive_user }},password={{ photos_archive_password }},workgroup=WORKGROUP,gid=photosarchive,forcegid,iocharset=utf8,file_mode=0440,dir_mode=0550,seal,nounix,noatime,nodev,noexec,nosuid

0 comments on commit ed65369

Please sign in to comment.