salt.modules.useradd

Manage users with the useradd command

Members

add

salt.modules.useradd.add(name, uid=None, gid=None, groups=None, home=True, shell=None, fullname=None, roomnumber=None, workphone=None, homephone=None, other=None, unique=True, system=False)

Add a user to the minion

CLI Example:

salt '*' user.add name <uid> <gid> <groups> <home> <shell>

callable

salt.modules.useradd.callable(object) → bool

Return whether the object is callable (i.e., some kind of function). Note that classes are callable, as are instances with a __call__() method.

chfullname

salt.modules.useradd.chfullname(name, fullname)

Change the users Full Name

CLI Example:

salt '*' user.chfullname foo "Foo Bar"

chgid

salt.modules.useradd.chgid(name, gid)

Change the default group of the user

CLI Example:

salt '*' user.chgid foo 4376

chgroups

salt.modules.useradd.chgroups(name, groups, append=False)

Change the groups this user belongs to, add append to append the specified groups

CLI Example:

salt '*' user.chgroups foo wheel,root True

chhome

salt.modules.useradd.chhome(name, home, persist=False)

Change the home directory of the user, pass true for persist to copy files to the new home dir

CLI Example:

salt '*' user.chhome foo /home/users/foo True

chhomephone

salt.modules.useradd.chhomephone(name, homephone)

Change the user's Home Phone

CLI Example:

salt '*' user.chhomephone foo "7735551234"

chother

salt.modules.useradd.chother(name, other)

Change the user's "Other" GECOS field

CLI Example:

salt '*' user.chother foo "fax=7735555678"

chroomnumber

salt.modules.useradd.chroomnumber(name, roomnumber)

Change the user's Room Number

CLI Example:

salt '*' user.chroomnumber foo 123

chshell

salt.modules.useradd.chshell(name, shell)

Change the default shell of the user

CLI Example:

salt '*' user.chshell foo /bin/zsh

chuid

salt.modules.useradd.chuid(name, uid)

Change the uid for a named user

CLI Example:

salt '*' user.chuid foo 4376

chworkphone

salt.modules.useradd.chworkphone(name, workphone)

Change the user's Work Phone

CLI Example:

salt '*' user.chworkphone foo "7735550123"

delete

salt.modules.useradd.delete(name, remove=False, force=False)

Remove a user from the minion

CLI Example:

salt '*' user.delete name True True

getent

salt.modules.useradd.getent()

Return the list of all info for all users

CLI Example:

salt '*' user.getent

info

salt.modules.useradd.info(name)

Return user information

CLI Example:

salt '*' user.info root

list_groups

salt.modules.useradd.list_groups(name)

Return a list of groups the named user belongs to

CLI Example:

salt '*' user.list_groups foo

Parent topic

Table Of Contents

Previous topic

salt.modules.upstart

Next topic

salt.modules.virt