service module fails to start nginx usig a docker connection

5 views
Skip to first unread message

Ruben Decrop

unread,
Jan 28, 2018, 3:23:07 AM1/28/18
to Ansible Project
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?

Varun Chopra

unread,
Jan 28, 2018, 11:51:31 AM1/28/18
to Ansible Project
Run both using -vvvv and post the outputs here.
Reply all
Reply to author
Forward
0 new messages