Commit fb45f8b8 authored by Julien Cigar's avatar Julien Cigar 🤘
Browse files

remove hardcoded service path

parent 5db9d852
{% from "runit/map.jinja" import runit with context %}
################ ################
# STOP SERVICE # # STOP SERVICE #
################ ################
{% macro stop_service(name) -%} {% macro stop_service(name) -%}
{% set service = '/var/service' | path_join(name) %} {% set service = runit.service_dir | path_join(name) %}
{{ name }}_stop_service: {{ name }}_stop_service:
cmd.run: cmd.run:
- name: sv down {{ service }} - name: sv down {{ service }}
...@@ -16,7 +18,7 @@ ...@@ -16,7 +18,7 @@
################# #################
{% macro start_service(name) -%} {% macro start_service(name) -%}
{% set service = '/var/service' | path_join(name) %} {% set service = runit.service_dir | path_join(name) %}
{{ name }}_start_service: {{ name }}_start_service:
file.managed: file.managed:
- name: {{ service | path_join('run') }} - name: {{ service | path_join('run') }}
...@@ -35,7 +37,7 @@ ...@@ -35,7 +37,7 @@
################### ###################
{% macro restart_service(name) -%} {% macro restart_service(name) -%}
{% set service = '/var/service' | path_join(name) %} {% set service = runit.service_dir | path_join(name) %}
{{ name }}_restart_service: {{ name }}_restart_service:
cmd.run: cmd.run:
- name: sv restart {{ service }} - name: sv restart {{ service }}
...@@ -48,7 +50,7 @@ ...@@ -48,7 +50,7 @@
################## ##################
{% macro signal_service(name, signal='hup') -%} {% macro signal_service(name, signal='hup') -%}
{% set service = '/var/service' | path_join(name) %} {% set service = runit.service_dir | path_join(name) %}
{{ name }}_signal_service: {{ name }}_signal_service:
cmd.run: cmd.run:
- name: sv {{ signal }} {{ service }} - name: sv {{ signal }} {{ service }}
...@@ -61,7 +63,7 @@ ...@@ -61,7 +63,7 @@
################## ##################
{% macro remove_service(name) -%} {% macro remove_service(name) -%}
{% set service = '/var/service' | path_join(name) %} {% set service = 'runit.service_dir' | path_join(name) %}
{{ name }}_remove_service: {{ name }}_remove_service:
file.absent: file.absent:
- name: {{ service }} - name: {{ service }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment