Преглед изворни кода

Add journal settings (#210)

* Added journal settings

* Fixed error:
    ----------
                 ID: package_duo
           Function: pkg.installed
               Name: duo-unix
             Result: False
            Comment: Problem encountered installing package(s). Additional info follows:
              errors:
                  - E: There were unauthenticated packages and -y was used without --allow-unauthenticated

* Removed 2016 system checks as it doesn't support path_join and added 2019 version checks
pull/214/head
marek-knappe пре 5 година
родитељ
комит
e51a9b2fbf
5 измењених фајлова са 47 додато и 1 уклоњено
  1. +12
    -0
      README.rst
  2. +6
    -0
      linux/files/journal.conf
  3. +25
    -0
      linux/system/journal.sls
  4. +4
    -0
      linux/system/systemd.sls
  5. +0
    -1
      tests/pillar/system.sls

+ 12
- 0
README.rst Прегледај датотеку

@@ -430,6 +430,18 @@ Systemd settings:
DefaultLimitCPU: 2
DefaultLimitNPROC: 4

Systemd journal settings:

.. code-block:: yaml

linux:
system:
...
systemd:
journal:
SystemMaxUse: "50M"
RuntimeMaxFiles: "100"
Ensure presence of directory:

.. code-block:: yaml

+ 6
- 0
linux/files/journal.conf Прегледај датотеку

@@ -0,0 +1,6 @@
{%- from "linux/map.jinja" import system with context -%}
#This file is managed by salt
[Journal]
{%- for option, value in settings.items() %}
{{ option }}={{ value }}
{%- endfor -%}

+ 25
- 0
linux/system/journal.sls Прегледај датотеку

@@ -0,0 +1,25 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled and grains.get('init', None) == 'systemd' %}

{%- if system.systemd.journal is defined %}

linux_systemd_journal_config:
file.managed:
- name: /etc/systemd/journald.conf.d/90-salt.conf
- source: salt://linux/files/journal.conf
- template: jinja
- makedirs: True
- defaults:
settings: {{ system.systemd.journal|tojson }}
- watch_in:
- module: linux_journal_systemd_reload

linux_journal_systemd_reload:
module.wait:
- name: service.restart
- m_name: systemd-journald
- require:
- module: service.systemctl_reload

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

+ 4
- 0
linux/system/systemd.sls Прегледај датотеку

@@ -1,5 +1,9 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled and grains.get('init', None) == 'systemd' %}
{%- if system.systemd.journal is defined %}
include:
- linux.system.journal
{%- endif %}

{%- if system.systemd.system is defined %}
linux_systemd_system_config:

+ 0
- 1
tests/pillar/system.sls Прегледај датотеку

@@ -458,7 +458,6 @@ linux:
- host1
- host2
- .local

# pillars for netconsole setup
netconsole:
enabled: true

Loading…
Откажи
Сачувај