# service module fails to start nginx usig a docker connection

**URL:** <https://forum.ansible.com/t/service-module-fails-to-start-nginx-usig-a-docker-connection/26577>\
**Category:** Ansible Project\
**Created:** [January 28, 2018, 8:23am UTC](https://forum.ansible.com/t/service-module-fails-to-start-nginx-usig-a-docker-connection/26577 "2018-01-28T08:23:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_Decrop](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@Ruben\_Decrop](https://forum.ansible.com/u/Ruben_Decrop)\
**Post date:** [January 28, 2018, 8:23am UTC](https://forum.ansible.com/t/service-module-fails-to-start-nginx-usig-a-docker-connection/26577/1 "2018-01-28T08:23:07Z")

</div>

I am using ansible to manage a group of Docker containers, using docker\_connection.

All goes well unitl I am instructing nginx to be started in the container using this snippet

`

- name: ensure nginx started  
service:  
name: nginx  
state: started

`

No error message is given but nginx is not started in the container

If I replace it by

`

- name: ensure nginx started  
command: service nginx start

`

it gives a warning to consider using the service module, but it works. Am I doing somethnig wrong, or is this a kind of weird bug?

---

<div class="post-metadata">

**Author:** ![Varun\_Chopra](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@Varun\_Chopra](https://forum.ansible.com/u/Varun_Chopra)\
**Post date:** [January 28, 2018, 4:51pm UTC](https://forum.ansible.com/t/service-module-fails-to-start-nginx-usig-a-docker-connection/26577/2 "2018-01-28T16:51:30Z")

</div>

Run both using -vvvv and post the outputs here.
