43 lines
959 B
YAML
43 lines
959 B
YAML
---
|
|
- name: install packages
|
|
package:
|
|
name: "{{ item }}"
|
|
state: latest
|
|
with_items:
|
|
- tuned
|
|
- tuned-utils
|
|
|
|
- name: start service
|
|
service:
|
|
name: tuned
|
|
enabled: yes
|
|
state: started
|
|
|
|
- name: get active tuned profile
|
|
command: /usr/sbin/tuned-adm active
|
|
register: tuned_active
|
|
changed_when: false
|
|
ignore_errors: true
|
|
|
|
- name: create custom tuned profile directory
|
|
file:
|
|
path: "/etc/tuned/{{ tuned_custom_profile.name }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
|
|
- name: copy custom profile configuration file
|
|
template:
|
|
src: custom_profile.conf.j2
|
|
dest: "/etc/tuned/{{ tuned_custom_profile.name }}/tuned.conf"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart tuned
|
|
register: tuned_custom_profile_template
|
|
|
|
- name: set custom tuned profile
|
|
command: "/usr/sbin/tuned-adm profile {{ tuned_custom_profile.name }}"
|
|
when:
|
|
- tuned_custom_profile_template is changed
|