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

37 lines
764 B
YAML
Raw Normal View History

2024-05-08 16:29:07 +02:00
- name: create user group
group:
name: "{{ pruefungsgruppe }}"
state: present
2024-05-08 17:27:16 +02:00
- name: create pruefungsuser
2024-05-08 16:29:07 +02:00
ansible.builtin.user:
name: "{{ pruefungsuser }}"
password: "{{ pruefungspasswort | password_hash('sha512') }}"
shell: /bin/bash
2024-05-08 17:32:18 +02:00
comment: "{{ pruefungsanzeigename }}"
2024-05-08 16:29:07 +02:00
group: "{{ pruefungsgruppe }}"
- name: create .config dir for created user
file:
2024-05-08 16:35:17 +02:00
path: "{{ item }}"
2024-05-08 16:29:07 +02:00
state: directory
mode: "700"
owner: "{{ pruefungsuser }}"
2024-05-08 16:35:17 +02:00
group: "{{ pruefungsgruppe }}"
2024-05-08 17:15:55 +02:00
loop:
2024-05-08 16:35:17 +02:00
- "/home/{{ pruefungsuser }}/.config/"
2024-05-08 17:27:16 +02:00
- "/home/{{ pruefungsuser }}/Schreibtisch/"
- name: Remove user
user:
name: "{{ item }}"
state: absent
remove: yes
loop:
2024-05-08 17:32:18 +02:00
- pruefung
- pruefling
2024-05-08 17:37:02 +02:00
when: false
2024-05-08 17:27:16 +02:00