Module user

Ensure that a user-login is present or absent

Info:

Functions

present(uid, gid, shell, home, create_home, description, expire_date, groups, user_group)
Add a system user account.

Promiser:

    username

Note:

  • On OpenWRT: requires the shadow-useradd package
  • This module can only check attributes returned by posix.getpasswd.
  • Available parameters limited when used on Busybox systems such as Alpine Linux.

Aliases:

    add

Parameters:

  • uid uid of the new user account
  • gid gid of the new user account
  • shell shell of the new user account
  • home home directory of the new user account
  • create_home whether to create the home directory of not [DEFAULT: true]
  • description decription field for the new user account
  • expire_date the date on which the account will be disabled [FORMAT: YYYY-MM-DD]
  • groups supplementary groups for the user account
  • user_group whether to create a new group with the same name as the user account [DEFAULT: false]

Usage:

    user.present("ed"){
           uid = "666",
           gid = "777",
         shell = "/usr/bin/mksh",
        groups = "kvm"
    }
absent(remove)
Remove a system user account.

Promiser:

    username

Aliases:

    remove

Parameters:

  • remove delete home directory [DEFAULT: false]

Usage:

    user.absent("ed"){
        remove = true
    }
generated by LDoc 1.4.6 Last updated 2017-05-09 15:50:38