Use pfexec instead of sudo

Is it possible to specify pfexec instead of sudo in a playbook. Something like:

sudo_command: pfexec
or
root_command: pfexec

Cheers,
Paul

If pfexec can take same command line arguments as sudo, use ANSIBLE_SUDO_EXE env variable or sudo_exe entry in ansible .cfg to point to it.

Thanks Brian. I’ll give that a try. Although, I would like to use both. We have both linux and smartos boxes we would like to do specify within the context of a playbook or inventory file. sudo will work on Smartos but pfexec seems to be prefered in the Solaris world.

Cheers,
Paul

It’s currently not configurable on a per inventory variable basis, but patches to add a ansible_sudo_exe parameter would be considered for sure.

Did you ever solve this Paul? I am struggling with the same issue.

No. As much as I prefer rbac and pfexec, I just started using sudo. There is a hard-coded switch (-Z|z) that messes it up.

I do want to revisit the issue but I haven’t had time.

Cheers,
Paul