Ansible reporting wrong service status

11 views
Skip to first unread message

Sidh

unread,
Feb 8, 2018, 10:26:07 AM2/8/18
to Ansible Project
Ansible - 2.4

With below snippet, service failed to start at remote host but ansible reports that lighttpd service has been restarted and ok. 
 

################
    - name: lighttpd config file
      template:
        src: lighttpd.conf.j2
        dest: /etc/lighttpd/lighttpd.conf
        owner: root
        group: root
        mode: 0644
      notify: Restart lighttpd

 handlers:
    - name: Restart lighttpd
      become: true
      service: name=lighttpd state=restarted

############


Note: It's happening with lighttpd only.

RUNNING HANDLER [Restart lighttpd] ***********************************************************************************************************************************************************
changed: [HOSTNAME]


Kai Stian Olstad

unread,
Feb 8, 2018, 11:49:52 AM2/8/18
to ansible...@googlegroups.com
The init system on the host is reporting OK(return code 0) so Ansible says everything is OK.
If that's not correct then you need to fix the init file/configuration.


--
Kai Stian Olstad

Sidh

unread,
Feb 9, 2018, 8:17:05 AM2/9/18
to Ansible Project
Thanks for your suggestion.

Regards,
Sidh
Reply all
Reply to author
Forward
0 new messages