Преглед на файлове

Allow setting policy-rc.d

tags/2016.12
Filip Pytloun преди 9 години
родител
ревизия
7731b8581c
променени са 5 файла, в които са добавени 51 реда и са изтрити 0 реда
  1. +14
    -0
      README.rst
  2. +10
    -0
      linux/files/policy-rc.d
  3. +3
    -0
      linux/system/init.sls
  4. +19
    -0
      linux/system/policyrcd.sls
  5. +5
    -0
      tests/pillar/system.sls

+ 14
- 0
README.rst Целия файл



To disable set autologin to `false`. To disable set autologin to `false`.


Set ``policy-rc.d`` on Debian-based systems. Action can be any available
command in ``while true`` loop and ``case`` context.
Following will disallow dpkg to stop/start services for cassandra package automatically:

.. code-block:: yaml

linux:
system:
policyrcd:
- package: cassandra
action: exit 101
- package: '*'
action: switch

Kernel Kernel
~~~~~~ ~~~~~~



+ 10
- 0
linux/files/policy-rc.d Целия файл

{%- from "linux/map.jinja" import system with context -%}
#!/bin/sh

while true; do
case $1 in
{%- for policy in system.policyrcd %}
{{ policy.package }}) {{ policy.action }};;
{%- endfor %}
esac
done

+ 3
- 0
linux/system/init.sls Целия файл

{%- if system.motd|length > 0 %} {%- if system.motd|length > 0 %}
- linux.system.motd - linux.system.motd
{%- endif %} {%- endif %}
{%- if system.get('policyrcd', [])|length > 0 %}
- linux.system.policyrcd
{%- endif %}

+ 19
- 0
linux/system/policyrcd.sls Целия файл

{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}

policyrcd_file:
file.managed:
- name: /usr/local/sbin/policy-rc.d
- source: salt://linux/files/policy-rc.d
- mode: 655
- template: jinja

policyrcd_alternatives:
alternatives.install:
- name: policy-rc.d
- link: /usr/sbin/policy-rc.d
- path: /usr/local/sbin/policy-rc.d
- require:
- file: policyrcd_file

{%- endif %}

+ 5
- 0
tests/pillar/system.sls Целия файл

opencontrail: opencontrail:
source: "deb http://ppa.launchpad.net/tcpcloud/contrail-2.20/ubuntu trusty main" source: "deb http://ppa.launchpad.net/tcpcloud/contrail-2.20/ubuntu trusty main"
architectures: amd64 architectures: amd64
policyrcd:
- package: cassandra
action: exit 101
- package: '*'
action: switch

Loading…
Отказ
Запис