ソースを参照

add service management support

Change-Id: Iffb55fee41b8398de12554b58a9d36ae2b81e7ff
pull/101/head
Marek Celoud 7年前
コミット
713e907ac4
3個のファイルの変更34行の追加0行の削除
  1. +15
    -0
      README.rst
  2. +3
    -0
      linux/system/init.sls
  3. +16
    -0
      linux/system/service.sls

+ 15
- 0
README.rst ファイルの表示

@@ -601,6 +601,21 @@ day. Setting custom motd will cleanup existing ones.
printf "This is [company name] network.\n"
printf "Unauthorized access strictly prohibited.\n"

Services
~~~~~~~~

Stop and disable linux service:

.. code-block:: yaml

linux:
system:
service:
apt-daily.timer:
status: dead

Possible status is dead (disable service by default), running (enable service by default), enabled, disabled.

RHEL / CentOS
^^^^^^^^^^^^^


+ 3
- 0
linux/system/init.sls ファイルの表示

@@ -80,3 +80,6 @@ include:
{%- if system.netconsole is defined %}
- linux.system.netconsole
{%- endif %}
{%- if system.service is defined %}
- linux.system.service
{%- endif %}

+ 16
- 0
linux/system/service.sls ファイルの表示

@@ -0,0 +1,16 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}

{%- for name, service in system.service.iteritems() %}

linux_service_{{ name }}:
service.{{ service.status }}:
{%- if service.status == 'dead' %}
- enable: {{ service.get('enabled', False) }}
{%- elif service.status == 'running' %}
- enable: {{ service.get('enabled', True) }}
{%- endif %}
- name: {{ name }}

{%- endfor %}
{%- endif %}

読み込み中…
キャンセル
保存