Compare commits

..

2 Commits

Author SHA1 Message Date
Jesko 686c683a00 user löschen 2024-05-08 17:32:18 +02:00
Jesko 07f81c7cd6 user bereinigen 2024-05-08 17:27:16 +02:00
3 changed files with 23 additions and 3 deletions

View File

@ -2,6 +2,7 @@
- name: ensure safe environment for exams - name: ensure safe environment for exams
hosts: localhost hosts: localhost
vars: vars:
pruefungsanzeigename: "Abschlussprüfung 2024"
pruefungsuser: "pruefling" pruefungsuser: "pruefling"
pruefungsgruppe: "prueflinge" pruefungsgruppe: "prueflinge"
pruefungspasswort: "pruefung" pruefungspasswort: "pruefung"
@ -14,6 +15,7 @@
name: Europe/Berlin name: Europe/Berlin
roles: roles:
- role: aptupgrade # upgrade des Systems
- role: pruefungsuser # anlegen des Users (config in vars) - role: pruefungsuser # anlegen des Users (config in vars)
- role: libreoffice # libreoffice installieren und verlinken - role: libreoffice # libreoffice installieren und verlinken
- role: ufw # firewall konfigurieren - role: ufw # firewall konfigurieren

View File

@ -0,0 +1,7 @@
- name: upgrade
apt:
upgrade: full
update_cache: yes
cache_valid_time: 43200
autoremove: yes
autoclean: yes

View File

@ -3,12 +3,12 @@
name: "{{ pruefungsgruppe }}" name: "{{ pruefungsgruppe }}"
state: present state: present
- name: create user student - name: create pruefungsuser
ansible.builtin.user: ansible.builtin.user:
name: "{{ pruefungsuser }}" name: "{{ pruefungsuser }}"
password: "{{ pruefungspasswort | password_hash('sha512') }}" password: "{{ pruefungspasswort | password_hash('sha512') }}"
shell: /bin/bash shell: /bin/bash
comment: Prüfungsbenutzer comment: "{{ pruefungsanzeigename }}"
group: "{{ pruefungsgruppe }}" group: "{{ pruefungsgruppe }}"
- name: create .config dir for created user - name: create .config dir for created user
@ -21,3 +21,14 @@
loop: loop:
- "/home/{{ pruefungsuser }}/.config/" - "/home/{{ pruefungsuser }}/.config/"
- "/home/{{ pruefungsuser }}/Schreibtisch/" - "/home/{{ pruefungsuser }}/Schreibtisch/"
- name: Remove user
user:
name: "{{ item }}"
state: absent
remove: yes
loop:
- pruefung
- pruefling