{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/952","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/952/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/952/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/952/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/952","id":62354196,"number":952,"title":"No error reported when service state=reloaded fails","user":{"login":"mhogerheijde","id":1466140,"avatar_url":"https://avatars.githubusercontent.com/u/1466140?v=3","gravatar_id":"","url":"https://api.github.com/users/mhogerheijde","html_url":"https://github.com/mhogerheijde","followers_url":"https://api.github.com/users/mhogerheijde/followers","following_url":"https://api.github.com/users/mhogerheijde/following{/other_user}","gists_url":"https://api.github.com/users/mhogerheijde/gists{/gist_id}","starred_url":"https://api.github.com/users/mhogerheijde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhogerheijde/subscriptions","organizations_url":"https://api.github.com/users/mhogerheijde/orgs","repos_url":"https://api.github.com/users/mhogerheijde/repos","events_url":"https://api.github.com/users/mhogerheijde/events{/privacy}","received_events_url":"https://api.github.com/users/mhogerheijde/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-17T10:19:56Z","updated_at":"2015-04-27T19:54:31Z","closed_at":"2015-04-27T19:30:25Z","body":"Re-report of https://github.com/ansible/ansible/issues/9108 \r\n\r\n##### Issue Type:\r\n\r\nBug Report\r\n\r\n##### Ansible Version:\r\n\r\n    $ ansible --version\r\n    ansible 1.8.4\r\n      configured module search path = /usr/share/ansible:library\r\n\r\n##### Environment:\r\n\r\nControlling machine is Ubuntu 14.10, \r\n\r\n    $ lsb_release -a\r\n    LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:\r\n                    core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:\r\n                    core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:\r\n                    core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:\r\n                    cxx-3.0-amd64:cxx-3.0-noarch:cxx-3.1-amd64:\r\n                    cxx-3.1-noarch:cxx-3.2-amd64:cxx-3.2-noarch:\r\n                    cxx-4.0-amd64:cxx-4.0-noarch:cxx-4.1-amd64:\r\n                    cxx-4.1-noarch:desktop-3.1-amd64:desktop-3.1-noarch:\r\n                    desktop-3.2-amd64:desktop-3.2-noarch:desktop-4.0-amd64:\r\n                    desktop-4.0-noarch:desktop-4.1-amd64:desktop-4.1-noarch:\r\n                    graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.0-amd64:\r\n                    graphics-3.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch:\r\n                    graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:\r\n                    graphics-4.0-noarch:graphics-4.1-amd64:graphics-4.1-noarch:\r\n                    languages-3.2-amd64:languages-3.2-noarch:languages-4.0-amd64:\r\n                    languages-4.0-noarch:languages-4.1-amd64:languages-4.1-noarch:\r\n                    multimedia-3.2-amd64:multimedia-3.2-noarch:multimedia-4.0-amd64:\r\n                    multimedia-4.0-noarch:multimedia-4.1-amd64:multimedia-4.1-noarch:\r\n                    printing-3.2-amd64:printing-3.2-noarch:printing-4.0-amd64:\r\n                    printing-4.0-noarch:printing-4.1-amd64:printing-4.1-noarch:\r\n                    qt4-3.1-amd64:qt4-3.1-noarch:security-4.0-amd64:\r\n                    security-4.0-noarch:security-4.1-amd64:security-4.1-noarch\r\n    Distributor ID: Ubuntu\r\n    Description:    Ubuntu 14.10\r\n    Release:        14.10\r\n    Codename:       utopic\r\n\r\ncontrolled is Ubuntu 14.04.1\r\n\r\n    $ lsb_release -a\r\n    No LSB modules are available.\r\n    Distributor ID: Ubuntu\r\n    Description:    Ubuntu 14.04.1 LTS\r\n    Release:        14.04\r\n    Codename:       trusty\r\n\r\n##### Summary:\r\n\r\nErrors produced by syntactically invalid modifications to nginx.conf are not reported in playbook output on service start/restart/reload, the task is instead marked as changed. Probably this is not specific to Nginx.\r\n\r\n##### Steps To Reproduce\r\n\r\n    tasks:\r\n    - name:   nginx is installed\r\n      action: apt name=nginx\r\n    \r\n    - name:   nginx.conf is in place\r\n      action: copy content='?.=x)@+!+!%+' dest=/etc/nginx/nginx.conf\r\n      notify: restart nginx\r\n    \r\n    handlers:\r\n    \r\n    - name:   restart nginx\r\n      action: service name=nginx state=reloaded\r\n\r\n##### Expected Results:\r\n\r\nThe handler reports an error.\r\n\r\n##### Actual Results:\r\n\r\nThe handler reports a change.\r\n\r\n##### Additional:\r\n\r\nThat was the initial report, updated with currently used version by myself.\r\n\r\nThe problem actually exist due to both `serivce nginx reload` and `service nginx configtest` exit with `0` in stead of a non-zero value.\r\n\r\nI _know_ that Ansible is not responsible for that, but for things as specific as the `service` module, I expect it to see the \"fail!\" in stdout and pick that up and report an error.\r\n\r\nThis behaviour is similar with `haproxy`."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/96796378","html_url":"https://github.com/ansible/ansible-modules-core/issues/952#issuecomment-96796378","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/952","id":96796378,"user":{"login":"jooadam","id":1663843,"avatar_url":"https://avatars.githubusercontent.com/u/1663843?v=3","gravatar_id":"","url":"https://api.github.com/users/jooadam","html_url":"https://github.com/jooadam","followers_url":"https://api.github.com/users/jooadam/followers","following_url":"https://api.github.com/users/jooadam/following{/other_user}","gists_url":"https://api.github.com/users/jooadam/gists{/gist_id}","starred_url":"https://api.github.com/users/jooadam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jooadam/subscriptions","organizations_url":"https://api.github.com/users/jooadam/orgs","repos_url":"https://api.github.com/users/jooadam/repos","events_url":"https://api.github.com/users/jooadam/events{/privacy}","received_events_url":"https://api.github.com/users/jooadam/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T19:54:31Z","updated_at":"2015-04-27T19:54:31Z","body":"Here’s the bug report, please vote: https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1413555 "}}