mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
lint and fix polkit examples (#8381)
* lint and fix polkit examples Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com> * add changelog fragment Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com> * remove changelog fragment Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com> --------- Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
03240ad7dc
commit
f82e7a7b83
2 changed files with 13 additions and 12 deletions
|
@ -78,9 +78,10 @@ DOCUMENTATION = '''
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r'''
|
||||||
# A polkit rule needed to use the module with a non-root user.
|
# A polkit rule needed to use the module with a non-root user.
|
||||||
# See the Notes section for details.
|
# See the Notes section for details.
|
||||||
60-machinectl-fast-user-auth.rules: |
|
/etc/polkit-1/rules.d/60-machinectl-fast-user-auth.rules: |
|
||||||
polkit.addRule(function(action, subject) {
|
polkit.addRule(function(action, subject) {
|
||||||
if(action.id == "org.freedesktop.machine1.host-shell" && subject.isInGroup("wheel")) {
|
if(action.id == "org.freedesktop.machine1.host-shell" &&
|
||||||
|
subject.isInGroup("wheel")) {
|
||||||
return polkit.Result.AUTH_SELF_KEEP;
|
return polkit.Result.AUTH_SELF_KEEP;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -71,7 +71,7 @@ EXAMPLES = r"""
|
||||||
/etc/polkit-1/rules.d/60-run0-fast-user-auth.rules: |
|
/etc/polkit-1/rules.d/60-run0-fast-user-auth.rules: |
|
||||||
polkit.addRule(function(action, subject) {
|
polkit.addRule(function(action, subject) {
|
||||||
if(action.id == "org.freedesktop.systemd1.manage-units" &&
|
if(action.id == "org.freedesktop.systemd1.manage-units" &&
|
||||||
subject.isInGroup("wheel")
|
subject.isInGroup("wheel") &&
|
||||||
subject.user == "ansible") {
|
subject.user == "ansible") {
|
||||||
return polkit.Result.YES;
|
return polkit.Result.YES;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue