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

Shell module within become_method sudo and become_flags error #343

0xlc opened this issue Aug 13, 2018 · 2 comments

Shell module within become_method sudo and become_flags error #343

0xlc opened this issue Aug 13, 2018 · 2 comments


Copy link

@0xlc 0xlc commented Aug 13, 2018

Hi there,

I am using Ansible 2.6 and mitogen-0.2-2, i got an issue when running the shell module within become_method and become_flags:

- name: example
  become: yes
  become_method: sudo
  become_flags: '-iS'
  become_user: user
  shell: |
    bundle exec rails runner...
    chdir: ~/current
  delegate_to: example.local

basically i use '-i' to get a login shell when i run bundle, without mitogen works fine.

Error message:

error occurred on host server.example.local: sudo: no such option: -i
[pid 13375] 11:07:15.682284 D mitogen: Context(2, u'').call_async(): mitogen.parent._proxy_connect(method_name=u'sudo', name=None, kwargs=Kwargs({u'username': u'api', u'profiling': False, u'sudo_path': None, u'python_path': u'/usr/bin/python', 'unidirectional': True, u'debug': False, u'password': [secret], u'sudo_args': [u'-H', u'-S', u'-n', u'-i'], u'connect_timeout': 150}))
ERROR! [pid 13375] 11:07:15.683348 E mitogen.ctx.fork.25691: mitogen: Router(Broker(0x7f338a461690)): no route for Message(0, 3, 3, 102, None, "mitogen\x0010\x00register(Context(2, 'parent'), mitogen."..72), my ID is 3
[pid 13375] 11:07:15.695036 D mitogen.ctx.fork.25691: mitogen: Connected to Context(2, 'parent'); my ID is 3, PID is 25691
[pid 13375] 11:07:15.695646 D mitogen.ctx.fork.25691: mitogen: Recovered sys.executable: '/usr/bin/python'
[pid 13375] 11:07:15.702568 D mitogen: ModuleResponder(Router(Broker(0x7f602c50f4d0)))._on_get_module('mitogen.sudo')
[pid 13375] 11:07:15.707397 D mitogen: _send_load_module(mitogen.ssh.Stream(u''), u'mitogen.sudo')
[pid 13375] 11:07:15.729510 D mitogen: Importer(): master doesn't know 'mitogen.optparse'
[pid 13394] 11:07:15.735877 D mitogen: mitogen.core.Stream(u'unix_listener.13375').on_disconnect()
[pid 13394] 11:07:15.737226 D mitogen: Waker(Broker(0x7f602bc73290) rfd=15, wfd=16).on_disconnect()
[pid 13375] 11:07:15.737274 D mitogen: mitogen.core.Stream(u'unix_client.13394').on_disconnect()


Copy link

@dw dw commented Aug 13, 2018

Hi there,

This is now on dmw branch, and should be on master in the coming days. Note that per the docs 2.6 is not yet supported, there is still breakage I'm working through -- temp file handling has changed, and a new module exit method was introduced that broke the file module.

To be updated when a new release is made, subscribe to

Thanks for reporting this!

Copy link

@0xlc 0xlc commented Aug 13, 2018

Ok great thanks a lot.

So far except this error no issues with 2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.