diff --git a/plugins/become/machinectl.py b/plugins/become/machinectl.py index 9b9ac7ec51..e2773ed6a5 100644 --- a/plugins/become/machinectl.py +++ b/plugins/become/machinectl.py @@ -78,12 +78,13 @@ DOCUMENTATION = ''' EXAMPLES = r''' # A polkit rule needed to use the module with a non-root user. # See the Notes section for details. -60-machinectl-fast-user-auth.rules: | - polkit.addRule(function(action, subject) { - if(action.id == "org.freedesktop.machine1.host-shell" && subject.isInGroup("wheel")) { - return polkit.Result.AUTH_SELF_KEEP; - } - }); +/etc/polkit-1/rules.d/60-machinectl-fast-user-auth.rules: | + polkit.addRule(function(action, subject) { + if(action.id == "org.freedesktop.machine1.host-shell" && + subject.isInGroup("wheel")) { + return polkit.Result.AUTH_SELF_KEEP; + } + }); ''' from re import compile as re_compile diff --git a/plugins/become/run0.py b/plugins/become/run0.py index 1d6d7cb754..a718e86f24 100644 --- a/plugins/become/run0.py +++ b/plugins/become/run0.py @@ -69,13 +69,13 @@ EXAMPLES = r""" # An example polkit rule that allows the user 'ansible' in the 'wheel' group # to execute commands using run0 without authentication. /etc/polkit-1/rules.d/60-run0-fast-user-auth.rules: | - polkit.addRule(function(action, subject) { - if(action.id == "org.freedesktop.systemd1.manage-units" && - subject.isInGroup("wheel") - subject.user == "ansible") { + polkit.addRule(function(action, subject) { + if(action.id == "org.freedesktop.systemd1.manage-units" && + subject.isInGroup("wheel") && + subject.user == "ansible") { return polkit.Result.YES; - } - }); + } + }); """ from re import compile as re_compile