mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-08 02:58:29 +03:00
* Mask systemd swap.target do disable swap This is a more generic way to disable swap, since it pulls .swap units in systemd distributions; fstab is only one way to generate .swap units. * Unconditionally disable swap We only care to disable it (the "swapon" registered variable is not used anywhere else. This allows to get rid of the ignore_errors, since this was added because swapon.stdout does not exist in check_mode (see issue #6642). * Don't explicitly disable swapOnZram We're already masking the swap.target, which would pull the zram unit, hence no need to handle zram-generator specifically.
9 lines
171 B
YAML
9 lines
171 B
YAML
---
|
|
- name: Mask swap.target (persist swapoff)
|
|
ansible.builtin.systemd_service:
|
|
name: swap.target
|
|
masked: true
|
|
|
|
- name: Disable swap
|
|
command: /sbin/swapoff -a
|