Commit 217942fe authored by Joanne Hugé's avatar Joanne Hugé

playbook/cpu-scaling-governor: only set governor on online CPUs

prevents vifib.yml playbook from failing for machines containing offline CPUs
parent c2255431
Pipeline #23706 failed with stage
in 0 seconds
...@@ -9,7 +9,14 @@ ...@@ -9,7 +9,14 @@
with_items: '{{ cpus.stdout_lines }}' with_items: '{{ cpus.stdout_lines }}'
register: scaling_governor_stat register: scaling_governor_stat
- name: Set CPU Scaling Governor - name: Check if CPUs are offine
shell: 'echo {{ value }} > {{ item.item }}/cpufreq/scaling_governor' shell: grep -q 0 {{ item.item }}/online
register: cpu_offline
ignore_errors: yes
with_items: '{{ scaling_governor_stat.results }}' with_items: '{{ scaling_governor_stat.results }}'
when: item.stat.exists when: item.stat.exists
- name: Set CPU Scaling Governor
shell: 'echo {{ value }} > {{ item.item.item }}/cpufreq/scaling_governor'
with_items: '{{ cpu_offline.results }}'
when: item.rc != 0
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