openstack-helm-infra/roles/enable-hugepages/tasks/main.yaml
astebenkova 2216cbfec4 Add compute-kit job with DPDK enabled
+ add role for enabling hugepages

Change-Id: I89d3c09ea3bedcba6cb51178c8d1ac482a57af01
Depends-On: I2f9d954258451f64eb87d03affc079b71b00f7bd
2024-02-14 13:23:34 -06:00

38 lines
1.2 KiB
YAML

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: Set up 1G hugepages
become: true
block:
- name: Configure grub
lineinfile:
dest: "{{ grub_default_config }}"
line: 'GRUB_CMDLINE_LINUX="default_hugepagesz={{ hugepages.size }} hugepagesz={{ hugepages.size }} hugepages={{ hugepages.number }}"'
regexp: '^GRUB_CMDLINE_LINUX="'
- name: Update grub configuration
command: update-grub2
- name: Reboot host
reboot:
reboot_timeout: 600
when: hugepages.size == "1G"
- name: Set up 2M hugepages
become: true
sysctl:
name: vm.nr_hugepages
value: "{{ hugepages.number }}"
sysctl_set: true
reload: true
when: hugepages.size == "2M"
...