inital commit: add playbooks with roles to setup server and add user

This commit is contained in:
Jan Völkel 2025-03-18 23:37:20 +01:00
parent 9c48cd4353
commit ef4aab6a5d
Signed by: Jan Völkel
SSH key fingerprint: SHA256:adl1xwySHDTNcPt/f+Y8np42DFn8wbykFk3KWvbZWXk
9 changed files with 218 additions and 0 deletions

16
playbooks/add_user.yml Normal file
View file

@ -0,0 +1,16 @@
---
- name: Server setup with roles
hosts: almalinux-user
become: yes
vars_prompt:
- name: "username"
prompt: "Please enter the username to be created"
private: no # Der Benutzername wird sichtbar eingegeben
- name: "user_password"
prompt: "Please enter the password for the new user"
private: yes # Das Passwort wird versteckt eingegeben
- name: "ssh_public_key"
prompt: "Please enter the public key for shh of your pc"
private: no
roles:
- create_user_with_root

View file

@ -0,0 +1,18 @@
---
- name: Server setup with roles
hosts: almalinux # Hier verwenden wir die Gruppe 'almalinux' aus der hosts.ini
become: yes
vars_prompt:
- name: "username"
prompt: "Please enter the username to be created"
private: no # Der Benutzername wird sichtbar eingegeben
- name: "user_password"
prompt: "Please enter the password for the new user"
private: yes # Das Passwort wird versteckt eingegeben
- name: "ssh_public_key"
prompt: "Please enter the public key for shh of your pc"
private: no
roles:
# firewall
- create_user_with_root
# firewall