giovtorres.tuned
Rola Ansible: Tuned
Instaluje i konfiguruje demon tuned do ustawiania profili tuningowych systemu. Obsługiwany w EL7.
Wymagania
Brak.
Zmienne roli
Dostępne wbudowane profile w EL7 to:
- balanced
- desktop
- latency-performance
- network-latency
- network-throughput
- powersave
- throughput-performance
- virtual-guest
- virtual-host
Zmień aktywny profil tuned, używając jednego z wbudowanych profili:
tuned_active_builtin_profile: "throughput-performance"
Zmień aktywny profil tuned, tworząc niestandardowy profil. Zobacz przykład poniżej, jak zbudować niestandardowy profil tuned:
tuned_active_custom_profile: ""
Zależności
Brak.
Przykład playbooków
Aby użyć domyślnego profilu roli, throughput-performance
, po prostu zastosuj rolę:
- hosts: serwery
roles:
- giovtorres.tuned
Aby użyć jednego z pozostałych dostępnych wbudowanych profili, ustaw zmienną
tuned_active_builtin_profile
:
- hosts: serwery
vars:
tuned_active_builtin_profile: "virtual-guest"
roles:
- giovtorres.tuned
Aby zbudować niestandardowy profil, utwórz słownik, używając zmiennej
tuned_active_custom_profile
z elementami name i sections, gdzie
sections zawiera nazwę sekcji w pliku konfiguracyjnym oraz listę par opcji/wartości, które będą w danej sekcji.
- hosts: all
vars:
tuned_active_custom_profile:
name: my_custom_profile
sections:
- name: main
params:
- option: summary
value: Test
- option: include
value: throughput-performance
- name: sysctl
params:
- option: vm.dirty_ratio
value: 30
- option: vm.swappiness
value: 30
- name: vm
params:
- option: transparent_hugepages
value: never
roles:
- giovtorres.tuned
Powyższy playbook skutkuje następującym wyjściem konfiguracji:
[main]
summary=Test
include=throughput-performance
[sysctl]
vm.dirty_ratio=30
vm.swappiness=30
[vm]
transparent_hugepages=never
Licencja
BSD
ansible-galaxy install giovtorres.tuned