From 1a5cd01e168e0cbc430d8576c61bffdbad620298 Mon Sep 17 00:00:00 2001 From: Ullli Date: Fri, 24 Apr 2026 17:04:58 +0200 Subject: [PATCH] Vorbereitung Home-Verzeichnisse ueber LAN --- defaults/main.yml | 3 +++ handlers/main.yml | 8 ++++++++ tasks/accountmgt.yml | 6 ++++++ tasks/samba.yml | 21 +++++++++++++++++++++ templates/samba_smb.conf.j2 | 14 ++++++++++++++ 5 files changed, 52 insertions(+) create mode 100644 handlers/main.yml create mode 100644 tasks/accountmgt.yml create mode 100644 tasks/samba.yml create mode 100644 templates/samba_smb.conf.j2 diff --git a/defaults/main.yml b/defaults/main.yml index a5d8755..0ac2e2f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,3 +2,6 @@ fsit_smgt_aptproxy: fsit_smgt_inventory: fsit_smgt_samba_shares: [] +fsit_smgt_homes_ipaddr_lan: +fsit_smgt_homes_export_root: +fsit_smgt_homes_lan_homes: diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..fa065ad --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,8 @@ +- name: restart samba service + ansible.builtin.service: + name: samba + state: restarted +- name: restart nfs-kernel-server service + ansible.builtin.service: + name: nfs-kernel-server.service + state: restarted diff --git a/tasks/accountmgt.yml b/tasks/accountmgt.yml new file mode 100644 index 0000000..eee3207 --- /dev/null +++ b/tasks/accountmgt.yml @@ -0,0 +1,6 @@ +--- +- name: install server specific packages + ansible.builtin.apt: + update_cache: yes + pkg: + - ldap-account-manager diff --git a/tasks/samba.yml b/tasks/samba.yml new file mode 100644 index 0000000..e349d8f --- /dev/null +++ b/tasks/samba.yml @@ -0,0 +1,21 @@ +--- +- name: install server specific packages + ansible.builtin.apt: + pkg: + - samba +- name: create samba-directory + ansible.builtin.file: + path: /srv/samba + state: directory +- name: create directory {{ item.name }} + ansible.builtin.file: + path: "/srv/samba/{{ item.name }}" + state: directory + mode: 0777 + loop: fsit_smgt_samba_shares +- name: samba - copy config file + ansible.builtin.template: + src: samba_smb.conf.j2 + dest: /etc/samba/smb.conf + backup: yes + notify: restart samba service diff --git a/templates/samba_smb.conf.j2 b/templates/samba_smb.conf.j2 new file mode 100644 index 0000000..00c4914 --- /dev/null +++ b/templates/samba_smb.conf.j2 @@ -0,0 +1,14 @@ +[global] +workgroup = WORKGROUP +security = user +map to guest = Bad Password + +{% for item in fsit_smgt_samba_shares %} +[{{ item.name }}] +path = "/srv/samba/{{ item.name }}/ +public = yes +writable = yes +comment = "{{ item.comment }}" +printable = no +guest ok = "{{ item.guest_ok }} +{% endfor %} -- 2.39.5