mitogen-hq / mitogen

Distributed self-replicating programs in Python
https://mitogen.networkgenomics.com/
BSD 3-Clause "New" or "Revised" License
2.34k stars 199 forks source link

Ansible 2.8 AttributeError: 'module' object has no attribute 'id' #592

Closed Rizzly closed 5 years ago

Rizzly commented 5 years ago

Execution log for playbook below

The issues can be reproduced by running the following playbook:

- name: test ansible 2.8 id missing
  hosts: host.com
  tasks:
    - user:
        name: '{{ ansible_env.SUDO_USER|default(ansible_env.USER) }}'
        createhome: yes
      become_user: root
dw commented 5 years ago

Thanks for reporting this! I can't seem to reproduce it here. Would it be possible for you to tickle the bug again, but this time including "-vvvv" output?

Rizzly commented 5 years ago

First of all, sorry for the late response!

If I checkout https://github.com/dw/mitogen/commit/6f4cbc1ead3bb07ba4fd9357566503b01d5360ab I still get this same issue. But it seems the fix for https://github.com/dw/mitogen/issues/590 also fixes this.

Please tell me if you'd like further logs anyway. Otherwise, feel free to close this.

dw commented 5 years ago

If it would be possible to provide '-vvv' output that would be great -- the trouble is that we may have fixed something entirely by accident, and could unfix it later should that fix ever be modified :) Thanks again

Rizzly commented 5 years ago

No problem! Here's the -vvvv-output when running from https://github.com/dw/mitogen/commit/6f4cbc1ead3bb07ba4fd9357566503b01d5360ab: noid.log

yodatak commented 5 years ago

