improve share binding

This commit is contained in:
vincent 2024-02-29 21:36:35 +01:00
parent 1b79fe4cb0
commit 012c448c73
8 changed files with 49 additions and 51 deletions

View File

@ -2,19 +2,34 @@ NAS_nomad_folder:
- name: openldap
owner: 1001
nas_bind_source:
- /data/data1/nomad
- /data/data1/music
- /data/data1/download
- /data/data2/serie
- /data/data3/film
- /data/data1/photo
- /data/data1/homes
- /data/data1/ebook
nas_bind_target: "/exports"
nas_bind_source:
- dest: "{{ nas_bind_target }}/nomad"
source: /data/data1/nomad
- dest: "{{ nas_bind_target }}/music"
source: /data/data1/music
- dest: "{{ nas_bind_target }}/download"
source: /data/data1/download
- dest: "{{ nas_bind_target }}/media/serie"
source: /data/data2/serie
- dest: "{{ nas_bind_target }}/media/film"
source: /data/data3/film
- dest: "{{ nas_bind_target }}/photo"
source: /data/data1/photo
- dest: "{{ nas_bind_target }}/homes"
source: /data/data1/homes
- dest: "{{ nas_bind_target }}/ebook"
source: /data/data1/ebook
- dest: "{{ nas_bind_target }}/media/download/serie"
source: /data/data1/download/serie
- dest: "{{ nas_bind_target }}/media/download/film"
source: /data/data1/download/film
- dest: "{{ nas_bind_target }}/music/download/"
source: /data/data1/download/music

View File

@ -8,8 +8,7 @@ nfs_exports:
- "{{ nas_bind_target }}/nomad {{nfs_cluster_list}}"
- "{{ nas_bind_target }}/download {{nfs_cluster_list}}"
- "{{ nas_bind_target }}/music {{nfs_cluster_list}}"
- "{{ nas_bind_target }}/film {{nfs_cluster_list}}"
- "{{ nas_bind_target }}/serie {{nfs_cluster_list}}"
- "{{ nas_bind_target }}/media {{nfs_cluster_list}}"
- "{{ nas_bind_target }}/photo {{nfs_cluster_list}}"
- "{{ nas_bind_target }}/homes {{nfs_cluster_list}}"
- "{{ nas_bind_target }}/ebook {{nfs_cluster_list}}"

View File

@ -1,15 +1,10 @@
samba_passdb_backend: tdbsam
samba_shares_root: /exports
samba_shares:
- name: film
comment: "film"
write_list: "@NAS_film"
- name: media
comment: "media"
write_list: "@NAS_media"
browseable: true
- name: serie
comment: "serie"
write_list: "@NAS_serie"
browseable: true
- name: ebook
comment: "ebook"
write_list: "@NAS_ebook"

View File

@ -23,22 +23,14 @@ systemd_mounts:
- " "
automount: "{{ env_automount }}"
enabled: true
diskstation_serie:
share: "{{ nas_ip }}:{{ env_default_nfs_path }}/serie"
diskstation_media:
share: "{{ nas_ip }}:{{ env_default_nfs_path }}/media"
mount: /mnt/diskstation/serie
type: nfs
options:
- " "
automount: "{{ env_automount }}"
enabled: true
diskstation_film:
share: "{{ nas_ip }}:{{ env_default_nfs_path }}/film"
mount: /mnt/diskstation/film
type: nfs
options:
- " "
automount: "{{ env_automount }}"
enabled: true
diskstation_ebook:
share: "{{ nas_ip }}:{{ env_default_nfs_path }}/ebook"

View File

@ -15,7 +15,6 @@ hosts_entries:
name: diskstation.ducamps.eu
env_default_nfs_path: ""
env_media_nfs_path: "{{ env_default_nfs_path }}"
env_automount: true
nas_ip: "nfs.service.consul"

View File

@ -6,29 +6,16 @@
vars:
# certbot_force: true
pre_tasks:
- name: Ensure base NFS directory exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
- name: include task NasBind
ansible.builtin.include_tasks:
file: tasks/NasBind.yml
loop: "{{ nas_bind_source }}"
become: true
- name: Bind NAS export
ansible.posix.mount:
path: "{{ nas_bind_target }}/{{ item.split('/')[-1] }}"
src: "{{ item }}"
opts: bind
fstype: none
state: mounted
loop: "{{ nas_bind_source }}"
become: true
- name: create nomad folder
ansible.builtin.file:
path: "{{ nas_bind_target }}/nomad/{{ item.name }}"
owner: "{{ item.owner }}"
state: directory
loop: "{{ NAS_nomad_folder }}"
become: true
roles:
- role: ansible-role-nut
become: true

View File

@ -0,0 +1,13 @@
- name: Ensure base NFS directory exist
ansible.builtin.file:
path: "{{ item.dest }}"
state: directory
become: true
- name: Bind NAS export
ansible.posix.mount:
path: "{{ item.dest }}"
src: "{{ item.source }}"
opts: bind
fstype: none
state: mounted
become: true

View File

@ -93,10 +93,8 @@ job "jellyfin" {
volumes = [
"/mnt/diskstation/nomad/jellyfin/config:/config",
"/mnt/diskstation/nomad/jellyfin/cache:/cache",
"/mnt/diskstation/film:/film",
"/mnt/diskstation/serie:/serie",
"/mnt/diskstation/media:/media",
"/mnt/diskstation/music:/music",
"/mnt/diskstation/download/:/download"
]
devices = [
{