From 12884074ba1844501f307a6b8a95a1fb48d15128 Mon Sep 17 00:00:00 2001 From: mg Date: Mon, 20 Dec 2021 12:48:50 +0100 Subject: [PATCH] VM SMB-Freigabe jetzt auf hdd_data_raidz anstatt rpool (#285) Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/285 Co-authored-by: mg Co-committed-by: mg --- group_vars/fileserver.yml | 76 ++----------------- host_vars/fileserver2-test.grote.lan.yml | 23 ++++++ host_vars/fileserver2.grote.lan.yml | 63 +++++++++++++++ host_vars/pve2.grote.lan.yml | 33 ++++---- roles/mgrote.proxmox_bind_mounts/tasks/bm.yml | 5 +- 5 files changed, 112 insertions(+), 88 deletions(-) create mode 100644 host_vars/fileserver2-test.grote.lan.yml create mode 100644 host_vars/fileserver2.grote.lan.yml diff --git a/group_vars/fileserver.yml b/group_vars/fileserver.yml index 960b3c53..b72356af 100644 --- a/group_vars/fileserver.yml +++ b/group_vars/fileserver.yml @@ -42,7 +42,12 @@ group root env.smbstatus /usr/bin/smbstatus env.ignoreipcshare 1 - ### mgrote.smb_fileserver + ### mgrote.fileserver_smb + smb_workgroup: WORKGROUP + smb_min_protocol: "SMB2" + smb_client_min_protocol: "SMB2" + smb_client_max_protocol: "SMB3_11" + smb_enable_snapshots_dir: true smb_users: - name: 'annemariedroessler2' password: "{{ lookup('keepass', 'fileserver_smb_user_amd', 'password') }}" @@ -64,72 +69,3 @@ password: "{{ lookup('keepass', 'fileserver_smb_user_brother_ads2700w', 'password') }}" - name: 'photoprism' password: "{{ lookup('keepass', 'fileserver_smb_user_photoprism', 'password') }}" - - smb_shares: - - name: 'videos' - path: '/shares_videos' - users_ro: 'kodi' - users_rw: 'annemariedroessler2 michaelgrote win10' - - name: 'scans' - path: '/shares_scans' - users_ro: 'annemariedroessler2 michaelgrote' - users_rw: 'brother_ads2700w' - - name: 'papa_backup' - path: '/shares_papa_backup' - users_ro: 'michaelgrote' - users_rw: 'win10' - - name: 'amd' - path: '/shares_amd' - users_ro: 'michaelgrote win10' - users_rw: 'annemariedroessler2 win10' - - name: 'backup' - path: '/shares_backup' - users_ro: 'annemariedroessler2' - users_rw: 'win10 michaelgrote' - - name: 'archiv' - path: '/shares_archiv' - users_ro: '' - users_rw: 'michaelgrote win10' - - name: 'hm' - path: '/shares_hm' - users_ro: '' - users_rw: 'michaelgrote win10' - - name: 'musik' - path: '/shares_music' - users_ro: 'navidrome kodi annemariedroessler2 ' - users_rw: 'win10 michaelgrote' - - name: 'tmp' - path: '/shares_tmp' - users_ro: 'win10' - users_rw: 'kodi annemariedroessler2 win10 michaelgrote' - - name: 'bilder' - path: '/shares_bilder' - users_ro: 'photoprism' - users_rw: 'annemariedroessler2 michaelgrote win10' - - name: 'proxmox' - path: '/shares_pve_backup' - users_ro: 'michaelgrote' - users_rw: 'pve win10' - - name: 'restic' - path: '/shares_restic' - users_ro: '' - users_rw: 'annemariedroessler2 restic win10 michaelgrote' - - name: 'vm' - path: '/shares_vm' - users_ro: '' - users_rw: 'michaelgrote' - - name: 'buecher' - path: '/shares_buecher' - users_ro: 'annemariedroessler2' - users_rw: 'michaelgrote win10' - - name: 'programme' - path: '/shares_programme' - users_ro: 'annemariedroessler2' - users_rw: 'michaelgrote win10' - - - smb_workgroup: WORKGROUP - smb_min_protocol: "SMB2" - smb_client_min_protocol: "SMB2" - smb_client_max_protocol: "SMB3_11" - smb_enable_snapshots_dir: true diff --git a/host_vars/fileserver2-test.grote.lan.yml b/host_vars/fileserver2-test.grote.lan.yml new file mode 100644 index 00000000..0eabc91d --- /dev/null +++ b/host_vars/fileserver2-test.grote.lan.yml @@ -0,0 +1,23 @@ +--- + ### mgrote.smb_fileserver + smb_shares: + - name: 'videos' + path: '/shares_videos' + users_ro: 'kodi' + users_rw: 'annemariedroessler2 michaelgrote win10' + - name: 'bilder' + path: '/shares_bilder' + users_ro: 'photoprism' + users_rw: 'annemariedroessler2 michaelgrote win10' + - name: 'proxmox' + path: '/shares_pve_backup' + users_ro: 'michaelgrote' + users_rw: 'pve win10' + - name: 'restic' + path: '/shares_restic' + users_ro: '' + users_rw: 'annemariedroessler2 restic win10 michaelgrote' + - name: 'vm' + path: '/shares_vm' + users_ro: '' + users_rw: 'michaelgrote' diff --git a/host_vars/fileserver2.grote.lan.yml b/host_vars/fileserver2.grote.lan.yml new file mode 100644 index 00000000..6383061d --- /dev/null +++ b/host_vars/fileserver2.grote.lan.yml @@ -0,0 +1,63 @@ +--- + ### mgrote.smb_fileserver + smb_shares: + - name: 'videos' + path: '/shares_videos' + users_ro: 'kodi' + users_rw: 'annemariedroessler2 michaelgrote win10' + - name: 'scans' + path: '/shares_scans' + users_ro: 'annemariedroessler2 michaelgrote' + users_rw: 'brother_ads2700w' + - name: 'papa_backup' + path: '/shares_papa_backup' + users_ro: 'michaelgrote' + users_rw: 'win10' + - name: 'amd' + path: '/shares_amd' + users_ro: 'michaelgrote win10' + users_rw: 'annemariedroessler2 win10' + - name: 'backup' + path: '/shares_backup' + users_ro: 'annemariedroessler2' + users_rw: 'win10 michaelgrote' + - name: 'archiv' + path: '/shares_archiv' + users_ro: '' + users_rw: 'michaelgrote win10' + - name: 'hm' + path: '/shares_hm' + users_ro: '' + users_rw: 'michaelgrote win10' + - name: 'musik' + path: '/shares_music' + users_ro: 'navidrome kodi annemariedroessler2 ' + users_rw: 'win10 michaelgrote' + - name: 'tmp' + path: '/shares_tmp' + users_ro: 'win10' + users_rw: 'kodi annemariedroessler2 win10 michaelgrote' + - name: 'bilder' + path: '/shares_bilder' + users_ro: 'photoprism' + users_rw: 'annemariedroessler2 michaelgrote win10' + - name: 'proxmox' + path: '/shares_pve_backup' + users_ro: 'michaelgrote' + users_rw: 'pve win10' + - name: 'restic' + path: '/shares_restic' + users_ro: '' + users_rw: 'annemariedroessler2 restic win10 michaelgrote' + - name: 'buecher' + path: '/shares_buecher' + users_ro: 'annemariedroessler2' + users_rw: 'michaelgrote win10' + - name: 'programme' + path: '/shares_programme' + users_ro: 'annemariedroessler2' + users_rw: 'michaelgrote win10' + - name: 'vm' + path: '/shares_vm' + users_ro: '' + users_rw: 'michaelgrote' diff --git a/host_vars/pve2.grote.lan.yml b/host_vars/pve2.grote.lan.yml index 7f449453..a9906d9d 100644 --- a/host_vars/pve2.grote.lan.yml +++ b/host_vars/pve2.grote.lan.yml @@ -28,14 +28,6 @@ dnodesize: auto atime: on snapdir: hidden - - dataset: rpool/ssd_share - state: present - compression: zstd - sync: disabled - xattr: sa - dnodesize: auto - atime: on - snapdir: hidden - dataset: rpool/vm/dir state: present compression: zstd @@ -174,6 +166,14 @@ dnodesize: auto atime: on snapdir: hidden + - dataset: hdd_data_raidz/vm + state: present + compression: zstd + sync: disabled + xattr: sa + dnodesize: auto + atime: on + snapdir: hidden zfs_extra_arc_max_size: "8589934592" # 8GB in Bytes zfs_extra_zfs_pools: - name: "rpool" @@ -239,10 +239,6 @@ recursive: 'no' snapshots: true template: '3tage' - - path: rpool/ssd_share - recursive: 'no' - snapshots: true - template: '3tage' - path: hdd_data_raidz/programme recursive: 'no' snapshots: true @@ -251,6 +247,11 @@ recursive: 'no' snapshots: true template: '14tage' + - path: hdd_data_raidz/vm + recursive: 'no' + snapshots: true + template: '3tage' + sanoid_templates: - name: '31tage' @@ -351,10 +352,6 @@ mp_nr: 12 mp_path_host: /hdd_data_raidz/backup mp_path_guest: /shares_backup - - vmid: 127 - mp_nr: 13 - mp_path_host: /rpool/ssd_share - mp_path_guest: /shares_vm - vmid: 127 mp_nr: 14 mp_path_host: /hdd_data_raidz/buecher @@ -363,3 +360,7 @@ mp_nr: 15 mp_path_host: /hdd_data_raidz/programme mp_path_guest: /shares_programme + - vmid: 127 + mp_nr: 16 + mp_path_host: /hdd_data_raidz/vm + mp_path_guest: /shares_vm diff --git a/roles/mgrote.proxmox_bind_mounts/tasks/bm.yml b/roles/mgrote.proxmox_bind_mounts/tasks/bm.yml index c4cd454d..8fb403bb 100644 --- a/roles/mgrote.proxmox_bind_mounts/tasks/bm.yml +++ b/roles/mgrote.proxmox_bind_mounts/tasks/bm.yml @@ -15,12 +15,13 @@ - name: add bind mounts to container become: true command: "pct set {{ item.vmid }} -mp{{ item.mp_nr }} {{ item.mp_path_host }},mp={{ item.mp_path_guest }}" - when: not config.rc == 0 register: restart notify: restart lxc # füge bind-mount hinzu falls er fehlt, also rc ungleich 0 # pro bind-mount - when: not ansible_check_mode + when: + - not ansible_check_mode + - not config.rc == 0 # überspringe wenn in check-mode # schreibe vm id in die Liste "reboot"