Snort5121
Snort5121

Reputation: 171

Salt enabling systemctl service using a custom service file

On salt modules how can I enable a custom service, provided a path to the service file.

custom_service:
 service.enable:
  - name: foo
  - path:

Upvotes: 0

Views: 1392

Answers (1)

seshadri_c
seshadri_c

Reputation: 7340

From your question, it appears that you already have the systemd foo.service file on the miniom(s) at the appropriate location, and you would like to enable that service.

Not specific to Saltstack, but when service configuration files are updated, the daemon needs to be reloaded. That can be achieved as below in SLS:

reload-systemd:
  module.run:
    - name: service.systemctl_reload

custom-service:
  service.enabled:
    - name: foo

Note:

If the service configuration file isn't on the minion at the required path, then you can use module such as file.managed to place it there.

Upvotes: 1

Related Questions