瀏覽代碼

Merge pull request #215 from kgullion/patch-1

Allow swap to be completely disabled via `swapoff -a`
pull/216/head
Filip Pytloun 4 年之前
父節點
當前提交
7c930699ed
No account linked to committer's email address
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. +10
    -0
      linux/storage/swap.sls

+ 10
- 0
linux/storage/swap.sls 查看文件

@@ -1,6 +1,8 @@
{%- from "linux/map.jinja" import storage with context %}
{%- if storage.enabled %}

{%- if storage.swap.enabled is not defined or storage.swap.enabled %}

{%- for swap_name, swap in storage.swap.items() %}

{%- if swap.enabled %}
@@ -75,4 +77,12 @@ linux_disable_swap_{{ swap.engine }}_{{ swap.device }}:

{%- endfor %}

{%- elif storage.swap.enabled is defined and not storage.swap.enabled %}

linux_disable_swap:
cmd.run:
- name: 'swapoff -a'

{%- endif %}

{%- endif %}

Loading…
取消
儲存