1 configuration
Luca Matteo Spoljarevic edited this page 2026-02-27 21:40:24 +01:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

configuration

Playbooks for user creation and server hardening / baseline configuration. Use with an inventory that targets the right hosts.


Contents

File / folder Purpose
usercreation.yml Create a system user with hashed password and sudo/wheel.
hardening/ Server hardening and baseline stack (RHEL); see hardening.md.

usercreation.yml

Creates a system user with:

  • Hashed password (SHA-512)
  • Home directory and bash shell
  • Membership in sudo (Debian) or wheel (RHEL/Fedora)

Variables: Read from environment so you can use CI/secrets safely:

  • USR_NAME Username to create.
  • USR_PASS Plain-text password; the playbook hashes it with password_hash('sha512').

Run:

export USR_NAME=myuser USR_PASS='SecurePassword'
ansible-playbook -i inventory.ini configuration/usercreation.yml -K

Or pass extra vars instead of env if you prefer (avoid putting secrets in the command line in production).

Note: Installs the sudo package on Debian/RHEL if needed. Targets hosts: all; restrict via inventory or --limit.