VictoriaMetrics / ansible-playbooks

Ansible Playbooks for Victoria Metrics monorepo
Apache License 2.0
96 stars 33 forks source link

Support openrc init system in roles for alpine #70

Open proffust opened 3 weeks ago

proffust commented 3 weeks ago

Roles currently assume systemd as the init system and contain systemd-specific configuration. This prevents the roles from working properly on hosts using openrc as the init system.

To expand compatibility, the roles should be updated to support both systemd and openrc. For roles that manage services, init scripts should be added and enabled for openrc alongside the existing systemd unit files. Any systemd-specific commands or config files should be adapted to also work with openrc where applicable.

This will allow the roles to deploy successfully to a wider range of hosts without init system limitations. Supporting both major init systems will improve flexibility and reuse of the roles.

tiny-pangolin commented 3 weeks ago

I think the systemd plays could be replaced with the service module which supports systemd and openrc. The ansible_service_mgr fact can be used to decide deploy the correct files to the correct init system