TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wikioasis/salt/llms.txt
Use this file to discover all available pages before exploring further.
users state implements a role-based access control system for all WikiOasis servers. Rather than managing individual users per host, administrators are assigned to groups (such as ops or mediawiki-admins). Each server’s pillar declares which groups are active on that host via server_groups. Salt then resolves the full list of users who should exist, creates their accounts and home directories, installs their SSH public keys on both their own account and on root, and writes fine-grained sudoers entries — all driven entirely from pillar data with no per-server templating needed.
Pillar structure
The users pillar is split across two files: a globalusers/init.sls that defines all known users and groups, and per-server overlays (e.g. users/servers/mediawiki.sls) that declare which groups are active on a given host.
server_groups
Declares which access groups are active on a server. Only users who belong to at least one listed group will have accounts created.
users
A map of username → user definition. UIDs and GIDs start at 3000 to avoid conflicts with system accounts.
groups
Defines access groups, their GIDs, membership lists, and the exact sudoers privilege lines granted to members.
revokedusers
Users listed under revokedusers are removed from the system. Salt calls user.absent with purge: True and force: True, removes any root SSH authorized keys, and cleans up their sudoers files.
Group privilege system
ops
Full passwordless sudo on all servers. Members:
thomas, unai. Assigned via server_groups: [ops].mediawiki-admins
Scoped sudo for wiki operations: run commands as
www-data, restart nginx and PHP-FPM, and read journals. Members: tali64./etc/sudoers.d/<username>_<group> (mode 0440, owned by root) containing exactly the privilege lines defined in the group’s privileges list. This gives precise, auditable control without a shared sudoers file.
Passwordless sudo
All sudoers on WikiOasis servers use key-based SSH authentication only; no passwords are managed by Salt. The file/etc/sudoers.d/sudonopasswd (sourced from salt://users/files/sudoers.d/sudonopasswd) contains:
sudo group (populated automatically on Ubuntu minions) can escalate without a password prompt.
SSH key deployment
For each user resolved byserver_groups, the state installs their SSH public keys in two locations:
/home/<username>/.ssh/authorized_keys— for direct user login/root/.ssh/authorized_keys— for direct root access
Revoking a user
Move user to revokedusers
Move the user’s entry from
users: to revokedusers: in the pillar, keeping their SSH keys listed so they can be explicitly removed from authorized_keys.