{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/17862","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/17862/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/17862/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/17862/events","html_url":"https://github.com/ansible/ansible/issues/17862","id":180534350,"number":17862,"title":"ansible-playbook prints out wrong error message and does not honor -u centos or --private-key","user":{"login":"Thermi","id":3606849,"avatar_url":"https://avatars.githubusercontent.com/u/3606849?v=3","gravatar_id":"","url":"https://api.github.com/users/Thermi","html_url":"https://github.com/Thermi","followers_url":"https://api.github.com/users/Thermi/followers","following_url":"https://api.github.com/users/Thermi/following{/other_user}","gists_url":"https://api.github.com/users/Thermi/gists{/gist_id}","starred_url":"https://api.github.com/users/Thermi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thermi/subscriptions","organizations_url":"https://api.github.com/users/Thermi/orgs","repos_url":"https://api.github.com/users/Thermi/repos","events_url":"https://api.github.com/users/Thermi/events{/privacy}","received_events_url":"https://api.github.com/users/Thermi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.1","name":"affects_2.1","color":"5319e7"},{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-02T20:47:40Z","updated_at":"2016-10-03T14:12:36Z","closed_at":null,"body":"<!---\r\nPlease do not report issues/requests related to Ansible modules here !!\r\n\r\nReport them to the appropriate modules-core or modules-extras project:\r\n  - https://github.com/ansible/ansible-modules-core/issues\r\n  - https://github.com/ansible/ansible-modules-extras/issues\r\n\r\nAlso verify first that your issue/request is not already reported in GitHub\r\n-->\r\n\r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\nansible-playbook\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.1.2.0\r\n  config file = /home/thermi/UNITS/Rimoto/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n\r\n```\r\n\r\n##### CONFIGURATION\r\n```\r\n[defaults]\r\nroles_path = roles/:library/\r\n```\r\n##### OS / ENVIRONMENT\r\n```\r\nuname -a\r\nLinux thermi-pc.thermicorp.lan 4.4.23-1-lts #1 SMP Fri Sep 30 13:41:31 CEST 2016 x86_64 GNU/Linux\r\ncat /etc/os-release\r\nNAME=\"Arch Linux\"\r\nID=arch\r\nPRETTY_NAME=\"Arch Linux\"\r\nANSI_COLOR=\"0;36\"\r\nHOME_URL=\"https://www.archlinux.org/\"\r\nSUPPORT_URL=\"https://bbs.archlinux.org/\"\r\nBUG_REPORT_URL=\"https://bugs.archlinux.org/\"\r\n```\r\n\r\n##### SUMMARY\r\nansible-playbook prints out a wrong error message.\r\nIt also does not honor the -u switch, although it is mentioned on the man page for `ansible-playbook`:\r\n```\r\n       -u USERNAME, --user=USERNAME\r\n           Use this USERNAME to login to the target host, instead of the current user.\r\n```\r\nThe SSH key that is specified with --private-key does not seem to be honored either, because that\r\nkey is NOT encrypted.\r\n\r\n##### STEPS TO REPRODUCE\r\n\r\n```\r\nansible-playbook site.yml -u centos -c paramiko --ssh-common-args='-i /.ssh/id_rsa_rimoto_aws_new' --become-method=sudo -i es-cluster\r\n```\r\nor\r\n\r\n```\r\nansible-playbook site.yml -u centos -c paramiko --private-key='/.ssh/id_rsa_rimoto_aws_new' --become-method=sudo -i es-cluster\r\n```\r\n\r\n##### EXPECTED RESULTS\r\nThat the playbook runs.\r\n\r\n##### ACTUAL RESULTS\r\nansible-playbook errors out with the output that can be found at [gist.github.com](https://gist.github.com/Thermi/e3c009bba3cba3f618eb24bc7e620df1).\r\n```\r\nPLAY [master_nodes] ************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nfatal: [54.194.172.139]: UNREACHABLE! => {\"changed\": false, \"msg\": \"ssh ansible@54.194.172.139:22 : Private key file is encrypted\\nTo connect as a different user, use -u <username>.\", \"unreachable\": true}\r\n        to retry, use: --limit @/home/thermi/UNITS/Rimoto/ansible/site.retry\r\n\r\nPLAY RECAP *********************************************************************\r\n54.194.172.139             : ok=0    changed=0    unreachable=1    failed=0\r\n```\r\n\r\n\r\nFrom the journal of the host 54.194.172.139:\r\n```\r\nOct 02 20:29:30 ip-10-2-1-204.eu-west-1.compute.internal sshd[6506]: Invalid user ansible from 78.43.42.91\r\nOct 02 20:29:30 ip-10-2-1-204.eu-west-1.compute.internal sshd[6506]: input_userauth_request: invalid user ansible [preauth]\r\nOct 02 20:29:30 ip-10-2-1-204.eu-west-1.compute.internal sshd[6506]: Connection closed by 78.43.42.91 [preauth]\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/251116301","html_url":"https://github.com/ansible/ansible/issues/17862#issuecomment-251116301","issue_url":"https://api.github.com/repos/ansible/ansible/issues/17862","id":251116301,"user":{"login":"bcoca","id":836171,"avatar_url":"https://avatars.githubusercontent.com/u/836171?v=3","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},"created_at":"2016-10-03T14:12:36Z","updated_at":"2016-10-03T14:12:36Z","body":"ansible.cfg is the configuration file, which -u does override. \r\n\r\nConnection variables are considered 'runtime' which overrides the command line and even play directives. This still does not seem like a bug but a configuration issue so I'm going to refer you to the lists/irc as this is not the place for debugging configuration issues."}}
{"actor":{"display_login":"bcoca"}}