community.general.machinectl (8.5.0) — become

Systemd's machinectl privilege escalation

Authors: Ansible Core Team

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This become plugins allows your remote/login user to execute commands as another user via the machinectl utility.

Inputs

    
become_exe:
    default: machinectl
    description: Machinectl executable
    env:
    - name: ANSIBLE_BECOME_EXE
    - name: ANSIBLE_MACHINECTL_EXE
    ini:
    - key: become_exe
      section: privilege_escalation
    - key: executable
      section: machinectl_become_plugin
    vars:
    - name: ansible_become_exe
    - name: ansible_machinectl_exe

become_pass:
    description: Password for machinectl
    env:
    - name: ANSIBLE_BECOME_PASS
    - name: ANSIBLE_MACHINECTL_PASS
    ini:
    - key: password
      section: machinectl_become_plugin
    required: false
    vars:
    - name: ansible_become_password
    - name: ansible_become_pass
    - name: ansible_machinectl_pass

become_user:
    default: ''
    description: User you 'become' to execute the task
    env:
    - name: ANSIBLE_BECOME_USER
    - name: ANSIBLE_MACHINECTL_USER
    ini:
    - key: become_user
      section: privilege_escalation
    - key: user
      section: machinectl_become_plugin
    vars:
    - name: ansible_become_user
    - name: ansible_machinectl_user

become_flags:
    default: ''
    description: Options to pass to machinectl
    env:
    - name: ANSIBLE_BECOME_FLAGS
    - name: ANSIBLE_MACHINECTL_FLAGS
    ini:
    - key: become_flags
      section: privilege_escalation
    - key: flags
      section: machinectl_become_plugin
    vars:
    - name: ansible_become_flags
    - name: ansible_machinectl_flags