VM SMB-Freigabe jetzt auf hdd_data_raidz anstatt rpool (#285)
Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#285 Co-authored-by: mg <michael.grote@posteo.de> Co-committed-by: mg <michael.grote@posteo.de>
This commit is contained in:
parent
c8a79e890c
commit
12884074ba
5 changed files with 112 additions and 88 deletions
|
@ -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
|
||||
|
|
23
host_vars/fileserver2-test.grote.lan.yml
Normal file
23
host_vars/fileserver2-test.grote.lan.yml
Normal file
|
@ -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'
|
63
host_vars/fileserver2.grote.lan.yml
Normal file
63
host_vars/fileserver2.grote.lan.yml
Normal file
|
@ -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'
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue