community.general.pfexec (8.5.0) — become

profile based execution

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 pfexec utility.

Inputs

    
wrap_exe:
    default: false
    description: Toggle to wrap the command pfexec calls in 'shell -c' or not
    env:
    - name: ANSIBLE_PFEXEC_WRAP_EXECUTION
    ini:
    - key: wrap_execution
      section: pfexec_become_plugin
    type: bool
    vars:
    - name: ansible_pfexec_wrap_execution

become_exe:
    default: pfexec
    description: Sudo executable
    env:
    - name: ANSIBLE_BECOME_EXE
    - name: ANSIBLE_PFEXEC_EXE
    ini:
    - key: become_exe
      section: privilege_escalation
    - key: executable
      section: pfexec_become_plugin
    vars:
    - name: ansible_become_exe
    - name: ansible_pfexec_exe

become_pass:
    description: pfexec password
    env:
    - name: ANSIBLE_BECOME_PASS
    - name: ANSIBLE_PFEXEC_PASS
    ini:
    - key: password
      section: pfexec_become_plugin
    required: false
    vars:
    - name: ansible_become_password
    - name: ansible_become_pass
    - name: ansible_pfexec_pass

become_user:
    default: root
    description:
    - User you 'become' to execute the task
    - This plugin ignores this setting as pfexec uses it's own C(exec_attr) to figure
      this out, but it is supplied here for Ansible to make decisions needed for the task
      execution, like file permissions.
    env:
    - name: ANSIBLE_BECOME_USER
    - name: ANSIBLE_PFEXEC_USER
    ini:
    - key: become_user
      section: privilege_escalation
    - key: user
      section: pfexec_become_plugin
    vars:
    - name: ansible_become_user
    - name: ansible_pfexec_user

become_flags:
    default: -H -S -n
    description: Options to pass to pfexec
    env:
    - name: ANSIBLE_BECOME_FLAGS
    - name: ANSIBLE_PFEXEC_FLAGS
    ini:
    - key: become_flags
      section: privilege_escalation
    - key: flags
      section: pfexec_become_plugin
    vars:
    - name: ansible_become_flags
    - name: ansible_pfexec_flags