How to detect whether the init system is systemd or not in a module?

Hi,

In the hostname module http://docs.ansible.com/ansible/hostname_module.html
I'd like to detect whether the init system is systemd or not in a module.
https://github.com/ansible/ansible-modules-core/issues/573#issuecomment-235756879

How can I do that?

I found the method get_service_mgr_facts method in Facts class.
https://github.com/ansible/ansible/blob/123d54e736520c59d8c7afdcb1c6526df501b174/lib/ansible/module_utils/facts.py#L351-L400

Is this usable from a module?

Thanks!
Hiroaki

Before I sent my previous post, I read
http://unix.stackexchange.com/a/278965
and thought I could use python popen2 or AnsibleModule.run_command
with the command
ps -p 1 -o comm=

# ps -p 1 -o comm=
systemd

Then I found
I found the method get_service_mgr_facts method in Facts class.
https://github.com/ansible/ansible/blob/123d54e736520c59d8c7afdcb1c6526df501b174/lib/ansible/module_utils/facts.py#L351-L400
and I thought it may be better to use it if it is usable from a module.