trixie/roles/fvs-mount/tasks/main.yml

50 lines
1.4 KiB
YAML
Raw Normal View History

---
- name: install needed packages
apt:
name:
- libpam-mount
- cifs-utils
- sshfs
state: latest
- name: configure pam_mount
blockinfile:
dest: /etc/security/pam_mount.conf.xml
block: |
2021-02-08 10:57:43 +01:00
<volume
fstype="fuse"
path="sshfs#%(USER)@{{ home_server }}:"
mountpoint="/home/%(USER)"
2021-07-05 10:53:05 +02:00
options="allow_other,default_permissions,reconnect,password_stdin"
2021-02-08 10:57:43 +01:00
ssh="0" noroot="0"
2022-06-02 11:01:56 +02:00
><not><or><user>root</user><user>ansible</user><user>Debian-gdm</user><user>virti</user></or></not></volume>
2021-02-08 10:57:43 +01:00
<volume
fstype="cifs"
server="{{ smb_server }}"
path="{{ smb_home }}"
mountpoint="/media/%(USER)/winhome"
options="dir_mode=0750,file_mode=0640"
2022-06-02 11:01:56 +02:00
><not><or><user>root</user><user>ansible</user><user>Debian-gdm</user><user>virti</user></or></not></volume>
2021-02-08 10:57:43 +01:00
<volume
fstype="cifs"
server="{{ smb_server }}"
path="{{ smb_share }}"
mountpoint="/media/%(USER)/winshare"
options="dir_mode=0750,file_mode=0640"
2022-06-02 11:01:56 +02:00
><not><or><user>root</user><user>ansible</user><user>Debian-gdm</user><user>virti</user></or></not></volume>
insertafter: "<!-- Volume definitions -->"
2020-12-18 08:52:25 +01:00
- name: make sure .ssh exists
file:
path: /root/.ssh
state: directory
mode: '0700'
- name: provide public key of home server
lineinfile:
path: /root/.ssh/known_hosts
line: "{{ ssh_hostkey }}"
create: yes