This is the multi-page printable view of this section. .
User Accounts
Create Linux user accounts with SSH key and passwordless sudo.
Create user account on Linux VMs with SSH key and passwordless sudo. Auto-skips non-Linux hosts.
Usage
Parameters
HOSTS: target host or group (default:vms)username: user name to create (default:admin)ssh_pubkey: SSH public key file path (default:~/.ssh/id_rsa.pub)user_shell: login shell (default:/bin/bash)user_groups: user groups, comma-separated (auto-detected:wheelfor Fedora/RHEL,sudofor Debian/Ubuntu)passwordless_sudo: enable passwordless sudo (default:true)
Behavior
- Auto-detects OS via
gather_facts: true - Linux hosts: creates user, configures SSH key, enables passwordless sudo
- Non-Linux hosts (Windows, etc.): skipped with message showing detected OS
- Idempotent: safe to run multiple times on same host