From ac7c84b5cc36ebb5c6f6cf35ec505037c7b4d9d7 Mon Sep 17 00:00:00 2001 From: Ethan Holz Date: Mon, 6 Nov 2023 18:12:55 -0600 Subject: [PATCH] feat(ingredients): add user and group ingredients --- src/content/docs/ingredients/groups.md | 39 ++++++++++++++++++++ src/content/docs/ingredients/user.md | 51 ++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 src/content/docs/ingredients/groups.md create mode 100644 src/content/docs/ingredients/user.md diff --git a/src/content/docs/ingredients/groups.md b/src/content/docs/ingredients/groups.md new file mode 100644 index 0000000..818991f --- /dev/null +++ b/src/content/docs/ingredients/groups.md @@ -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 +``` diff --git a/src/content/docs/ingredients/user.md b/src/content/docs/ingredients/user.md new file mode 100644 index 0000000..7475818 --- /dev/null +++ b/src/content/docs/ingredients/user.md @@ -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 +``` +