Skip to content

Shell module within become_method sudo and become_flags error #343

Closed

Description

@luca0x333

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...
  args:
    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'ssh.server.example.com').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'ssh.server.example.com'), u'mitogen.sudo')
[pid 13375] 11:07:15.729510 D mitogen.ctx.ssh.server.example.com: 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()

Thanks

Activity

  1. dw commented on Aug 13, 2018

    @dw
    Member

    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 https://networkgenomics.com/mail/mitogen-announce/

    Thanks for reporting this!

  2. luca0x333 commented on Aug 13, 2018

    @luca0x333
    Author

    Ok great thanks a lot.

    So far except this error no issues with 2.6

  3. added
    bugCode feature that hinders desired execution outcome
    ansibleIssues relating to Mitogen for Ansible
    transport:sudoIssues impacting mostly mitogen/sudo.py
    target:v0.2Bugs to be fixed in 0.2 stable series
    on Aug 17, 2018
  4. added a commit that references this issue on Aug 18, 2018
    2d50270
  5. added a commit that references this issue on Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ansibleIssues relating to Mitogen for AnsiblebugCode feature that hinders desired execution outcometarget:v0.2Bugs to be fixed in 0.2 stable seriestransport:sudoIssues impacting mostly mitogen/sudo.pyuser-reported

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions