Initial commit

This commit is contained in:
Waffles
2022-12-21 22:30:01 -08:00
commit 19ebda26b4
47 changed files with 1429 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
- name: set swap_file variable
set_fact:
swap_file: /{{ swap_space }}.swap
- name: check if swap file exists
stat:
path: "{{ swap_file }}"
register: swap_file_check
- name: create swap file
command: fallocate -l {{ swap_space }} {{ swap_file }}
args:
creates: /{{ swap_file }}
- name: set permissions on swap file
file:
path: "{{ swap_file }}"
mode: 0600
- name: format swap file
command: mkswap {{ swap_file }}
when: not swap_file_check.stat.exists
- name: add to fstab
lineinfile:
dest: /etc/fstab
regexp: "{{ swap_file }}"
line: "{{ swap_file }} none swap sw 0 0"
- name: turn on swap
command: swapon -a
- name: set swapiness
sysctl:
name: vm.swappiness
value: "1"