{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/882","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/882/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/882/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/882/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/882","id":59632257,"number":882,"title":"service module failure message should contain more information","user":{"login":"JeanFred","id":364381,"avatar_url":"https://avatars.githubusercontent.com/u/364381?v=3","gravatar_id":"","url":"https://api.github.com/users/JeanFred","html_url":"https://github.com/JeanFred","followers_url":"https://api.github.com/users/JeanFred/followers","following_url":"https://api.github.com/users/JeanFred/following{/other_user}","gists_url":"https://api.github.com/users/JeanFred/gists{/gist_id}","starred_url":"https://api.github.com/users/JeanFred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeanFred/subscriptions","organizations_url":"https://api.github.com/users/JeanFred/orgs","repos_url":"https://api.github.com/users/JeanFred/repos","events_url":"https://api.github.com/users/JeanFred/events{/privacy}","received_events_url":"https://api.github.com/users/JeanFred/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/feature_idea","name":"feature_idea","color":"006b75"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-03T12:01:43Z","updated_at":"2015-04-23T19:56:17Z","closed_at":null,"body":"Issue Type:  Bug Report / Feature Idea\r\n\r\nAnsible Version: 1.8.4\r\n\r\nEnvironment: NA (Ubuntu 12.04 and 14.04)\r\n\r\nSummary: service module failure message should contain more information\r\n\r\nSteps To Reproduce:\r\n`service` module execution fails (as it seems, because of permission issue), but does not give helpful information even in verbose mode.\r\n\r\nPlaybook:\r\n```\r\n- name: Start celerybeat\r\n  service: name=myapp-celerybeat state=restarted\r\n```\r\nExpected Results:\r\n\r\nWhen executing directly on the server ` service myapp-celerybeat restart`, I get the following message:\r\n```\r\ncelery init v10.0.\r\nError: This program can only be used by the root user.\r\n Unpriviliged users must use 'celery beat --detach'\r\n```\r\nI would want Ansible to convey this error to me so I can debug what went wrong with the provisioning.\r\n\r\nActual Results:\r\n```\r\nTASK: [celery_beat | Start celerybeat] **************************************** \r\n<my_server> state=restarted name=myapp-celerybeat\r\n<my_server> ConnectTimeout=10 'sudo -k && sudo -H -S -p \"[sudo via ansible, key=blah] password: \" -u root /bin/sh -c '\"'\"'echo SUDO-SUCCESS-blah; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python'\"'\"'' PasswordAuthentication=no KbdInteractiveAuthentication=no ControlPath=/home/me/.ansible/cp/ansible-ssh-%h-%p-%r PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey StrictHostKeyChecking=no ControlMaster=auto ControlPersist=60s\r\nfailed: [kmy_server] => {\"failed\": true}\r\nmsg: failed determining service state, possible typo of service name?\r\n\r\nFATAL: all hosts have already failed -- aborting\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/95700016","html_url":"https://github.com/ansible/ansible-modules-core/issues/882#issuecomment-95700016","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/882","id":95700016,"user":{"login":"JeanFred","id":364381,"avatar_url":"https://avatars.githubusercontent.com/u/364381?v=3","gravatar_id":"","url":"https://api.github.com/users/JeanFred","html_url":"https://github.com/JeanFred","followers_url":"https://api.github.com/users/JeanFred/followers","following_url":"https://api.github.com/users/JeanFred/following{/other_user}","gists_url":"https://api.github.com/users/JeanFred/gists{/gist_id}","starred_url":"https://api.github.com/users/JeanFred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeanFred/subscriptions","organizations_url":"https://api.github.com/users/JeanFred/orgs","repos_url":"https://api.github.com/users/JeanFred/repos","events_url":"https://api.github.com/users/JeanFred/events{/privacy}","received_events_url":"https://api.github.com/users/JeanFred/received_events","type":"User","site_admin":false},"created_at":"2015-04-23T19:56:17Z","updated_at":"2015-04-23T19:56:17Z","body":"Ping. :-) Any chance for this ?"}}