Explorar el Código

Add linux.system.directory state

Change-Id: Ida91f545cc705457d1bc567fbee483e14a202a3a
pull/128/head
Filip Pytloun hace 7 años
padre
commit
8b2131eeec
Se han modificado 4 ficheros con 34 adiciones y 0 borrados
  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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar