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

Add support for fully qualified collection name in become_method #1072

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jadacyrus
Copy link

According to ansible-lint the correct value for become_method su and sudo are the fully qualified names ansible.builtin.su and ansible.builtin.sudo (https://github.com/ansible/ansible-lint/blob/main/src/ansiblelint/schemas/ansible.json#L48)

Making the switch to these fully qualified names while using the Mitogen connection strategy produces the following error :

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'ansible.builtin.sudo'
fatal: [REDACTED]: FAILED! =>
  msg: 'Unexpected failure during module execution: ''ansible.builtin.sudo'''
  stdout: ''

Here is an example playbook that will reproduce the bug:

# test-playbook.yml
- hosts: localhost
  tasks:
    - name: Run a shell command
      ansible.builtin.command: /bin/echo $(id -un)
      become: true
      become_user: nobody
      become_method: ansible.builtin.sudo

@jadacyrus jadacyrus force-pushed the add-fqcn-for-become-method branch from c473514 to 22c3202 Compare May 7, 2024 18:51
@jadacyrus
Copy link
Author

@moreati Anything specifically you want for this?

@dramborleg
Copy link

I also ran into this issue, is it possible to merge this or is something else needed? It's pretty small so just curious if it's a problem with the MR or just lack of time. If there's anything that can be done to help move it forward I may be able to contribute depending on what is needed. Thanks!

@jadacyrus
Copy link
Author

@moreati Bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants