# Service module and RC files (FreeBSD)

**URL:** <https://forum.ansible.com/t/service-module-and-rc-files-freebsd/15536>\
**Category:** Ansible Project\
**Created:** [June 24, 2014, 7:29pm UTC](https://forum.ansible.com/t/service-module-and-rc-files-freebsd/15536 "2014-06-24T19:29:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominik\_Kolowski](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@Dominik\_Kolowski](https://forum.ansible.com/u/Dominik_Kolowski)\
**Post date:** [June 24, 2014, 7:29pm UTC](https://forum.ansible.com/t/service-module-and-rc-files-freebsd/15536/1 "2014-06-24T19:29:18Z")

</div>

Hello,

I’m using Ansible since the very begining to manage my farm of FreeBSD based servers. Some time ago I have spotted a problem, I can’t actually understand, related to service module of Ansible. According to the source code of service module it can use three system files as rcfiles in this order:

1. /etc/rc.conf
2. /etc/rc.conf.local
3. /usr/local/etc/rc.conf

As I understand from this snippet of code:

`

rcfiles = [‘/etc/rc.conf’,‘/etc/rc.conf.local’, ‘/usr/local/etc/rc.conf’]  
for rcfile in rcfiles:  
if os.path.isfile(rcfile):  
self.rcconf\_file = rcfile

`

Since I use /etc/rc.conf.local file to manage system related things such as interface configuration and so on. I would like Ansible and it’s service module to append changes related to Ansible managed services to /etc/rc.conf file. The file exists as an empty file and is writeable, however everytime I run a playbook to enable some sort of service everything goes straight to /etc/rc.conf.local which is confusing. Is there any way to “force” Ansible to append all of the service enabled stuff to /etc/rc.conf instead of /etc/rc.conf.local? It used to work as I expect it to a few releases back, now it doesn’t.

I would really appreciate any of your help.

Dominik

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [June 25, 2014, 2:07am UTC](https://forum.ansible.com/t/service-module-and-rc-files-freebsd/15536/2 "2014-06-25T02:07:13Z")

</div>

As written the code will make the last file it finds in that sequence the 'rcconf\_file; it will use, not the first as it does not end the for loop on assignment.

I believe this is done to use the most ‘local’ file.​
