Skip to content

Commit

Permalink
playbooks: add a playbook to configure hugepages
Browse files Browse the repository at this point in the history
The file etc/hugepages_nb.conf will be read by the
hugetlb-gigantic-pages.

Signed-off-by: Erwann Roussy <[email protected]>
  • Loading branch information
eroussy authored and watare committed Nov 9, 2022
1 parent 5dfcd28 commit 8c8da1a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions playbooks/cluster_setup_configure_hosts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This Ansible playbook configure cluster machines.
---
- import_playbook: cluster_setup_kernel_params.yaml
- import_playbook: cluster_setup_configure_hugepages.yaml
- name: remove the static ip previously setup
hosts: cluster_machines
tasks:
Expand Down
26 changes: 26 additions & 0 deletions playbooks/cluster_setup_configure_hugepages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2022, RTE (http://www.rte-france.com)
# SPDX-License-Identifier: Apache-2.0

# This Ansible playbook configures the number of hugepages available.
# It is called by the playbook cluster_setup_configure_host.yaml, but can also
# be called alone.
# The number of hugepages has to be at least one.
# The target must be reload for the change to take effect.

---
- name: Configure hugepages
hosts: hypervisors
vars:
hugepages_number: "{{ hugepages | default('4') }}"
tasks:
- name: Setup hugepages number
copy:
content: "{{ hugepages_number }}"
dest: /etc/hugepages_nb.conf
notify:
- Restart hugepages service
handlers:
- name: Restart hugepages service
ansible.builtin.systemd:
name: hugetlb-gigantic-pages.service
state: restarted

0 comments on commit 8c8da1a

Please sign in to comment.