Manage user accounts and user attributes.
パラメータ | 必須 | default | 選択肢 | コメント |
---|---|---|---|---|
append | no | yes | yes/no | |
comment | no | - | - | ユーザのメモ(GECOS) |
createhome | no | yes | yes/no | yes:ホームディレクトリを作成 |
generate_ssh_key | no | no | yes/no | yes:sshキーを作成。存在する場合、上書きしない |
name | yes | - | - | 作成、削除、または変更するユーザ名 |
# Add the user 'johnd' with a specific uid and a primary group of 'admin' - user: name=johnd comment="John Doe" uid=1040 group=admin # Add the user 'james' with a bash shell, appending the group 'admins' and 'developers' to the user's groups - user: name=james shell=/bin/bash groups=admins,developers append=yes # Remove the user 'johnd' - user: name=johnd state=absent remove=yes # Create a 2048-bit SSH key for user jsmith in ~jsmith/.ssh/id_rsa - user: name=jsmith generate_ssh_key=yes ssh_key_bits=2048 ssh_key_file=.ssh/id_rsa # added a consultant whose account you want to expire - user: name=james18 shell=/bin/zsh groups=developers expires=1422403387