summaryrefslogtreecommitdiff
path: root/roles/unix_users/subplot.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-10-21 10:57:35 +0300
committerLars Wirzenius <liw@liw.fi>2020-10-21 10:57:35 +0300
commit32ab130707616ed01aed81e8b10dc63f445d2278 (patch)
treebf83cf125d39cd2fc3f3b2be12f0989454dcace5 /roles/unix_users/subplot.md
parent4702f64f2e26f0294ab7a3b24cad7d198d21b054 (diff)
downloaddebian-ansible-32ab130707616ed01aed81e8b10dc63f445d2278.tar.gz
unix_users: drop obsolete authkeys_dir variable, bump version
Also, document the variables in the subplot.
Diffstat (limited to 'roles/unix_users/subplot.md')
-rw-r--r--roles/unix_users/subplot.md31
1 files changed, 30 insertions, 1 deletions
diff --git a/roles/unix_users/subplot.md b/roles/unix_users/subplot.md
index 78a7a48..2fde3e7 100644
--- a/roles/unix_users/subplot.md
+++ b/roles/unix_users/subplot.md
@@ -2,6 +2,35 @@
This role creates or updates Unix users.
+## Configuration
+
+This role makes use of the following variables:
+
+* `unix_users_version` &ndash; MANDATORY: The playbook should set this
+ to the version of the role it expects to use.
+
+* `unix_users` &ndash; OPTIONAL: A list of Unix accounts to create.
+ Defaults to the empty list. Each item in the list is a dict with the
+ following keys:
+
+ * `username` &ndash; MANDATORY: the username of the account
+ * `comment` &ndash; OPTIONAL: the real name (or GECOS field) of the
+ new account
+ * `shell` &ndash; OPTIONAL: the login shell
+ * `system` &ndash; OPTIONAL: boolean, is this a system user?
+ * `sudo` &ndash; OPTIONAL: boolean, should the account have password-less sudo?
+ * `ssh_key` &ndash; OPTIONAL: text of key to install as `~/.ssh/id_rsa`
+ * `ssh_key_pub` &ndash; OPTIONAL: text of key to install as `~/.ssh/id_rsa.pub`
+ * `authorized_keys` &ndash; OPTIONAL: text of contents of
+ `~/.ssh/authorized_keys`
+ * `password` &ndash; OPTIONAL: encrypted password
+
+Create the encrypted password with something like:
+
+~~~yaml
+password: "{{ lookup('pipe', 'pass show foo | mkpasswd --method=sha-512 --stdin') }}"
+~~~
+
## Create normal user with unix_users
~~~scenario
@@ -17,7 +46,7 @@ and the user foo on host has authorized_keys containing "ssh-rsa"
~~~
~~~{#foo.yml .file .yaml}
-unix_users_version: 0
+unix_users_version: 1
unix_users:
- username: foo