mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-29 10:45:42 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
35
roles/common/tasks/tuned.yml
Normal file
35
roles/common/tasks/tuned.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
|
||||
- name: Install tuned service
|
||||
yum: name=tuned state=present
|
||||
|
||||
- name: Enabling tuned
|
||||
service: name=tuned state=started enabled=yes
|
||||
|
||||
- name: Check actual tuned profile
|
||||
shell: "tuned-adm active | awk -F': ' '{print $2}'"
|
||||
register: tuned_profile
|
||||
changed_when: False
|
||||
ignore_errors: True
|
||||
|
||||
- name: Applying custom tuned profile
|
||||
command: tuned-adm profile {{ system_tuned_profile }}
|
||||
when:
|
||||
- system_tuned_profile is defined
|
||||
- tuned_profile.stdout != system_tuned_profile
|
||||
|
||||
- name: Applying virtual guest tuned profile
|
||||
command: tuned-adm profile virtual-guest
|
||||
when:
|
||||
- ansible_virtualization_role == "guest"
|
||||
- tuned_profile.stdout != "virtual-guest"
|
||||
- system_tuned_profile is not defined
|
||||
|
||||
- name: Applying virtual host tuned profile
|
||||
command: tuned-adm profile virtual-host
|
||||
when:
|
||||
- ansible_virtualization_role == "host"
|
||||
- tuned_profile.stdout != "virtual-host"
|
||||
- system_tuned_profile is not defined
|
||||
|
||||
...
|
Reference in New Issue
Block a user