Commit 4d2e9660 authored by Guillaume Hervier's avatar Guillaume Hervier

playbook[cpu-scaling-governor]: Use find command instead of module for older Ansible version

parent cf1f16c0
--- ---
- name: Get CPUs list - name: Get CPUs list
find: shell: find /sys/devices/system/cpu -type d -name 'cpu[0-9]*'
paths: /sys/devices/system/cpu
patterns: 'cpu[0-9]+'
use_regex: yes
file_type: directory
register: cpus register: cpus
- name: Check scaling governor exists for CPUs - name: Check scaling governor exists for CPUs
stat: stat:
path: '{{ item.path }}/cpufreq/scaling_governor' path: '{{ item }}/cpufreq/scaling_governor'
with_items: '{{ cpus.files }}' with_items: '{{ cpus.stdout_lines }}'
register: scaling_governor_stat register: scaling_governor_stat
- name: Set CPU Scaling Governor - name: Set CPU Scaling Governor
shell: 'echo {{ value }} > {{ item.stat.path }}' shell: 'echo {{ value }} > {{ item.item }}/cpufreq/scaling_governor'
with_items: '{{ scaling_governor_stat.results }}' with_items: '{{ scaling_governor_stat.results }}'
when: item.stat.exists when: item.stat.exists
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment