]> freie-schul-it.de Git - fsit_smgt.git/commitdiff
Vorbereitung Home-Verzeichnisse ueber LAN
authorUllli <ullli@freie-schul-it.de>
Fri, 24 Apr 2026 15:04:58 +0000 (17:04 +0200)
committerUllli <ullli@freie-schul-it.de>
Fri, 24 Apr 2026 15:04:58 +0000 (17:04 +0200)
defaults/main.yml
handlers/main.yml [new file with mode: 0644]
tasks/accountmgt.yml [new file with mode: 0644]
tasks/samba.yml [new file with mode: 0644]
templates/samba_smb.conf.j2 [new file with mode: 0644]

index a5d875567b55d9ed3cd4d335d13ad39beffe8c3d..0ac2e2fc5371c2ba872bc148e6f0d80ccb4d8878 100644 (file)
@@ -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 (file)
index 0000000..fa065ad
--- /dev/null
@@ -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 (file)
index 0000000..eee3207
--- /dev/null
@@ -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 (file)
index 0000000..e349d8f
--- /dev/null
@@ -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 (file)
index 0000000..00c4914
--- /dev/null
@@ -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 %}