Browse Source

Merge "Add option to disable automatic write of sysfs attributes"

pull/138/merge
mcp-jenkins 6 years ago
parent
commit
5bcad94f82
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

power/state: "root:power" power/state: "root:power"
- devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave - 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 Huge Pages
~~~~~~~~~~~~ ~~~~~~~~~~~~



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

- require: - require:
- pkg: linux_sysfs_package - pkg: linux_sysfs_package


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

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


/etc/sysfs.d/{{ name }}.conf: /etc/sysfs.d/{{ name }}.conf:
{%- set sysfs_list = sysfs %} {%- set sysfs_list = sysfs %}
{%- endif %} {%- endif %}


{%- if apply %}

{%- for item in sysfs_list %} {%- for item in sysfs_list %}
{%- set list_idx = loop.index %} {%- set list_idx = loop.index %}
{%- for key, value in item.items() %} {%- for key, value in item.items() %}
{%- endfor %} {%- endfor %}


{%- endfor %} {%- endfor %}

{%- endif %}

{%- endfor %} {%- endfor %}

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

subjects: subjects:
- '@group1' - '@group1'
sysfs: sysfs:
enable_apply: true
scheduler: scheduler:
block/sda/queue/scheduler: deadline block/sda/queue/scheduler: deadline
power: power:

Loading…
Cancel
Save