From: Ullli Date: Fri, 24 Apr 2026 15:04:58 +0000 (+0200) Subject: Vorbereitung Home-Verzeichnisse ueber LAN X-Git-Url: https://freie-schul-it.de/gitweb/fsit_smgt.git/commitdiff_plain/1a5cd01e168e0cbc430d8576c61bffdbad620298?ds=sidebyside;hp=6e223ac0e2f4e169b70aac77fa3d7d0a8c3c9501 Vorbereitung Home-Verzeichnisse ueber LAN --- 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 %}