Using ansible inside docker

Does anyone use ansible inside docker? We have for a while now, and we’ve had nothing but trouble with ansible’s service module and docker’s inability to run upstart.

Ansible 1.9 onwards seems to prefer using initctl over service, which in Docker is symlinked to /bin/true and so fails silently. Whereas service works fine, since it will default to sysv scripts if upstart isn’t available. Is there a specific reason that ansible prefers initctl?

Is it worth putting in a PR to detect this use-case specifically (initctl being symlinked to bin/true)? Or would a better fix be to let the user explicitly define a service module somehow?

check with 2.0, the service module had issues detecting the correct
service system inside docker because of how docker setup things, we
fixed several corner cases in the latest version of the service
module.

it might have worked 'better' in older versions as detection failed in
other ways even in non docker environments but in ways that worked for
you.

if you still have issues please open a github ticket and provide the
simplest reproducible case possible.