# Ansible service not work

**URL:** <https://forum.ansible.com/t/ansible-service-not-work/29611>\
**Category:** AWX Project\
**Created:** [February 4, 2019, 3:28pm UTC](https://forum.ansible.com/t/ansible-service-not-work/29611 "2019-02-04T15:28:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [February 4, 2019, 3:28pm UTC](https://forum.ansible.com/t/ansible-service-not-work/29611/1 "2019-02-04T15:28:24Z")

</div>

Hy,

I want start one service with next command in ansible :

```auto
- name: Start service httpd, if not started
  service:
    name: httpd
    state: started

```

```auto
This task not work even with line command become: yes ! on the other hand the next command works :

```

---

<div class="post-metadata">

**Author:** ![Darkhan](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Darkhan](https://forum.ansible.com/u/Darkhan)\
**Post date:** [February 4, 2019, 3:40pm UTC](https://forum.ansible.com/t/ansible-service-not-work/29611/2 "2019-02-04T15:40:12Z")

</div>

The service module uses init. Since I see systemctl works for you, you are not using init to manage your services but systemd. There is another ansible module for that:  
[https://docs.ansible.com/ansible/latest/modules/systemd\_module.html](https://docs.ansible.com/ansible/latest/modules/systemd_module.html)

---

<div class="post-metadata">

**Author:** ![David\_Maple](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@David\_Maple](https://forum.ansible.com/u/David_Maple)\
**Post date:** [February 4, 2019, 10:05pm UTC](https://forum.ansible.com/t/ansible-service-not-work/29611/3 "2019-02-04T22:05:57Z")

</div>

Are you using Ansible AWX? Can you provide the error message out output from this task?

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [February 5, 2019, 1:51pm UTC](https://forum.ansible.com/t/ansible-service-not-work/29611/4 "2019-02-05T13:51:02Z")

</div>

If this is an ansible issue you are better off seeking answers from the Ansible mailing list or IRC channel.
