Using ansible inside docker

32 views
Skip to first unread message

le...@vivait.co.uk

unread,
Nov 18, 2015, 11:59:28 AM11/18/15
to Ansible Project
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?

Brian Coca

unread,
Nov 20, 2015, 3:07:50 PM11/20/15
to Ansible Project
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.

--
Brian Coca
Reply all
Reply to author
Forward
0 new messages