Pārlūkot izejas kodu

Add linux.system.directory state

Change-Id: Ida91f545cc705457d1bc567fbee483e14a202a3a
pull/128/head
Filip Pytloun pirms 7 gadiem
vecāks
revīzija
8b2131eeec
4 mainītis faili ar 34 papildinājumiem un 0 dzēšanām
  1. +13
    -0
      README.rst
  2. +15
    -0
      linux/system/directory.sls
  3. +3
    -0
      linux/system/init.sls
  4. +3
    -0
      tests/pillar/system.sls

+ 13
- 0
README.rst Parādīt failu

@@ -328,6 +328,19 @@ Systemd settings:
DefaultLimitCPU: 2
DefaultLimitNPROC: 4

Ensure presence of directory:

.. code-block:: yaml

linux:
system:
directory:
/tmp/test:
user: root
group: root
mode: 700
makedirs: true

Kernel
~~~~~~


+ 15
- 0
linux/system/directory.sls Parādīt failu

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

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

{{ dir.name|default(name) }}:
file.directory:
{%- if dir %}
{%- for key, value in dir.iteritems() %}
- {{ key }}: {{ value }}
{%- endfor %}
{%- else %}
- name: {{ name }}
{%- endif %}

{%- endfor %}

+ 3
- 0
linux/system/init.sls Parādīt failu

@@ -96,3 +96,6 @@ include:
{%- if system.systemd is defined %}
- linux.system.systemd
{%- endif %}
{%- if system.directory is defined %}
- linux.system.directory
{%- endif %}

+ 3
- 0
tests/pillar/system.sls Parādīt failu

@@ -7,6 +7,9 @@ linux:
environment: prd
hostname: system.pillar.local
purge_repos: true
directory:
/tmp/test:
makedirs: true
apparmor:
enabled: false
haveged:

Notiek ielāde…
Atcelt
Saglabāt