Browse Source

Add option to disable automatic write of sysfs attributes

Fixes: PROD-23149 (PROD:23149)

Change-Id: I14c68a0a519a63951571f966fae72fd01ec2e556
pull/138/merge
Martin Polreich 6 years ago
parent
commit
148e1b89ed
3 changed files with 24 additions and 0 deletions
  1. +16
    -0
      README.rst
  2. +7
    -0
      linux/system/sysfs.sls
  3. +1
    -0
      tests/pillar/system.sls

+ 16
- 0
README.rst View File

@@ -805,6 +805,22 @@ Optional: You can also use list that will ensure order of items.
power/state: "root:power"
- devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave

Sysfs definition with disabled automatic write. Attributes are saved
to configuration, but are not applied during the run.
Thay will be applied automatically after the reboot.


.. code-block:: yaml

linux:
system:
sysfs:
enable_apply: false
scheduler:
block/sda/queue/scheduler: deadline

.. note:: The `enable_apply` parameter defaults to `True` if not defined.

Huge Pages
~~~~~~~~~~~~


+ 7
- 0
linux/system/sysfs.sls View File

@@ -11,6 +11,8 @@ linux_sysfs_package:
- require:
- pkg: linux_sysfs_package

{% set apply = system.get('sysfs', {}).pop('enable_apply', True) %}

{%- for name, sysfs in system.get('sysfs', {}).items() %}

/etc/sysfs.d/{{ name }}.conf:
@@ -32,6 +34,8 @@ linux_sysfs_package:
{%- set sysfs_list = sysfs %}
{%- endif %}

{%- if apply %}

{%- for item in sysfs_list %}
{%- set list_idx = loop.index %}
{%- for key, value in item.items() %}
@@ -48,4 +52,7 @@ linux_sysfs_write_{{ list_idx }}_{{ name }}_{{ key }}:
{%- endfor %}

{%- endfor %}

{%- endif %}

{%- endfor %}

+ 1
- 0
tests/pillar/system.sls View File

@@ -99,6 +99,7 @@ linux:
subjects:
- '@group1'
sysfs:
enable_apply: true
scheduler:
block/sda/queue/scheduler: deadline
power:

Loading…
Cancel
Save