diff --git a/docs/services/system.md b/docs/services/system.md new file mode 100644 index 0000000..8091cf7 --- /dev/null +++ b/docs/services/system.md @@ -0,0 +1,37 @@ +# System-related configuration + +This Ansible playbook can install and configure various system-related things for you. +All the sections below relate to the host OS instead of the managed containers. + +### swap + +To enable [swap](https://en.wikipedia.org/wiki/Memory_paging) management (also read more in the [Swap](https://wiki.archlinux.org/title/Swap) article in the [Arch Linux Wiki](https://wiki.archlinux.org/)), add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# system # +# # +######################################################################## + +system_swap_enabled: true + +######################################################################## +# # +# /system # +# # +######################################################################## +``` + +A swap file will be created in `/var/swap` (configured using the `system_swap_path` variable) and enabled in your `/etc/fstab` file. + +By default, the swap file will have the following size: + +- on systems with `<= 2GB` of RAM, swap file size = `total RAM * 2` +- on systems with `> 2GB` of RAM, swap file size = `1GB` + +To avoid these calculations and set your own size explicitly, set the `system_swap_size` variable in megabytes, example (4gb): + +```yaml +system_swap_size: 4096 +``` diff --git a/docs/supported-services.md b/docs/supported-services.md index 73f1318..9239b89 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -18,6 +18,7 @@ | [Vaultwarden](https://github.com/dani-garcia/vaultwarden) | A lightweight unofficial and compatible implementation of the [Bitwarden](https://bitwarden.com/) password manager | [Link](services/vaultwarden.md) | | [Uptime-kuma](https://uptime.kuma.pet/) | A fancy self-hosted monitoring tool | [Link](services/uptime-kuma.md) | | [Woodpecker CI](https://woodpecker-ci.org/) | A simple Continuous Integration (CI) engine with great extensibility. | [Link](services/woodpecker-ci.md) | +| System-related | A collection of various system-related components | [Link](services/system.md) | ## Related playbooks diff --git a/group_vars/mash_servers b/group_vars/mash_servers index d761f62..412bc19 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -1,5 +1,22 @@ --- +######################################################################## +# # +# system/swap # +# # +######################################################################## + +system_swap_enabled: false + +######################################################################## +# # +# system/swap # +# # +######################################################################## + + + + ######################################################################## # # # com.devture.ansible.role.systemd_service_manager # diff --git a/requirements.yml b/requirements.yml index 2184101..2675b3d 100644 --- a/requirements.yml +++ b/requirements.yml @@ -3,6 +3,9 @@ - src: geerlingguy.docker version: 6.1.0 +- src: git+https://gitlab.com/etke.cc/roles/swap + version: 33ce32b065276a96b7e2562752f3a63913ed5480 + - src: git+https://github.com/devture/com.devture.ansible.role.docker_sdk_for_python.git version: 129c8590e106b83e6f4c259649a613c6279e937a diff --git a/setup.yml b/setup.yml index 5b74e6e..d8d2d03 100644 --- a/setup.yml +++ b/setup.yml @@ -37,6 +37,8 @@ - role: mash/playbook_base + - role: galaxy/swap + # This role exposes various tags (setup-postgres, setup-all, upgrade-postgres, import-postgres, etc.), so we don't tag it here. - role: galaxy/com.devture.ansible.role.postgres