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 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ansible_mitogen/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,9 @@ def _connect_mitogen_doas(spec):
'ssh': _connect_ssh,
'smart': _connect_ssh, # issue #548.
'su': _connect_su,
'ansible.builtin.su': _connect_su,
'sudo': _connect_sudo,
'ansible.builtin.sudo': _connect_sudo,
'doas': _connect_doas,
'mitogen_su': _connect_mitogen_su,
'mitogen_sudo': _connect_mitogen_sudo,
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ To avail of fixes in an unreleased version, please download a ZIP file
In progress (unreleased)
------------------------

* :gh:issue:`1232` :mod:`ansible_mitogen`: Add support for fully qualified
connection names in become_method
* :gh:issue:`1213` tests: Enable default Python warnings
* :gh:issue:`1111` :mod:`mitogen`: Replace uses of deprecated
:py:func:`pkgutil.find_loader`
Expand Down
1 change: 1 addition & 0 deletions tests/ansible/regression/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
- import_playbook: issue_1066__add_host__host_key_checking.yml
- import_playbook: issue_1079__wait_for_connection_timeout.yml
- import_playbook: issue_1087__template_streamerror.yml
- import_playbook: issue_1232__fully_qualified_names_become_method.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- name: regression/issue_1232__fully_qualified_names_become_method.yml (1/2)
hosts: test-targets
become_method: ansible.builtin.sudo
tasks:
- name: Run a shell command with sudo root
vars:
ansible_become_pass: rootpassword
ansible.builtin.command: whoami
become: true
become_user: root

- name: regression/issue_1232__fully_qualified_names_become_method.yml (2/2)
hosts: test-targets
become_method: ansible.builtin.su
tasks:
- name: Run a shell command with su mitogen__user1
vars:
ansible_become_pass: user1_password
when:
- become_unpriv_available
ansible.builtin.command: whoami
become: true
become_user: mitogen__user1
Loading