Skip to content

ansible_mitogen: become_method doesn't support fully qualified collection name (FQCN) #1232

@jadacyrus

Description

@jadacyrus

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

PR is here: #1072

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-0.3Issues related to 0.3.X Mitogen releases

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions