feat(ingredients): add user and group ingredients

This commit is contained in:
Ethan Holz
2023-11-06 18:12:55 -06:00
parent 77eb26e770
commit ac7c84b5cc
2 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
---
title: grlx.ingredients.group
desc: An overview of grlx.ingredients.group
---
The group ingredient handles group operations on sprouts.
## **group.absent**
Removes a group
#### Parameters
| parameter | type | required | description |
|-----------|------|----------|-------------|
| _name_ | string | no | The name of the group to remove
```yaml
group.absent:
- name: sprout-group
```
## **group.exists**
Validates if a group exists
#### Parameters
| parameter | type | required | description |
|-----------|------|----------|-------------|
| _name_ | string | yes | The group name to check
```yaml
group.exists:
- name: sprout-group
```
## **group.present**
Creates a group if it does not exist
#### Parameters
| parameter | type | required | description |
|-----------|------|----------|-------------|
| _name_ | string | yes | The name of the group to create
| _gid_ | int | no | The GID of the group to create
```yaml
group.present:
- name: sprout-group
- gid: 1000
```

View File

@@ -0,0 +1,51 @@
---
title: grlx.ingredients.user
desc: An overview of grlx.ingredients.user
---
The user ingredient handles user operations on sprouts.
## **user.absent**
Removes a user if it exists
#### Parameters
| parameter | type | required | description |
|-----------|------|----------|-------------|
| _name_ | string | yes | the name of the user to be removed
```yaml
user.absent:
- name: super-sprout
```
## **user.exists**
Validates if a user exists
#### Parameters
| parameter | type | required | description |
|-----------|------|----------|-------------|
| _name_ | string | yes | The username to check
```yaml
user.exists:
- name: sprout-user
```
## **user.present**
Creates a new user if it does not exist
#### Parameters
| parameter | type | required | description |
|-----------|------|----------|-------------|
| _name_ | string | yes | The username of the user
| _uid_ | int | no | The UID assigned to the user
| _gid_ | int | no | The GID to the user
| _groups_ | list, string | no | A list groups the user is part of
| _shell_ | bool | no | The user login shell, false by default
| _home_ | string | no | The path to the user's home directory if one is required
```yaml
user.present:
- name: sprout-user
- uid: 1000
- gid: 1000
- groups:
- wheel
- media
- sudo
- shell: no
- home: /var/sprout-user
```