Skip to content
Snippets Groups Projects
Commit fd92dda4 authored by jabertwo's avatar jabertwo
Browse files

fstab entry for swap

parent 8b3831d8
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,14 @@ ...@@ -15,6 +15,14 @@
loop: "{{ lookup('dict', drives) }}" loop: "{{ lookup('dict', drives) }}"
when: drives is defined and item.value.fstype != "swap" when: drives is defined and item.value.fstype != "swap"
- name: Ensure swap entry is present in /etc/fstab
ansible.builtin.lineinfile:
path: /etc/fstab
state: present
line: "UUID={{ item.value.uuid }} none swap sw 0 0"
loop: "{{ lookup('dict', drives) }}"
when: drives is defined and item.value.fstype == "swap"
- name: Enable swap partition - name: Enable swap partition
ansible.builtin.command: ansible.builtin.command:
cmd: "swapon UUID={{ item.value.uuid }}" cmd: "swapon UUID={{ item.value.uuid }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment