exam-laptop/roles/pruefungsuser/tasks/main.yml

37 lines
764 B
YAML

- name: create user group
group:
name: "{{ pruefungsgruppe }}"
state: present
- name: create pruefungsuser
ansible.builtin.user:
name: "{{ pruefungsuser }}"
password: "{{ pruefungspasswort | password_hash('sha512') }}"
shell: /bin/bash
comment: "{{ pruefungsanzeigename }}"
group: "{{ pruefungsgruppe }}"
- name: create .config dir for created user
file:
path: "{{ item }}"
state: directory
mode: "700"
owner: "{{ pruefungsuser }}"
group: "{{ pruefungsgruppe }}"
loop:
- "/home/{{ pruefungsuser }}/.config/"
- "/home/{{ pruefungsuser }}/Schreibtisch/"
- name: Remove user
user:
name: "{{ item }}"
state: absent
remove: yes
loop:
- pruefung
- pruefling
when: false