Ansible on gentoo linux, with both systemd and openrc installed

This is my first posting here, so pls be kind :wink:

I learn my first steps with ansible for some weeks now and get some issues with the service-module.

As some of you may know, on gentoo linux it is rather common these days to have both systemd and openrc installed at the same time.
systemd as active init-system, and openrc as the “gentoo-default” that is kept there just as a fallback.

So the binaries and tools of both $PS1-systems are installed while only one (in my case systemd) is active and running.

Now when I write a task in ansible that should ensure that service chronyd is running I get back messages that seem openrc-based and not systemd-based.

I discussed these issues on the gentoo-users-ml already:

http://thread.gmane.org/gmane.linux.gentoo.user/279922/focus=280115

(I simply quote the link to open a discussion … I am ready to provide any additional infos if needed)

Maybe this is a case not yet fully considered in the service-module?

I’d be happy to get some pointers or help in here, thanks a lot …

Stefan

check with gentoo devel, fixes to system detection were added as more
and more distros run in 'mixed mode'.

sorry, ansible's devel branch ... not gentoo devel.

oops, groups runs TOFU?

yep, works:

ansible -i inventories/oops_nodes.yml -l hiro.local -m service -a “name=chronyd state=started” all

hiro.local | success >> {
“changed”: false,
“name”: “chronyd”,
“state”: “started”
}

curious for the diffs now :wink:

the relevant changes are in the service module