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

remove moved files

parent ba270e06
include:
- runit.install
- runit.service
runit_pkg:
pkg.installed:
- name: runit
runit_service_directory:
file.directory:
- name: /var/service
- require:
- pkg: runit_pkg
################
# STOP SERVICE #
################
{% macro stop_service(name) -%}
{% set service = '/var/service' | path_join(name) %}
{{ name }}_stop_service:
cmd.run:
- name: sv down {{ service }}
- onlyif:
- test -d {{ service }}
{%- endmacro %}
#################
# START SERVICE #
#################
{% macro start_service(name) -%}
{% set service = '/var/service' | path_join(name) %}
{{ name }}_start_service:
file.managed:
- name: {{ service | path_join('run') }}
- mode: 754
cmd.run:
- name: sv up {{ service }}
- onlyif:
- test -d {{ service }}
- test -p {{ service | path_join('supervise', 'ok') }}
- require:
- file: {{ name }}_start_service
{%- endmacro %}
###################
# RESTART SERVICE #
###################
{% macro restart_service(name) -%}
{% set service = '/var/service' | path_join(name) %}
{{ name }}_restart_service:
cmd.run:
- name: sv restart {{ service }}
- onlyif:
- test -d {{ service }}
{%- endmacro %}
##################
# SIGNAL SERVICE #
##################
{% macro signal_service(name, signal='hup') -%}
{% set service = '/var/service' | path_join(name) %}
{{ name }}_signal_service:
cmd.run:
- name: sv {{ signal }} {{ service }}
- onlyif:
- test -d {{ service }}
{%- endmacro %}
##################
# REMOVE SERVICE #
##################
{% macro remove_service(name) -%}
{% set service = '/var/service' | path_join(name) %}
{{ name }}_remove_service:
file.absent:
- name: {{ service }}
{%- endmacro %}
include:
- runit.install
runit_runsvdir:
service.running:
- name: runsvdir
- enable: True
- watch:
- pkg: runit_pkg
- file: runit_service_directory
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