user anlegen in Rolle ausgelagert.
This commit is contained in:
parent
068c3415a5
commit
083e0a5396
25
playbook.yml
25
playbook.yml
|
@ -3,13 +3,15 @@
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
vars:
|
vars:
|
||||||
- config_ufw: true
|
- config_ufw: true
|
||||||
- pruefungsuser: "pruefung"
|
- pruefungsuser: "pruefling"
|
||||||
|
- pruefungsgruppe: "prueflinge"
|
||||||
|
- pruefungspasswort: "pruefung"
|
||||||
|
|
||||||
# to verify ufw configuration run:
|
# to verify ufw configuration run:
|
||||||
# sudo ufw status verbose
|
# sudo ufw status verbose
|
||||||
roles:
|
roles:
|
||||||
- role: libreoffice
|
- role: libreoffice
|
||||||
|
- role: pruefungsuser
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Install ufw
|
- name: Install ufw
|
||||||
|
@ -132,26 +134,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
mode: '700'
|
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
|
- name: Set timezone to Europe/Vienna
|
||||||
timezone:
|
timezone:
|
||||||
|
|
|
@ -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 }}"
|
Loading…
Reference in New Issue