mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Add a 'machinectl shell' become_method (#39826)
* Add a 'machinectl shell' become_method * docs: add explanations for the machinectl become_method * docs: machinectl become_method: specify this part is specific to Linux+systemd setups
This commit is contained in:
committed by
Adam Miller
parent
174d7f8ea2
commit
313a46744d
@@ -557,6 +557,11 @@ class PlayContext(Base):
|
||||
prompt = 'Enter UPM user password:'
|
||||
becomecmd = '%s %s %s' % (exe, flags, shlex_quote(command))
|
||||
|
||||
elif self.become_method == 'machinectl':
|
||||
|
||||
exe = self.become_exe or 'machinectl'
|
||||
becomecmd = '%s shell -q %s %s@ %s' % (exe, flags, self.become_user, command)
|
||||
|
||||
else:
|
||||
raise AnsibleError("Privilege escalation method not found: %s" % self.become_method)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user