homeserver/roles/mgrote.fileserver_smb/tasks/main.yml
Quotengrote 15d783de86
FQCN eingeführt (#70)
* template --> ansible.builtin.template

* apt --> ansible.builtin.apt

* lineinfile --> ansible.builtin.lineinfile

* file --> ansible.builtin.file

* blockinfile --> ansible.builtin.blockinfile

* cron --> ansible.builtin.cron

* timezone --> ansible.builtin.timezone

* get_url --> ansible.builtin.get_url

* group --> ansible.builtin.group

* user --> ansible.builtin.user

* unarchive --> ansible.builtin.unarchive

* service --> ansible.builtin.service

* apache2_module --> ansible.builtin.apache2_module

* package --> ansible.builtin.apt

* template --> ansible.builtin.template 2
2020-11-21 19:41:19 +01:00

55 lines
1.3 KiB
YAML

- name: SAMBA installieren
become: yes
ansible.builtin.apt:
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
ansible.builtin.group:
name: "{{ item.groups }}"
state: present
loop: "{{ smb_nutzer }}"
no_log: True
- name: Erstelle Linux-Nutzer #kommt aus vars im playbook
become: yes
ansible.builtin.user:
name: "{{ item.name }}"
group: "{{ item.groups }}"
state: present
create_home: no
loop: "{{ smb_nutzer }}"
no_log: True
notify: set_samba_passwords
- name: Loesche alte Linux-Nutzer #kommt aus vars im playbook
become: yes
ansible.builtin.user:
name: "{{ item.name }}"
state: absent
loop: "{{ smb_nutzer_loeschen }}"
- name: Erstelle Freigabeordner
become: yes
ansible.builtin.file:
path: "{{ item.ordnerpfad }}"
state: directory
mode: 0777
loop: "{{ smb_freigaben }}"
- name: "Konfiguriere Freigaben"
become: yes
ansible.builtin.template:
src: smb.conf.j2
dest: /etc/samba/smb.conf
validate: 'testparm -s %s'
with_items:
- "{{ smb_freigaben }}"
notify: smbd neustarten
no_log: True