浏览代码

Add linux.system.directory state

Change-Id: Ida91f545cc705457d1bc567fbee483e14a202a3a
pull/128/head
Filip Pytloun 7 年前
父节点
当前提交
8b2131eeec
共有 4 个文件被更改,包括 34 次插入0 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

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

正在加载...
取消
保存