cfbs add promise-type-groups
The groups
promise type helps managing local groups, letting you ensure some users are a part of a group, or excluded from a group, etc.
Note: This is an experimental version of a promise type, and may be changed in the future.
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
policy |
string |
Whether group should be present or absent on the local host | no | present |
members |
string / data / body |
JSON string / data container / custom body containing attributes “include”, “exclude” & “only” | no | - |
gid |
integer |
The GID of the group | no | - |
Present group foo
including user alice
and bob
, but excluding user malcom
:
@if minimum_version(3.20)
body members foo
{
include => { "alice", "bob" };
exclude => { "malcom" };
}
@endif
bundle agent main
{
groups:
"foo"
policy => "present",
@if minimum_version(3.20)
members => foo;
@else
members => '{ "include": ["alice", "bob"],
"exclude": ["malcom"] }';
@endif
}
Present group bar
with GID 123
including only user alice
:
@if minimum_version(3.20)
body members bar
{
only => { "alice" };
}
@endif
bundle agent main
{
groups:
"bar"
@if minimum_version(3.20)
members => bar,
@else
members => '{ "only": ["alice"] }',
@endif
gid = 123;
}
Absent group baz
:
bundle agent main
{
groups:
"baz"
policy => "absent";
}
This software was created by the team at Northern.tech, with many contributions from the community. Thanks everyone!
Feel free to open pull requests to expand this documentation, add features or fix problems. You can also pick up an existing task or file an issue in our bug tracker.
This software is licensed under the MIT License. See LICENSE in the root of the repository for the full license text.