1
0
Fork 0
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:
Thomas Sjögren 2024-05-19 20:50:41 +02:00 committed by GitHub
parent 03240ad7dc
commit f82e7a7b83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 12 deletions

View file

@ -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;
} }
}); });

View file

@ -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;
} }