1 # Copyright (c) 2018-2019 Intel Corporation
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 - name: Check if isolcpus is set by this role in {{ grub_file}}
17 path: "{{ grub_file }}"
18 regexp: '{{ isolcpus_help_string }}'
21 register: is_nsb_isolcpus_role
24 - name: Check if isolcpus is set by someone else
26 path: "{{ grub_file }}"
33 - name: Send warning that CPU isolation cannot be configured
35 msg: "WARNING: CPU isolation is not configured"
37 - not is_nsb_isolcpus_role.changed and not is_isolcpu.changed
38 - ISOL_CPUS is not defined
40 - name: Send info that CPU isolation configured by someone else
42 msg: "INFO: NOT modified, CPU isolation is already configured by someone."
44 - not is_nsb_isolcpus_role.changed and is_isolcpu.changed
46 - name: Add/update isolcpus when ISOL_CPUS is defined and not set at all or set by this role
48 path: "{{ grub_file }}"
49 regexp: "{{ isolcpus_help_string }}"
50 line: '{{ enable_isolcpu }} {{ isolcpus_help_string }}'
52 - is_nsb_isolcpus_role.changed or not is_nsb_isolcpus_role.changed and not is_isolcpu.changed
53 - ISOL_CPUS is defined
55 - name: Update grub for bare metal usage
56 command: "{{ update_grub[ansible_os_family] }}"
58 - is_nsb_isolcpus_role.changed or not is_nsb_isolcpus_role.changed and not is_isolcpu.changed
59 - ISOL_CPUS is defined