# Ansible on gentoo linux, with both systemd and openrc installed

**URL:** <https://forum.ansible.com/t/ansible-on-gentoo-linux-with-both-systemd-and-openrc-installed/17345>\
**Category:** Ansible Project\
**Created:** [January 21, 2015, 8:37pm UTC](https://forum.ansible.com/t/ansible-on-gentoo-linux-with-both-systemd-and-openrc-installed/17345 "2015-01-21T20:37:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Weichinger](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@Stefan\_Weichinger](https://forum.ansible.com/u/Stefan_Weichinger)\
**Post date:** [January 21, 2015, 8:37pm UTC](https://forum.ansible.com/t/ansible-on-gentoo-linux-with-both-systemd-and-openrc-installed/17345/1 "2015-01-21T20:37:04Z")

</div>

This is my first posting here, so pls be kind 😉

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](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

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 21, 2015, 8:39pm UTC](https://forum.ansible.com/t/ansible-on-gentoo-linux-with-both-systemd-and-openrc-installed/17345/2 "2015-01-21T20:39:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 21, 2015, 8:40pm UTC](https://forum.ansible.com/t/ansible-on-gentoo-linux-with-both-systemd-and-openrc-installed/17345/3 "2015-01-21T20:40:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Stefan\_Weichinger](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@Stefan\_Weichinger](https://forum.ansible.com/u/Stefan_Weichinger)\
**Post date:** [January 21, 2015, 8:51pm UTC](https://forum.ansible.com/t/ansible-on-gentoo-linux-with-both-systemd-and-openrc-installed/17345/4 "2015-01-21T20:51:12Z")

</div>

oops, groups runs TOFU?

---

<div class="post-metadata">

**Author:** ![Stefan\_Weichinger](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@Stefan\_Weichinger](https://forum.ansible.com/u/Stefan_Weichinger)\
**Post date:** [January 21, 2015, 8:58pm UTC](https://forum.ansible.com/t/ansible-on-gentoo-linux-with-both-systemd-and-openrc-installed/17345/5 "2015-01-21T20:58:50Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 21, 2015, 9:58pm UTC](https://forum.ansible.com/t/ansible-on-gentoo-linux-with-both-systemd-and-openrc-installed/17345/6 "2015-01-21T21:58:44Z")

</div>

the relevant changes are in the service module