`TASK [prereqs : Groupe ] **** task path: //ansible-XXXXX/roles/prereqs/tasks/users.yml:2 [mux 30818] 10:49:57.701076 D mitogen: PushFileService().propagate_to(Context(1006, u'ssh.XXXXX.sudo.root'), u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py') [task 31170] 10:49:57.705360 D mitogen: CallChain(Context(1006, u'ssh.XXXXX.sudo.root')).call_async(): ansible_mitogen.target.run_module(kwargs={u'module_map': {u'builtin': [u'ansible.module_utils._text', u'ansible.module_utils.basic', u'ansible.module_utils.common', u'ansible.module_utils.common._collections_compat', u'ansible.module_utils.common._json_compat', u'ansible.module_utils.common._utils', u'ansible.module_utils.common.collections', u'ansible.module_utils.common.file', u'ansible.module_utils.common.parameters', u'ansible.module_utils.common.process', u'ansible.module_utils.common.sys_info', u'ansible.module_utils.common.text', u'ansible.module_utils.common.text.converters', u'ansible.module_utils.common.text.formatters', u'ansible.module_utils.common.validation', u'ansible.module_utils.distro', u'ansible.module_utils.distro._distro', u'ansible.module_utils.parsing', u'ansible.module_utils.parsing.convert_bool', u'ansible.module_utils.pycompat24', u'ansible.module_utils.six'], u'custom': []}, u'emulate_tty': True, u'good_temp_dir': u'/tmp', u'module': u'group', u'cwd': None, u'service_context': Context(0, None), u'extra_env': None, u'is_python': None, u'env': {}, u'path': u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', u'runner_name': u'NewStyleRunner', u'interpreter_fragment': None, u'json_args': '{"_ansible_version": "2.8.1", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p"], "name": "sup", "_ansible_module_name": "group", "_ansible_debug": false, "_ansible_verbosity": 3, "_ansible_keep_remote_files": false, "_ansible_syslog_facility": "LOG_USER", "_ansible_socket": null, "state": "present", "gid": 9375, "_ansible_diff": false, "_ansible_remote_tmp": "/tmp", "_ansible_shell_executable": "/bin/sh", "_ansible_check_mode": false, "_ansible_tmpdir": null, "_ansible_string_conversion_action": "warn", "_ansible_no_log": false}'}) [mux 30818] 10:49:57.717353 D mitogen.ctx.ssh.XXXXX: mitogen: PushFileService().store_and_forward(u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', [blob: 17624 bytes], Context(1006, u'sudo.root')) 'mitogen.service.Pool.2372150.worker-3' [mux 30818] 10:49:57.717701 D mitogen.ctx.ssh.XXXXX: mitogen: Context(1006, None).call_service_async(u'mitogen.service.PushFileService', 'store_and_forward', {'path': u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', 'data': [blob: 17624 bytes], 'context': Context(1006, u'sudo.root')}) [mux 30818] 10:49:57.717887 D mitogen.ctx.ssh.XXXXX: mitogen: Context(1006, None).send_async(Message(1006, 2, 2, 110, 1007, '\x80\x02X\x1f\x00\x00\x00mitogen.service.PushFileServiceq\x01X\x11\x00\x00\x00store'..18001)) [mux 30818] 10:49:57.718065 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: _dispatch_one(('XXXXX-31170-7faa34cf9700-58b1c7f7a4586', u'ansible_mitogen.target', None, u'run_module', (), Kwargs({'kwargs': {u'module_map': {u'builtin': [u'ansible.module_utils._text', u'ansible.module_utils.basic', u'ansible.module_utils.common', u'ansible.module_utils.common._collections_compat', u'ansible.module_utils.common._json_compat', u'ansible.module_utils.common._utils', u'ansible.module_utils.common.collections', u'ansible.module_utils.common.file', u'ansible.module_utils.common.parameters', u'ansible.module_utils.common.process', u'ansible.module_utils.common.sys_info', u'ansible.module_utils.common.text', u'ansible.module_utils.common.text.converters', u'ansible.module_utils.common.text.formatters', u'ansible.module_utils.common.validation', u'ansible.module_utils.distro', u'ansible.module_utils.distro._distro', u'ansible.module_utils.parsing', u'ansible.module_utils.parsing.convert_bool', u'ansible.module_utils.pycompat24', u'ansible.module_utils.six'], u'custom': []}, u'emulate_tty': True, u'good_temp_dir': u'/tmp', u'module': u'group', u'interpreter_fragment': None, u'service_context': Context(0, None), u'extra_env': None, u'is_python': None, u'env': {}, u'path': u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', u'json_args': '{"_ansible_version": "2.8.1", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p"], "name": "sup", "_ansible_module_name": "group", "_ansible_debug": false, "_ansible_verbosity": 3, "_ansible_keep_remote_files": false, "_ansible_syslog_facility": "LOG_USER", "_ansible_socket": null, "state": "present", "gid": 9375, "_ansible_diff": false, "_ansible_remote_tmp": "/tmp", "_ansible_shell_executable": "/bin/sh", "_ansible_check_mode": false, "_ansible_tmpdir": null, "_ansible_string_conversion_action": "warn", "_ansible_no_log": false}', u'cwd': None, u'runner_name': u'NewStyleRunner'}}))) [mux 30818] 10:49:57.718321 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: PushFileService().get(u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py') waiting for uncached file to arrive [mux 30818] 10:49:57.719695 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: PushFileService().store_and_forward(u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', [blob: 17624 bytes], Context(1006, u'sudo.root')) 'mitogen.service.Pool.1b9de10.worker-6' [task 31181] 10:49:57.723289 D mitogen: unix.connect(path='/tmp/mitogen_unix_LhlbVg.sock') [mux 30818] 10:49:57.724246 D mitogen: mitogen.unix.Listener('/tmp/mitogen_unix_LhlbVg.sock'): accepted mitogen.core.Stream('unix_client.31181') [task 31181] 10:49:57.724288 D mitogen: unix.connect(): local ID is 4040, remote is 0 [mux 30818] 10:49:57.724714 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: PushFileService().get(u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py') -> [blob: 17624 bytes] [mux 30818] 10:49:57.724904 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: Importer().find_module('ansible.module_utils.common.') [mux 30818] 10:49:57.725066 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: Importer(): master doesn't know u'ansible.module_utils.common.' [mux 30818] 10:49:57.725237 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: Importer().find_module('ansible.module_utils.common.text.') [mux 30818] 10:49:57.725390 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: Importer(): master doesn't know u'ansible.module_utils.common.text.' [mux 30818] 10:49:57.725540 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: Importer().find_module('ansible.module_utils.parsing.') [mux 30818] 10:49:57.725687 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: Importer(): master doesn't know u'ansible.module_utils.parsing.' [mux 30818] 10:49:57.725831 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: Importer().find_module('ansible.module_utils.six.') [mux 30818] 10:49:57.725973 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: Importer(): master doesn't know u'ansible.module_utils.six.' [task 31181] 10:49:57.729767 D ansible_mitogen.planner: BinaryPlanner() rejected u'group' [task 31181] 10:49:57.730061 D ansible_mitogen.planner: NewStylePlanner() accepted u'group' (filename u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py') [mux 30818] 10:49:57.733153 D mitogen: PushFileService().propagate_to(Context(6, u'ssh.X.sudo.root'), u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py') [task 31181] 10:49:57.735766 D mitogen: CallChain(Context(6, u'ssh.X.sudo.root')).call_async(): ansible_mitogen.target.run_module(kwargs={u'module_map': {u'builtin': [u'ansible.module_utils._text', u'ansible.module_utils.basic', u'ansible.module_utils.common', u'ansible.module_utils.common._collections_compat', u'ansible.module_utils.common._json_compat', u'ansible.module_utils.common._utils', u'ansible.module_utils.common.collections', u'ansible.module_utils.common.file', u'ansible.module_utils.common.parameters', u'ansible.module_utils.common.process', u'ansible.module_utils.common.sys_info', u'ansible.module_utils.common.text', u'ansible.module_utils.common.text.converters', u'ansible.module_utils.common.text.formatters', u'ansible.module_utils.common.validation', u'ansible.module_utils.distro', u'ansible.module_utils.distro._distro', u'ansible.module_utils.parsing', u'ansible.module_utils.parsing.convert_bool', u'ansible.module_utils.pycompat24', u'ansible.module_utils.six'], u'custom': []}, u'emulate_tty': True, u'good_temp_dir': u'/tmp', u'module': u'group', u'cwd': None, u'service_context': Context(0, None), u'extra_env': None, u'is_python': None, u'env': {}, u'path': u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', u'runner_name': u'NewStyleRunner', u'interpreter_fragment': None, u'json_args': '{"_ansible_version": "2.8.1", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p"], "name": "sup", "_ansible_module_name": "group", "_ansible_debug": false, "_ansible_verbosity": 3, "_ansible_keep_remote_files": false, "_ansible_syslog_facility": "LOG_USER", "_ansible_socket": null, "state": "present", "gid": 9375, "_ansible_diff": false, "_ansible_remote_tmp": "/tmp", "_ansible_shell_executable": "/bin/sh", "_ansible_check_mode": false, "_ansible_tmpdir": null, "_ansible_string_conversion_action": "warn", "_ansible_no_log": false}'}) [mux 30818] 10:49:57.739737 D mitogen.ctx.ssh.X: mitogen: PushFileService().store_and_forward(u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', [blob: 17624 bytes], Context(6, u'sudo.root')) 'mitogen.service.Pool.f25cd0.worker-3' [mux 30818] 10:49:57.739997 D mitogen.ctx.ssh.X: mitogen: Context(6, None).call_service_async(u'mitogen.service.PushFileService', 'store_and_forward', {'path': u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', 'data': [blob: 17624 bytes], 'context': Context(6, u'sudo.root')}) [mux 30818] 10:49:57.740198 D mitogen.ctx.ssh.X: mitogen: Context(6, None).send_async(Message(6, 4, 4, 110, 1007, '\x80\x02X\x1f\x00\x00\x00mitogen.service.PushFileServiceq\x01X\x11\x00\x00\x00store'..18000)) [mux 30818] 10:49:57.749496 D mitogen.ctx.ssh.X.sudo.root: mitogen: PushFileService().store_and_forward(u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', [blob: 17624 bytes], Context(6, u'sudo.root')) 'mitogen.service.Pool.101c450.worker-6' [mux 30818] 10:49:57.750107 D mitogen.ctx.ssh.X.sudo.root: mitogen: _dispatch_one(('XXXXX-31181-7faa34cf9700-58b1c7f7bf6f6', u'ansible_mitogen.target', None, u'run_module', (), Kwargs({'kwargs': {u'module_map': {u'builtin': [u'ansible.module_utils._text', u'ansible.module_utils.basic', u'ansible.module_utils.common', u'ansible.module_utils.common._collections_compat', u'ansible.module_utils.common._json_compat', u'ansible.module_utils.common._utils', u'ansible.module_utils.common.collections', u'ansible.module_utils.common.file', u'ansible.module_utils.common.parameters', u'ansible.module_utils.common.process', u'ansible.module_utils.common.sys_info', u'ansible.module_utils.common.text', u'ansible.module_utils.common.text.converters', u'ansible.module_utils.common.text.formatters', u'ansible.module_utils.common.validation', u'ansible.module_utils.distro', u'ansible.module_utils.distro._distro', u'ansible.module_utils.parsing', u'ansible.module_utils.parsing.convert_bool', u'ansible.module_utils.pycompat24', u'ansible.module_utils.six'], u'custom': []}, u'emulate_tty': True, u'good_temp_dir': u'/tmp', u'module': u'group', u'interpreter_fragment': None, u'service_context': Context(0, None), u'extra_env': None, u'is_python': None, u'env': {}, u'path': u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', u'json_args': '{"_ansible_version": "2.8.1", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p"], "name": "sup", "_ansible_module_name": "group", "_ansible_debug": false, "_ansible_verbosity": 3, "_ansible_keep_remote_files": false, "_ansible_syslog_facility": "LOG_USER", "_ansible_socket": null, "state": "present", "gid": 9375, "_ansible_diff": false, "_ansible_remote_tmp": "/tmp", "_ansible_shell_executable": "/bin/sh", "_ansible_check_mode": false, "_ansible_tmpdir": null, "_ansible_string_conversion_action": "warn", "_ansible_no_log": false}', u'cwd': None, u'runner_name': u'NewStyleRunner'}}))) [mux 30818] 10:49:57.750486 D mitogen.ctx.ssh.X.sudo.root: mitogen: Importer().find_module('ansible.module_utils.common.') [mux 30818] 10:49:57.750763 D mitogen.ctx.ssh.X.sudo.root: mitogen: Importer(): master doesn't know u'ansible.module_utils.common.' [mux 30818] 10:49:57.751005 D mitogen.ctx.ssh.X.sudo.root: mitogen: Importer().find_module('ansible.module_utils.common.text.') [mux 30818] 10:49:57.751298 D mitogen.ctx.ssh.X.sudo.root: mitogen: Importer(): master doesn't know u'ansible.module_utils.common.text.' [mux 30818] 10:49:57.751483 D mitogen.ctx.ssh.X.sudo.root: mitogen: Importer().find_module('ansible.module_utils.parsing.') [mux 30818] 10:49:57.751664 D mitogen.ctx.ssh.X.sudo.root: mitogen: Importer(): master doesn't know u'ansible.module_utils.parsing.' [mux 30818] 10:49:57.751824 D mitogen.ctx.ssh.X.sudo.root: mitogen: Importer().find_module('ansible.module_utils.six.') [mux 30818] 10:49:57.751977 D mitogen.ctx.ssh.X.sudo.root: mitogen: Importer(): master doesn't know u'ansible.module_utils.six.' [mux 30818] 10:49:57.758063 D mitogen.ctx.ssh.X.sudo.root: mitogen: _dispatch_calls: Message(6, 4040, 0, 101, 1003, '\x80\x02(U)XXXXX-31181-7faa34cf9700-58b1c7f7bf6f6q\x01X\x16'..2062) -> {u'stdout': u'', u'stderr': u'Traceback (most recent call last):\n File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 883, in _run\n self._run_code(code, mod)\n File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 862, in _run_code\n exec(\'exec code in vars(mod)\')\n File "", line 1, in \n File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 593, in \n File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 541, in main\n File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 101, in new\n File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/basic.py", line 303, in load_platform_subclass\n platform_cls = get_platform_subclass(cls)\n File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 118, in get_platform_subclass\n distribution = get_distribution()\n File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 32, in get_distribution\n distribution = distro.id().capitalize()\nAttributeError: \'module\' object has no attribute \'id\'\n', u'rc': 1} [mux 30818] 10:49:57.758649 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: _dispatch_calls: Message(1006, 4039, 0, 101, 1003, '\x80\x02(U)XXXXX-31170-7faa34cf9700-58b1c7f7a4586q\x01X\x16'..2062) -> {u'stdout': u'', u'stderr': u'Traceback (most recent call last):\n File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 883, in _run\n self._run_code(code, mod)\n File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 862, in _run_code\n exec(\'exec code in vars(mod)\')\n File "", line 1, in \n File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 593, in \n File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 541, in main\n File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 101, in new\n File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/basic.py", line 303, in load_platform_subclass\n platform_cls = get_platform_subclass(cls)\n File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 118, in get_platform_subclass\n distribution = get_distribution()\n File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 32, in get_distribution\n distribution = distro.id().capitalize()\nAttributeError: \'module\' object has no attribute \'id\'\n', u'rc': 1} [task 31181] 10:49:57.758900 D ansible_mitogen.connection: Call took 23 ms: ansible_mitogen.target.run_module(kwargs={u'module_map': {u'builtin': [u'ansible.module_utils._text', u'ansible.module_utils.basic', u'ansible.module_utils.common', u'ansible.module_utils.common._collections_compat', u'ansible.module_utils.common._json_compat', u'ansible.module_utils.common._utils', u'ansible.module_utils.common.collections', u'ansible.module_utils.common.file', u'ansible.module_utils.common.parameters', u'ansible.module_utils.common.process', u'ansible.module_utils.common.sys_info', u'ansible.module_utils.common.text', u'ansible.module_utils.common.text.converters', u'ansible.module_utils.common.text.formatters', u'ansible.module_utils.common.validation', u'ansible.module_utils.distro', u'ansible.module_utils.distro._distro', u'ansible.module_utils.parsing', u'ansible.module_utils.parsing.convert_bool', u'ansible.module_utils.pycompat24', u'ansible.module_utils.six'], u'custom': []}, u'emulate_tty': True, u'good_temp_dir': u'/tmp', u'module': u'group', u'cwd': None, u'service_context': Context(0, None), u'extra_env': None, u'is_python': None, u'env': {}, u'path': u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', u'runner_name': u'NewStyleRunner', u'interpreter_fragment': None, u'json_args': '{"_ansible_version": "2.8.1", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p"], "name": "sup", "_ansible_module_name": "group", "_ansible_debug": false, "_ansible_verbosity": 3, "_ansible_keep_remote_files": false, "_ansible_syslog_facility": "LOG_USER", "_ansible_socket": null, "state": "present", "gid": 9375, "_ansible_diff": false, "_ansible_remote_tmp": "/tmp", "_ansible_shell_executable": "/bin/sh", "_ansible_check_mode": false, "_ansible_tmpdir": null, "_ansible_string_conversion_action": "warn", "_ansible_no_log": false}'}) [task 31181] 10:49:57.759597 D ansible_mitogen.mixins: _remove_tmp_path(None) [task 31181] 10:49:57.759935 D mitogen: CallChain(Context(6, u'ssh.X.sudo.root')).call_no_reply(): mitogen.core.Dispatcher.forget_chain('XXXXX-31181-7faa34cf9700-58b1c7f7bf6f6') [task 31170] 10:49:57.759765 D ansible_mitogen.connection: Call took 54 ms: ansible_mitogen.target.run_module(kwargs={u'module_map': {u'builtin': [u'ansible.module_utils._text', u'ansible.module_utils.basic', u'ansible.module_utils.common', u'ansible.module_utils.common._collections_compat', u'ansible.module_utils.common._json_compat', u'ansible.module_utils.common._utils', u'ansible.module_utils.common.collections', u'ansible.module_utils.common.file', u'ansible.module_utils.common.parameters', u'ansible.module_utils.common.process', u'ansible.module_utils.common.sys_info', u'ansible.module_utils.common.text', u'ansible.module_utils.common.text.converters', u'ansible.module_utils.common.text.formatters', u'ansible.module_utils.common.validation', u'ansible.module_utils.distro', u'ansible.module_utils.distro._distro', u'ansible.module_utils.parsing', u'ansible.module_utils.parsing.convert_bool', u'ansible.module_utils.pycompat24', u'ansible.module_utils.six'], u'custom': []}, u'emulate_tty': True, u'good_temp_dir': u'/tmp', u'module': u'group', u'cwd': None, u'service_context': Context(0, None), u'extra_env': None, u'is_python': None, u'env': {}, u'path': u'//XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py', u'runner_name': u'NewStyleRunner', u'interpreter_fragment': None, u'json_args': '{"_ansible_version": "2.8.1", "_ansible_selinux_special_fs": ["fuse", "nfs", "vboxsf", "ramfs", "9p"], "name": "sup", "_ansible_module_name": "group", "_ansible_debug": false, "_ansible_verbosity": 3, "_ansible_keep_remote_files": false, "_ansible_syslog_facility": "LOG_USER", "_ansible_socket": null, "state": "present", "gid": 9375, "_ansible_diff": false, "_ansible_remote_tmp": "/tmp", "_ansible_shell_executable": "/bin/sh", "_ansible_check_mode": false, "_ansible_tmpdir": null, "_ansible_string_conversion_action": "warn", "_ansible_no_log": false}'}) [task 31170] 10:49:57.760325 D ansible_mitogen.mixins: _remove_tmp_path(None) [task 31170] 10:49:57.760663 D mitogen: CallChain(Context(1006, u'ssh.XXXXX.sudo.root')).call_no_reply(): mitogen.core.Dispatcher.forget_chain('XXXXX-31170-7faa34cf9700-58b1c7f7a4586') [mux 30818] 10:49:57.760939 D ansible_mitogen.services: ContextService().put(Context(6, u'ssh.X.sudo.root')) [mux 30818] 10:49:57.761483 D ansible_mitogen.services: ContextService().put(Context(1006, u'ssh.XXXXX.sudo.root')) [task 31170] 10:49:57.762101 D mitogen: mitogen.core.Stream('unix_listener.30818').on_disconnect() [mux 30818] 10:49:57.762366 D mitogen: mitogen.core.Stream('unix_client.31170').on_disconnect() [task 31170] 10:49:57.762401 D mitogen: Waker(Broker(0x7cbdc90) rfd=11, wfd=13).on_disconnect() [task 31170] 10:49:57.762775 D mitogen: Router(Broker(0x7cbdc90)): stats: 0 module requests in 0 ms, 0 sent (0 ms minify time), 0 negative responses. Sent 0.0 kb total, 0.0 kb avg. [mux 30818] 10:49:57.762782 D mitogen.ctx.ssh.X.sudo.root: mitogen: _dispatch_one((None, u'mitogen.core', u'Dispatcher', u'forget_chain', ('XXXXX-31181-7faa34cf9700-58b1c7f7bf6f6',), Kwargs({}))) [mux 30818] 10:49:57.762985 D mitogen.ctx.ssh.X.sudo.root: mitogen: _dispatchcalls: Message(6, 4040, 0, 101, 0, '\x80\x02(NX\x0c\x00\x00\x00mitogen.coreX\n\x00\x00\x00Dispatcherq\x01X\x0c\x00\x00\x00forget'..135) -> None [mux 30818] 10:49:57.763838 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: _dispatch_one((None, u'mitogen.core', u'Dispatcher', u'forget_chain', ('XXXXX-31170-7faa34cf9700-58b1c7f7a4586',), Kwargs({}))) [mux 30818] 10:49:57.764032 D mitogen.ctx.ssh.XXXXX.sudo.root: mitogen: _dispatchcalls: Message(1006, 4039, 0, 101, 0, '\x80\x02(NX\x0c\x00\x00\x00mitogen.coreX\n\x00\x00\x00Dispatcherq\x01X\x0c\x00\x00\x00forget'..135) -> None [task 31181] 10:49:57.766010 D mitogen: mitogen.core.Stream('unix_listener.30818').on_disconnect() [task 31181] 10:49:57.766466 D mitogen: Waker(Broker(0x7bf1150) rfd=11, wfd=13).on_disconnect() [task 31181] 10:49:57.767000 D mitogen: Router(Broker(0x7bf1150)): stats: 0 module requests in 0 ms, 0 sent (0 ms minify time), 0 negative responses. Sent 0.0 kb total, 0.0 kb avg. The full traceback is: Traceback (most recent call last): File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 883, in _run self._run_code(code, mod) File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 862, in _run_code exec('exec code in vars(mod)') File "", line 1, in File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 593, in File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 541, in main File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 101, in new File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/basic.py", line 303, in load_platform_subclass platform_cls = get_platform_subclass(cls) File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 118, in get_platform_subclass distribution = get_distribution() File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 32, in get_distribution distribution = distro.id().capitalize() AttributeError: 'module' object has no attribute 'id'

fatal: [XXXXX]: FAILED! => { "changed": false, "rc": 1 }

MSG:

MODULE FAILURE See stdout/stderr for the exact error

MODULE_STDERR:

Traceback (most recent call last): File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 883, in _run self._run_code(code, mod) File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 862, in _run_code exec('exec code in vars(mod)') File "", line 1, in File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 593, in File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 541, in main File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 101, in new File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/basic.py", line 303, in load_platform_subclass platform_cls = get_platform_subclass(cls) File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 118, in get_platform_subclass distribution = get_distribution() File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 32, in get_distribution distribution = distro.id().capitalize() AttributeError: 'module' object has no attribute 'id'

[mux 30818] 10:49:57.769809 D mitogen: mitogen.core.Stream('unix_client.31181').on_disconnect() The full traceback is: Traceback (most recent call last): File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 883, in _run self._run_code(code, mod) File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 862, in _run_code exec('exec code in vars(mod)') File "", line 1, in File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 593, in File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 541, in main File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 101, in new File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/basic.py", line 303, in load_platform_subclass platform_cls = get_platform_subclass(cls) File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 118, in get_platform_subclass distribution = get_distribution() File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 32, in get_distribution distribution = distro.id().capitalize() AttributeError: 'module' object has no attribute 'id'

fatal: [zet332o6]: FAILED! => { "changed": false, "rc": 1 }

MSG:

MODULE FAILURE See stdout/stderr for the exact error

MODULE_STDERR:

Traceback (most recent call last): File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 883, in _run self._run_code(code, mod) File "master://ansible-XXXXX/library/mitogen-master/ansible_mitogen/runner.py", line 862, in _run_code exec('exec code in vars(mod)') File "", line 1, in File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 593, in File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 541, in main File "master://XXXXX/lib/python2.7/site-packages/ansible/modules/system/group.py", line 101, in new File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/basic.py", line 303, in load_platform_subclass platform_cls = get_platform_subclass(cls) File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 118, in get_platform_subclass distribution = get_distribution() File "master://XXXXX/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.py", line 32, in get_distribution distribution = distro.id().capitalize() AttributeError: 'module' object has no attribute 'id' ` Same for me so the output of -vvv

dw commented 5 years ago

It was the same problem, thanks a ton for reporting and following up!

yinghai9989 commented 3 years ago

需要制定python的环境为 python3,就可以解决 You need to make the Python environment as Python 3, you can solve this problem

eg

[all:vars] ansible_python_interpreter=/usr/bin/python3

AnurajVijayanK commented 1 year ago

Change python defult version from 2.X to 3.X

yum install python3

ls -l /usr/bin/python3*

lrwxrwxrwx 1 root root 9 Sep 24 10:19 /usr/bin/python3 -> python3.6 -rwxr-xr-x 2 root root 11336 May 30 15:42 /usr/bin/python3.6 -rwxr-xr-x 2 root root 11336 May 30 15:42 /usr/bin/python3.6m

sudo ln -fs /usr/bin/python3.6 /usr/bin/python

python --version

Python 3.6.8