Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pfexec become plugin does not work on illumos distros #3671

Closed
1 task done
manschwetusCF opened this issue Nov 8, 2021 · 10 comments · Fixed by #3889
Closed
1 task done

pfexec become plugin does not work on illumos distros #3671

manschwetusCF opened this issue Nov 8, 2021 · 10 comments · Fixed by #3889
Labels
bug This issue/PR relates to a bug has_pr module module os packaging plugins plugin (any type)

Comments

@manschwetusCF
Copy link
Contributor

manschwetusCF commented Nov 8, 2021

Summary

Pfexec become plugin does use non existing options and bad quoting, see: ansible/ansible#15642

The old change described in this patch still works, I'm ready to open a pull request for.

Issue Type

Bug Report

Component Name

community.general.pfexec
plugins/become/pfexec.py

Ansible Version

$ ansible --version
ansible [core 2.11.6] 
  config file = None
  configured module search path = ['/home/florian/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/florian/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/lib/python-exec/python3.9/ansible
  python version = 3.9.7 (default, Oct 17 2021, 02:52:49) [GCC 10.3.0]
  jinja version = 3.0.1
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /usr/lib/python3.9/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 3.7.0

Configuration

No response

OS / Environment

OmniOS, OpenIndiana, etc.

Steps to Reproduce

configure host with OmniOS for become method pfexec

Expected Results

become method pfexec works

Actual Results

become method pfexec does not work

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

  • plugins/modules/packaging/os/pkg5

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module os packaging plugins plugin (any type) labels Nov 8, 2021
@manschwetusCF
Copy link
Contributor Author

My basic question is, for which OS does the become plugin work as it is today? And if any, should an option switch be added, to allow to choose between old (illumos incompatible) and new (illumos compatible) behavior?

@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

cc @None
click here for bot help

@manschwetusCF
Copy link
Contributor Author

!component plugins/modules/packaging/os/pkg5

@bcoca
Copy link
Contributor

bcoca commented Nov 9, 2021

FYI, when in core this was tested against illumos.

In any case, the patch is not the right fix, the build_success_command function should be overridden instead, shell should not be hardcoded but use the one from the 'shell' variable passed in to allow the user to configure it depending on their context (for example, being restricted to only ksh).

@bcoca
Copy link
Contributor

bcoca commented Nov 9, 2021

quick look, this might just bee a quote problem in https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/become/__init__.py#L74 requiring a shlex.quote wrapping cmd before interpolation

@manschwetusCF
Copy link
Contributor Author

@bcoca Can you provide a bit more details on this quoting thing? I'm not familiar with ansible coding, but the option problem can be bypassed by host config.
If you have an experimental change I can test it.

@manschwetusCF
Copy link
Contributor Author

manschwetusCF commented Jul 5, 2022

I found a configuration, which makes it work with current ansible version.

ansible_become: yes
ansible_become_method: pfexec
ansible_become_flags: ""
ansible_pfexec_wrap_execution: yes
ansible_python_interpreter: /usr/bin/python3.10

Maybe someone can verify this.

This was referenced Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module os packaging plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants