mirror of
https://github.com/gogrlx/docs.grlx.dev.git
synced 2026-04-02 03:08:53 -07:00
feat(ingredients): add user and group ingredients
This commit is contained in:
39
src/content/docs/ingredients/groups.md
Normal file
39
src/content/docs/ingredients/groups.md
Normal 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
|
||||
```
|
||||
51
src/content/docs/ingredients/user.md
Normal file
51
src/content/docs/ingredients/user.md
Normal 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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user