improve share binding
This commit is contained in:
parent
1b79fe4cb0
commit
012c448c73
@ -2,19 +2,34 @@ NAS_nomad_folder:
|
|||||||
- name: openldap
|
- name: openldap
|
||||||
owner: 1001
|
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_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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,7 @@ nfs_exports:
|
|||||||
- "{{ nas_bind_target }}/nomad {{nfs_cluster_list}}"
|
- "{{ nas_bind_target }}/nomad {{nfs_cluster_list}}"
|
||||||
- "{{ nas_bind_target }}/download {{nfs_cluster_list}}"
|
- "{{ nas_bind_target }}/download {{nfs_cluster_list}}"
|
||||||
- "{{ nas_bind_target }}/music {{nfs_cluster_list}}"
|
- "{{ nas_bind_target }}/music {{nfs_cluster_list}}"
|
||||||
- "{{ nas_bind_target }}/film {{nfs_cluster_list}}"
|
- "{{ nas_bind_target }}/media {{nfs_cluster_list}}"
|
||||||
- "{{ nas_bind_target }}/serie {{nfs_cluster_list}}"
|
|
||||||
- "{{ nas_bind_target }}/photo {{nfs_cluster_list}}"
|
- "{{ nas_bind_target }}/photo {{nfs_cluster_list}}"
|
||||||
- "{{ nas_bind_target }}/homes {{nfs_cluster_list}}"
|
- "{{ nas_bind_target }}/homes {{nfs_cluster_list}}"
|
||||||
- "{{ nas_bind_target }}/ebook {{nfs_cluster_list}}"
|
- "{{ nas_bind_target }}/ebook {{nfs_cluster_list}}"
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
samba_passdb_backend: tdbsam
|
samba_passdb_backend: tdbsam
|
||||||
samba_shares_root: /exports
|
samba_shares_root: /exports
|
||||||
samba_shares:
|
samba_shares:
|
||||||
- name: film
|
- name: media
|
||||||
comment: "film"
|
comment: "media"
|
||||||
write_list: "@NAS_film"
|
write_list: "@NAS_media"
|
||||||
browseable: true
|
browseable: true
|
||||||
- name: serie
|
|
||||||
comment: "serie"
|
|
||||||
write_list: "@NAS_serie"
|
|
||||||
browseable: true
|
|
||||||
|
|
||||||
- name: ebook
|
- name: ebook
|
||||||
comment: "ebook"
|
comment: "ebook"
|
||||||
write_list: "@NAS_ebook"
|
write_list: "@NAS_ebook"
|
||||||
|
@ -23,22 +23,14 @@ systemd_mounts:
|
|||||||
- " "
|
- " "
|
||||||
automount: "{{ env_automount }}"
|
automount: "{{ env_automount }}"
|
||||||
enabled: true
|
enabled: true
|
||||||
diskstation_serie:
|
diskstation_media:
|
||||||
share: "{{ nas_ip }}:{{ env_default_nfs_path }}/serie"
|
share: "{{ nas_ip }}:{{ env_default_nfs_path }}/media"
|
||||||
mount: /mnt/diskstation/serie
|
mount: /mnt/diskstation/serie
|
||||||
type: nfs
|
type: nfs
|
||||||
options:
|
options:
|
||||||
- " "
|
- " "
|
||||||
automount: "{{ env_automount }}"
|
automount: "{{ env_automount }}"
|
||||||
enabled: true
|
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:
|
diskstation_ebook:
|
||||||
share: "{{ nas_ip }}:{{ env_default_nfs_path }}/ebook"
|
share: "{{ nas_ip }}:{{ env_default_nfs_path }}/ebook"
|
||||||
|
@ -15,7 +15,6 @@ hosts_entries:
|
|||||||
name: diskstation.ducamps.eu
|
name: diskstation.ducamps.eu
|
||||||
|
|
||||||
env_default_nfs_path: ""
|
env_default_nfs_path: ""
|
||||||
env_media_nfs_path: "{{ env_default_nfs_path }}"
|
|
||||||
env_automount: true
|
env_automount: true
|
||||||
nas_ip: "nfs.service.consul"
|
nas_ip: "nfs.service.consul"
|
||||||
|
|
||||||
|
@ -6,29 +6,16 @@
|
|||||||
vars:
|
vars:
|
||||||
# certbot_force: true
|
# certbot_force: true
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Ensure base NFS directory exist
|
- name: include task NasBind
|
||||||
ansible.builtin.file:
|
ansible.builtin.include_tasks:
|
||||||
path: "{{ item }}"
|
file: tasks/NasBind.yml
|
||||||
state: directory
|
|
||||||
loop: "{{ nas_bind_source }}"
|
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
|
- name: create nomad folder
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ nas_bind_target }}/nomad/{{ item.name }}"
|
path: "{{ nas_bind_target }}/nomad/{{ item.name }}"
|
||||||
owner: "{{ item.owner }}"
|
owner: "{{ item.owner }}"
|
||||||
state: directory
|
state: directory
|
||||||
loop: "{{ NAS_nomad_folder }}"
|
loop: "{{ NAS_nomad_folder }}"
|
||||||
become: true
|
|
||||||
roles:
|
roles:
|
||||||
- role: ansible-role-nut
|
- role: ansible-role-nut
|
||||||
become: true
|
become: true
|
||||||
|
13
ansible/playbooks/tasks/NasBind.yml
Normal file
13
ansible/playbooks/tasks/NasBind.yml
Normal 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
|
@ -93,10 +93,8 @@ job "jellyfin" {
|
|||||||
volumes = [
|
volumes = [
|
||||||
"/mnt/diskstation/nomad/jellyfin/config:/config",
|
"/mnt/diskstation/nomad/jellyfin/config:/config",
|
||||||
"/mnt/diskstation/nomad/jellyfin/cache:/cache",
|
"/mnt/diskstation/nomad/jellyfin/cache:/cache",
|
||||||
"/mnt/diskstation/film:/film",
|
"/mnt/diskstation/media:/media",
|
||||||
"/mnt/diskstation/serie:/serie",
|
|
||||||
"/mnt/diskstation/music:/music",
|
"/mnt/diskstation/music:/music",
|
||||||
"/mnt/diskstation/download/:/download"
|
|
||||||
]
|
]
|
||||||
devices = [
|
devices = [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user