Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Ansible role to create zSwap, zRam, swapfile when needed.

License

NotificationsYou must be signed in to change notification settings

crrlcx/ansible-swap

Repository files navigation

Ansible roleansible-swapInstall, setup and run zSwap and zRAM as systemd service for VM and BareMetal servers.

Requirements

  • systemd

Role variables

Defaults

---# defaults file for ansible-swapdpkg_force_overwrite_configs:false# swapfileswap_file_enabled:false# Use any of the following suffixes# c=1# w=2# b=512# kB=1000# K=1024# MB=1000*1000# M=1024*1024# xM=M# GB=1000*1000*1000# G=1024*1024*1024swap_file_path:'/swapfile'swap_file_size:'2G'# systemd-swapswap_systemd_enabled:trueswap_systemd_package:name:'systemd-swap'version:'4.0.2'deb:'systemd-swap_4.0.2_all.deb'# zSwapswap_systemd_zswap_enabled:falseswap_systemd_zswap_max_pool_percent:20# zRamswap_systemd_zram_enabled:false# swap_systemd_zram_size: "{{ (( ansible_memtotal_mb * 1024 * 1024 | filesizeformat | human_to_bytes ) / 2 ) | int | abs }}" # in bytes# swap_systemd_zram_count: "{{ ( ansible_processor_vcpus / 2 ) | int | abs }}"# swap_systemd_zram_streams: "{{ ansible_processor_vcpus }}"swap_systemd_zram_size:'$(( ${RAM_SIZE} / 2 ))'swap_systemd_zram_count:'${NCPU}'swap_systemd_zram_streams:'${NCPU}'# Swap File Chunksswap_systemd_swapfc_enabled:falseswap_systemd_swapfc_force_use_loop:trueswap_systemd_swapfc_chunk_size:'512M'swap_systemd_swapfc_max_count:8# 1..32swap_systemd_swapfc_free_swap_perc:15# Swap Deviceswap_systemd_swapd_auto_swapon:true

Dependencies

Example playbook

-hosts:serversroles:    -role:ansible-swap

License

MIT

About

Ansible role to create zSwap, zRam, swapfile when needed.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp