# Extending the system/svc module

**URL:** <https://forum.ansible.com/t/extending-the-system-svc-module/24934>\
**Category:** Ansible Developer\
**Created:** [July 8, 2017, 6:57pm UTC](https://forum.ansible.com/t/extending-the-system-svc-module/24934 "2017-07-08T18:57:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![taca](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@taca](https://forum.ansible.com/u/taca)\
**Post date:** [July 8, 2017, 6:57pm UTC](https://forum.ansible.com/t/extending-the-system-svc-module/24934/1 "2017-07-08T18:57:23Z")

</div>

Hello,

I'm interested in extending the svc module for nosh (and possibly other  
daemontools family toolsets) and have a couple of questions/observations.

A. current svc extension issues

---

<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:** [July 10, 2017, 8:50pm UTC](https://forum.ansible.com/t/extending-the-system-svc-module/24934/2 "2017-07-10T20:50:24Z")

</div>

I initially wrote the svc module with those extensions in mind, but  
the runit was done as a copy instead ... im fine with refactoring to  
fix this or just create a set of modules that deal with each fork.

As for 'service', the module itself is deprecated, its now an 'action  
plugin' which chooses the underlying module to execute. This still  
relies on autodetection but can also be done via a `use` option to  
force a specific module, basic options must be compatible with service  
though.

---

<div class="post-metadata">

**Author:** ![taca](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@taca](https://forum.ansible.com/u/taca)\
**Post date:** [July 11, 2017, 11:45pm UTC](https://forum.ansible.com/t/extending-the-system-svc-module/24934/3 "2017-07-11T23:45:53Z")

</div>

Hello,

> I initially wrote the svc module with those extensions in mind, but  
> the runit was done as a copy instead ... im fine with refactoring to  
> fix this or just create a set of modules that deal with each fork.

Ok great, I'll try extend via the svc module then.

For the subclassing mechanism, because the Svc class is only used with  
`svc = Svc(module)`, I simplified the signature to:

&nbsp;&nbsp;\_load\_dist\_subclass(cls, module)

So that one can then just assign `distro` like this:

&nbsp;&nbsp;distro = module.params['distro']

Incidentally, is there any preference between calling that parameter  
"distro" or "dist"? Or something else like "manager"?

> As for 'service', the module itself is deprecated, its now an 'action  
> plugin' which chooses the underlying module to execute. This still  
> relies on autodetection but can also be done via a `use` option to  
> force a specific module, basic options must be compatible with service  
> though.

Thanks, I will look at that.

Regards,  
taca

---

<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:** [July 12, 2017, 2:32am UTC](https://forum.ansible.com/t/extending-the-system-svc-module/24934/4 "2017-07-12T02:32:35Z")

</div>

Use whatever name makes the most sense.
