2020-08-18 11:57:53 +02:00
|
|
|
- name: SAMBA installieren
|
|
|
|
become: yes
|
2021-01-02 10:30:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-18 11:57:53 +02:00
|
|
|
name:
|
|
|
|
- samba
|
|
|
|
- cifs-utils
|
|
|
|
- samba-common
|
|
|
|
- samba-common-bin
|
|
|
|
- samba-vfs-modules
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Erstelle Linux-Gruppen # vat /etc/group #kommt aus vars im playbook
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.group:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: "{{ item.groups }}"
|
|
|
|
state: present
|
|
|
|
loop: "{{ smb_nutzer }}"
|
|
|
|
no_log: True
|
|
|
|
|
|
|
|
- name: Erstelle Linux-Nutzer #kommt aus vars im playbook
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.user:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: "{{ item.name }}"
|
|
|
|
group: "{{ item.groups }}"
|
|
|
|
state: present
|
2020-08-29 10:38:14 +02:00
|
|
|
create_home: no
|
2020-08-18 11:57:53 +02:00
|
|
|
loop: "{{ smb_nutzer }}"
|
|
|
|
no_log: True
|
|
|
|
notify: set_samba_passwords
|
|
|
|
|
|
|
|
- name: Loesche alte Linux-Nutzer #kommt aus vars im playbook
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.user:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: "{{ item.name }}"
|
|
|
|
state: absent
|
|
|
|
loop: "{{ smb_nutzer_loeschen }}"
|
|
|
|
|
|
|
|
- name: Erstelle Freigabeordner
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.file:
|
2020-08-18 11:57:53 +02:00
|
|
|
path: "{{ item.ordnerpfad }}"
|
|
|
|
state: directory
|
|
|
|
mode: 0777
|
|
|
|
loop: "{{ smb_freigaben }}"
|
|
|
|
|
|
|
|
- name: "Konfiguriere Freigaben"
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
src: smb.conf.j2
|
|
|
|
dest: /etc/samba/smb.conf
|
|
|
|
validate: 'testparm -s %s'
|
|
|
|
with_items:
|
|
|
|
- "{{ smb_freigaben }}"
|
|
|
|
notify: smbd neustarten
|
|
|
|
no_log: True
|