{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/48722","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/48722/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/48722/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/48722/events","html_url":"https://github.com/ansible/ansible/issues/48722","id":381188911,"node_id":"MDU6SXNzdWUzODExODg5MTE=","number":48722,"title":"module user, luseradd: error parsing arguments","user":{"login":"romain-dartigues","id":393859,"node_id":"MDQ6VXNlcjM5Mzg1OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/393859?v=4","gravatar_id":"","url":"https://api.github.com/users/romain-dartigues","html_url":"https://github.com/romain-dartigues","followers_url":"https://api.github.com/users/romain-dartigues/followers","following_url":"https://api.github.com/users/romain-dartigues/following{/other_user}","gists_url":"https://api.github.com/users/romain-dartigues/gists{/gist_id}","starred_url":"https://api.github.com/users/romain-dartigues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romain-dartigues/subscriptions","organizations_url":"https://api.github.com/users/romain-dartigues/orgs","repos_url":"https://api.github.com/users/romain-dartigues/repos","events_url":"https://api.github.com/users/romain-dartigues/events{/privacy}","received_events_url":"https://api.github.com/users/romain-dartigues/received_events","type":"User","site_admin":false},"labels":[{"id":947190508,"node_id":"MDU6TGFiZWw5NDcxOTA1MDg=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.7","name":"affects_2.7","color":"ededed","default":false},{"id":785271699,"node_id":"MDU6TGFiZWw3ODUyNzE2OTk=","url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":636352796,"node_id":"MDU6TGFiZWw2MzYzNTI3OTY=","url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"bcoca","id":836171,"node_id":"MDQ6VXNlcjgzNjE3MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/836171?v=4","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false},"assignees":[{"login":"bcoca","id":836171,"node_id":"MDQ6VXNlcjgzNjE3MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/836171?v=4","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-11-15T14:36:46Z","updated_at":"2018-11-30T12:42:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!--- Also test if the latest release and devel branch are affected too -->\r\n<!--- Complete *all* sections as described, this form is processed automatically -->\r\n\r\n##### SUMMARY\r\n\r\nModule `user` fail creating users with `local: true` **and** with groups.\r\n\r\nNote: this bug relates to #32199 (marked fixed by PR #32262) but is not the same.\r\n\r\n##### ISSUE TYPE\r\n- Bug Report\r\n\r\n##### COMPONENT NAME\r\n- module **`user`**\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.7.1\r\n  config file = /home/rdartigues/playbook-swf/ansible.cfg\r\n  configured module search path = [u'/home/rdartigues/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /home/rdartigues/.virtualenvs/ansible/lib/python2.7/site-packages/ansible\r\n  executable location = /home/rdartigues/.virtualenvs/ansible/bin/ansible\r\n  python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]\r\n```\r\n\r\n##### CONFIGURATION\r\n```\r\nANSIBLE_NOCOWS(/home/rdartigues/playbook-swf/ansible.cfg) = True\r\nCACHE_PLUGIN(/home/rdartigues/playbook-swf/ansible.cfg) = jsonfile\r\nCACHE_PLUGIN_CONNECTION(/home/rdartigues/playbook-swf/ansible.cfg) = ./.facts/\r\nCACHE_PLUGIN_TIMEOUT(/home/rdartigues/playbook-swf/ansible.cfg) = 3600\r\nDEFAULT_GATHERING(/home/rdartigues/playbook-swf/ansible.cfg) = smart\r\nDEFAULT_HASH_BEHAVIOUR(/home/rdartigues/playbook-swf/ansible.cfg) = merge\r\nDEFAULT_HOST_LIST(/home/rdartigues/playbook-swf/ansible.cfg) = [u'/home/rdartigues/playbook-swf/inventory.ini']\r\nDEFAULT_REMOTE_USER(/home/rdartigues/playbook-swf/ansible.cfg) = root\r\nRETRY_FILES_ENABLED(/home/rdartigues/playbook-swf/ansible.cfg) = False\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\nLocal OS:\r\n```\r\nLSB Version:    :core-4.1-ia32:core-4.1-noarch\r\nDistributor ID: CentOS\r\nDescription:    CentOS Linux release 7.5.1804 (Core) \r\nRelease:        7.5.1804\r\nCodename:       Core\r\n```\r\n\r\nTarget system:\r\n```console\r\n$ lsb_release -a\r\nLSB Version:    :core-4.1-amd64:core-4.1-noarch\r\nDistributor ID: CentOS\r\nDescription:    CentOS Linux release 7.5.1804 (Core) \r\nRelease:        7.5.1804\r\nCodename:       Core\r\n\r\n$ rpm -qa libuser\r\nlibuser-0.60-9.el7.x86_64\r\n```\r\n##### STEPS TO REPRODUCE\r\n```yaml\r\n---\r\n- hosts: [all]\r\n  gather_facts: false\r\n  tasks:\r\n    - user:\r\n        groups: ['adm', 'systemd-journal', 'users', 'wheel']\r\n        createhome: false # with or without, same result\r\n        local: true\r\n        name: 'test_user'\r\n...\r\n```\r\n\r\n##### EXPECTED RESULTS\r\n\r\n* no error\r\n* user is created\r\n* user is in supplementary groups\r\n\r\n##### ACTUAL RESULTS\r\n```console\r\n$ ansible-playbook debug.yml -l srv0206.example.net -Dvvv\r\nansible-playbook 2.7.1\r\n  config file = /home/rdartigues/playbook-swf/ansible.cfg\r\n  configured module search path = [u'/home/rdartigues/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /home/rdartigues/.virtualenvs/ansible/lib/python2.7/site-packages/ansible\r\n  executable location = /home/rdartigues/.virtualenvs/ansible/bin/ansible-playbook\r\n  python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]\r\nUsing /home/rdartigues/playbook-swf/ansible.cfg as config file\r\n/home/rdartigues/playbook-swf/inventory.ini did not meet host_list requirements, check plugin documentation if this is unexpected\r\n/home/rdartigues/playbook-swf/inventory.ini did not meet script requirements, check plugin documentation if this is unexpected\r\n/home/rdartigues/playbook-swf/inventory.ini did not meet yaml requirements, check plugin documentation if this is unexpected\r\nParsed /home/rdartigues/playbook-swf/inventory.ini inventory source with ini plugin\r\n\r\nPLAYBOOK: debug.yml ***************************************************************************************\r\n1 plays in debug.yml\r\n\r\nPLAY [all] ************************************************************************************************\r\nMETA: ran handlers\r\n\r\nTASK [user] ***********************************************************************************************\r\ntask path: /home/rdartigues/playbook-swf/debug.yml:6\r\n<srv0206.example.net> ESTABLISH SSH CONNECTION FOR USER: root\r\n<srv0206.example.net> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/rdartigues/.ansible/cp/7de40a45ac srv0206.example.net '/bin/sh -c '\"'\"'echo ~root && sleep 0'\"'\"''\r\n<srv0206.example.net> (0, '/root\\n', '')\r\n<srv0206.example.net> ESTABLISH SSH CONNECTION FOR USER: root\r\n<srv0206.example.net> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/rdartigues/.ansible/cp/7de40a45ac srv0206.example.net '/bin/sh -c '\"'\"'( umask 77 && mkdir -p \"` echo /root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129 `\" && echo ansible-tmp-1542189136.9-150634927138129=\"` echo /root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129 `\" ) && sleep 0'\"'\"''\r\n<srv0206.example.net> (0, 'ansible-tmp-1542189136.9-150634927138129=/root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129\\n', '')\r\nUsing module file /home/rdartigues/.virtualenvs/ansible/lib/python2.7/site-packages/ansible/modules/system/user.py\r\n<srv0206.example.net> PUT /home/rdartigues/.ansible/tmp/ansible-local-297228xcR_R/tmppPjixB TO /root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129/AnsiballZ_user.py\r\n<srv0206.example.net> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/rdartigues/.ansible/cp/7de40a45ac '[srv0206.example.net]'\r\n<srv0206.example.net> (0, 'sftp> put /home/rdartigues/.ansible/tmp/ansible-local-297228xcR_R/tmppPjixB /root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129/AnsiballZ_user.py\\n', '')\r\n<srv0206.example.net> ESTABLISH SSH CONNECTION FOR USER: root\r\n<srv0206.example.net> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/rdartigues/.ansible/cp/7de40a45ac srv0206.example.net '/bin/sh -c '\"'\"'chmod u+x /root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129/ /root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129/AnsiballZ_user.py && sleep 0'\"'\"''\r\n<srv0206.example.net> (0, '', '')\r\n<srv0206.example.net> ESTABLISH SSH CONNECTION FOR USER: root\r\n<srv0206.example.net> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/rdartigues/.ansible/cp/7de40a45ac -tt srv0206.example.net '/bin/sh -c '\"'\"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129/AnsiballZ_user.py && sleep 0'\"'\"''\r\n<srv0206.example.net> (1, '\\r\\n{\"msg\": \"Error parsing arguments: unknown option.\\\\nUsage: lusermod [-imLU?] [-i|--interactive] [-c|--gecos STRING]\\\\n        [-d|--directory STRING] [-m|--movedirectory] [-s|--shell STRING]\\\\n        [-u|--uid NUM] [-g|--gid NUM] [-l|--login STRING]\\\\n        [-P|--plainpassword STRING] [-p|--password STRING] [-L|--lock]\\\\n        [-U|--unlock] [--commonname=STRING] [--givenname=STRING]\\\\n        [--surname=STRING] [--roomnumber=STRING] [--telephonenumber=STRING]\\\\n        [--homephone=STRING] [-?|--help] [--usage] [OPTION...] user\\\\n\", \"failed\": true, \"rc\": 1, \"name\": \"test_user\", \"invocation\": {\"module_args\": {\"comment\": null, \"ssh_key_bits\": 0, \"update_password\": \"always\", \"non_unique\": false, \"force\": false, \"ssh_key_type\": \"rsa\", \"create_home\": false, \"password_lock\": null, \"ssh_key_passphrase\": null, \"uid\": null, \"home\": null, \"append\": false, \"skeleton\": null, \"ssh_key_comment\": \"ansible-generated on srv0206.example.net\", \"group\": null, \"system\": false, \"state\": \"present\", \"hidden\": null, \"local\": true, \"shell\": null, \"expires\": null, \"ssh_key_file\": null, \"groups\": [\"adm\", \"systemd-journal\", \"users\", \"wheel\"], \"move_home\": false, \"password\": null, \"seuser\": null, \"name\": \"test_user\", \"createhome\": false, \"remove\": false, \"login_class\": null, \"generate_ssh_key\": null}}}\\r\\n', 'Shared connection to srv0206.example.net closed.\\r\\n')\r\n<srv0206.example.net> ESTABLISH SSH CONNECTION FOR USER: root\r\n<srv0206.example.net> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/rdartigues/.ansible/cp/7de40a45ac srv0206.example.net '/bin/sh -c '\"'\"'rm -f -r /root/.ansible/tmp/ansible-tmp-1542189136.9-150634927138129/ > /dev/null 2>&1 && sleep 0'\"'\"''\r\n<srv0206.example.net> (0, '', '')\r\nfatal: [srv0206.example.net]: FAILED! => {\r\n    \"changed\": false,\r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"append\": false,\r\n            \"comment\": null,\r\n            \"create_home\": false,\r\n            \"createhome\": false,\r\n            \"expires\": null,\r\n            \"force\": false,\r\n            \"generate_ssh_key\": null,\r\n            \"group\": null,\r\n            \"groups\": [\r\n                \"adm\",\r\n                \"systemd-journal\",\r\n                \"users\",\r\n                \"wheel\"\r\n            ],\r\n            \"hidden\": null,\r\n            \"home\": null,\r\n            \"local\": true,\r\n            \"login_class\": null,\r\n            \"move_home\": false,\r\n            \"name\": \"test_user\",\r\n            \"non_unique\": false,\r\n            \"password\": null,\r\n            \"password_lock\": null,\r\n            \"remove\": false,\r\n            \"seuser\": null,\r\n            \"shell\": null,\r\n            \"skeleton\": null,\r\n            \"ssh_key_bits\": 0,\r\n            \"ssh_key_comment\": \"ansible-generated on srv0206.example.net\",\r\n            \"ssh_key_file\": null,\r\n            \"ssh_key_passphrase\": null,\r\n            \"ssh_key_type\": \"rsa\",\r\n            \"state\": \"present\",\r\n            \"system\": false,\r\n            \"uid\": null,\r\n            \"update_password\": \"always\"\r\n        }\r\n    },\r\n    \"msg\": \"Error parsing arguments: unknown option.\\nUsage: lusermod [-imLU?] [-i|--interactive] [-c|--gecos STRING]\\n        [-d|--directory STRING] [-m|--movedirectory] [-s|--shell STRING]\\n        [-u|--uid NUM] [-g|--gid NUM] [-l|--login STRING]\\n        [-P|--plainpassword STRING] [-p|--password STRING] [-L|--lock]\\n        [-U|--unlock] [--commonname=STRING] [--givenname=STRING]\\n        [--surname=STRING] [--roomnumber=STRING] [--telephonenumber=STRING]\\n        [--homephone=STRING] [-?|--help] [--usage] [OPTION...] user\\n\",\r\n    \"name\": \"test_user\",\r\n    \"rc\": 1\r\n}\r\n\r\nPLAY RECAP ************************************************************************************************\r\nsrv0206.example.net    : ok=0    changed=0    unreachable=0    failed=1\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/443192514","html_url":"https://github.com/ansible/ansible/issues/48722#issuecomment-443192514","issue_url":"https://api.github.com/repos/ansible/ansible/issues/48722","id":443192514,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzE5MjUxNA==","user":{"login":"vipulparashar","id":11701865,"node_id":"MDQ6VXNlcjExNzAxODY1","avatar_url":"https://avatars2.githubusercontent.com/u/11701865?v=4","gravatar_id":"","url":"https://api.github.com/users/vipulparashar","html_url":"https://github.com/vipulparashar","followers_url":"https://api.github.com/users/vipulparashar/followers","following_url":"https://api.github.com/users/vipulparashar/following{/other_user}","gists_url":"https://api.github.com/users/vipulparashar/gists{/gist_id}","starred_url":"https://api.github.com/users/vipulparashar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vipulparashar/subscriptions","organizations_url":"https://api.github.com/users/vipulparashar/orgs","repos_url":"https://api.github.com/users/vipulparashar/repos","events_url":"https://api.github.com/users/vipulparashar/events{/privacy}","received_events_url":"https://api.github.com/users/vipulparashar/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T12:42:28Z","updated_at":"2018-11-30T12:42:28Z","author_association":"NONE","body":"Same issue - But with different error -   \r\n\r\nhttps://github.com/ansible/ansible/issues/49368\r\n\r\nThe full traceback is:\r\nTraceback (most recent call last):\r\n  File \"/Users/vipul.sharma/.ansible/tmp/ansible-tmp-1543581354.93-236985466746518/AnsiballZ_user.py\", line 113, in <module>\r\n    _ansiballz_main()\r\n  File \"/Users/vipul.sharma/.ansible/tmp/ansible-tmp-1543581354.93-236985466746518/AnsiballZ_user.py\", line 105, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/Users/vipul.sharma/.ansible/tmp/ansible-tmp-1543581354.93-236985466746518/AnsiballZ_user.py\", line 48, in invoke_module\r\n    imp.load_module('__main__', mod, module, MOD_DESC)\r\n  File \"/tmp/ansible_user_payload_5Pl_0V/__main__.py\", line 2611, in <module>\r\n  File \"/tmp/ansible_user_payload_5Pl_0V/__main__.py\", line 2568, in main\r\n  File \"/tmp/ansible_user_payload_5Pl_0V/__main__.py\", line 802, in user_info\r\n  File \"/tmp/ansible_user_payload_5Pl_0V/__main__.py\", line 797, in get_pwd_info\r\nKeyError: 'getpwnam(): name not found: prometheus'\r\n\r\nfatal: [3.121.234.237]: FAILED! => {\r\n    \"changed\": false,\r\n    \"module_stderr\": \"Traceback (most recent call last):\\n  File \\\"/Users/vipul.sharma/.ansible/tmp/ansible-tmp-1543581354.93-236985466746518/AnsiballZ_user.py\\\", line 113, in <module>\\n    _ansiballz_main()\\n  File \\\"/Users/vipul.sharma/.ansible/tmp/ansible-tmp-1543581354.93-236985466746518/AnsiballZ_user.py\\\", line 105, in _ansiballz_main\\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\\n  File \\\"/Users/vipul.sharma/.ansible/tmp/ansible-tmp-1543581354.93-236985466746518/AnsiballZ_user.py\\\", line 48, in invoke_module\\n    imp.load_module('__main__', mod, module, MOD_DESC)\\n  File \\\"/tmp/ansible_user_payload_5Pl_0V/__main__.py\\\", line 2611, in <module>\\n  File \\\"/tmp/ansible_user_payload_5Pl_0V/__main__.py\\\", line 2568, in main\\n  File \\\"/tmp/ansible_user_payload_5Pl_0V/__main__.py\\\", line 802, in user_info\\n  File \\\"/tmp/ansible_user_payload_5Pl_0V/__main__.py\\\", line 797, in get_pwd_info\\nKeyError: 'getpwnam(): name not found: prometheus'\\n\",\r\n    \"module_stdout\": \"\",\r\n    \"msg\": \"MODULE FAILURE\\nSee stdout/stderr for the exact error\",\r\n    \"rc\": 1\r\n}\r\n"}}
{"actor":{"display_login":"vipulparashar"}}