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

mitogen_sudo connection plugin and friends are the wrong plugin type for get_option('become_...') #1173

Open
moreati opened this issue Oct 28, 2024 · 1 comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases DesignRequired Issues that cannot progress due to incomplete design

Comments

@moreati
Copy link
Member

moreati commented Oct 28, 2024

ansible_mitogen.plugins.connection contains 3 "connections" that aren't connections in the Ansible world view

  • mitogen_doas
  • mitogen_sudo
  • mitogen_su

In Ansible land these would be become plugins. This wasn't a problem, but may become a problem now. I'm moving the PlaybookSpec to Ansible's plugin options API, but the options become_exe and become_flags are associated with become plugins and these plugins are connection plugins.

As a result the tests in tests/ansible/integration/stub_connections/all.yml fail with

PLAY [integration/stub_connections/mitogen_sudo.yml] ***************************

TASK [include_tasks _raw_params=../_mitogen_only.yml] **************************
Monday 28 October 2024  21:22:28 +0000 (0:00:00.372)       0:09:28.173 ******** 
included: /home/runner/work/mitogen/mitogen/tests/ansible/integration/_mitogen_only.yml for target-centos7-1, target-centos8-2, target-debian9-3, target-debian10-4, target-debian11-5, target-ubuntu1604-6, target-ubuntu1804-7, target-ubuntu2004-8

TASK [meta _raw_params=end_play] ***********************************************
Monday 28 October 2024  21:22:28 +0000 (0:00:00.159)       0:09:28.333 ******** 
skipping: [target-centos7-1]

TASK [custom_python_detect_environment ] ***************************************
Monday 28 October 2024  21:22:28 +0000 (0:00:00.012)       0:09:28.345 ******** 
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'get_option'
fatal: [target-centos7-1]: FAILED! => 
  msg: 'Unexpected failure during module execution: ''NoneType'' object has no attribute ''get_option'''
  stdout: ''
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'get_option'
fatal: [target-centos8-2]: FAILED! => 
  msg: 'Unexpected failure during module execution: ''NoneType'' object has no attribute ''get_option'''
  stdout: ''
@moreati moreati added DesignRequired Issues that cannot progress due to incomplete design affects-0.3 Issues related to 0.3.X Mitogen releases labels Oct 28, 2024
@moreati
Copy link
Member Author

moreati commented Oct 28, 2024

see #1172

moreati added a commit to moreati/mitogen that referenced this issue Oct 29, 2024
Some ansible_mitogen connection plugins look more like become plugins (e.g.
mitogen_sudo) & use become plugin options. For now there's special handling in
PlayContextSpec._become_option(). Further design/discussion can go in mitogen-hq#1173.

Refs mitogen-hq#1087.
moreati added a commit to moreati/mitogen that referenced this issue Oct 29, 2024
Uses the same fallback for (mitogen_sudo et al) as become_exe (see mitogen-hq#1173).

The new `Spec.become_flags()` is not yet explicitly tested. Note that it
returns a string (matching the Ansible option of the same name), whereas
Spec.sudo_args() returns a list.

refs mitogen-hq#1083
moreati added a commit to moreati/mitogen that referenced this issue Oct 29, 2024
Uses the same fallback for (mitogen_sudo et al) as become_exe (see mitogen-hq#1173).

The new `Spec.become_flags()` is not yet explicitly tested. Note that it
returns a string (matching the Ansible option of the same name), whereas
`Spec.sudo_args()` returns a list.

refs mitogen-hq#1083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases DesignRequired Issues that cannot progress due to incomplete design
Projects
None yet
Development

No branches or pull requests

1 participant