user anlegen in Rolle ausgelagert.

This commit is contained in:
Jesko 2024-05-08 16:29:07 +02:00
parent 068c3415a5
commit 083e0a5396
2 changed files with 25 additions and 22 deletions

View File

@ -3,13 +3,15 @@
hosts: localhost
vars:
- config_ufw: true
- pruefungsuser: "pruefung"
- pruefungsuser: "pruefling"
- pruefungsgruppe: "prueflinge"
- pruefungspasswort: "pruefung"
# to verify ufw configuration run:
# sudo ufw status verbose
roles:
- role: libreoffice
- role: pruefungsuser
tasks:
- name: Install ufw
@ -132,26 +134,7 @@
owner: root
mode: '700'
- name: create user group pruefung
group:
name: "pruefung"
state: present
- name: create user student
ansible.builtin.user:
name: "pruefung"
password: "{{ 'morz' | password_hash('sha512') }}"
shell: /bin/bash
comment: Prüfungsbenutzer
group: pruefung
- name: create .config dir for created user
file:
path: "/home/pruefung/.config/"
state: directory
mode: "700"
owner: "pruefung"
group: "pruefung"
- name: Set timezone to Europe/Vienna
timezone:

View File

@ -0,0 +1,20 @@
- name: create user group
group:
name: "{{ pruefungsgruppe }}"
state: present
- name: create user student
ansible.builtin.user:
name: "{{ pruefungsuser }}"
password: "{{ pruefungspasswort | password_hash('sha512') }}"
shell: /bin/bash
comment: Prüfungsbenutzer
group: "{{ pruefungsgruppe }}"
- name: create .config dir for created user
file:
path: "/home/{{ pruefungsuser }}/.config/"
state: directory
mode: "700"
owner: "{{ pruefungsuser }}"
group: "{{ pruefungsgruppe }}"