disable swap.target too
This commit is contained in:
parent
8fdc94a9c3
commit
85ab740062
@ -1,17 +1,23 @@
|
|||||||
|
- name: Disable swap in fstab
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: /etc/fstab
|
||||||
|
regexp: '^.*swap.*$'
|
||||||
|
replace: '# \0'
|
||||||
|
backup: true
|
||||||
|
|
||||||
|
- name: Disable swap.target
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: swap.target
|
||||||
|
state: stopped
|
||||||
|
enabled: false
|
||||||
|
masked: true
|
||||||
|
|
||||||
- name: Disable swap for current session
|
- name: Disable swap for current session
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: swapoff -a
|
cmd: swapoff -a
|
||||||
register: swap_off
|
register: swap_off
|
||||||
changed_when: swap_off.rc == 0
|
changed_when: swap_off.rc == 0
|
||||||
failed_when: swap_off.rc != 0
|
failed_when: swap_off.rc != 0
|
||||||
become: true
|
|
||||||
|
|
||||||
- name: Disable swap
|
|
||||||
ansible.builtin.replace:
|
|
||||||
path: /etc/fstab
|
|
||||||
regexp: '^.*swap.*$'
|
|
||||||
replace: '# \0'
|
|
||||||
backup: true
|
|
||||||
|
|
||||||
- name: Ensure /etc/apt/keyrings directory exists
|
- name: Ensure /etc/apt/keyrings directory exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
Loading…
Reference in New Issue
Block a user