forked from seapath/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
playbooks: add a playbook to configure hugepages
The file etc/hugepages_nb.conf will be read by the hugetlb-gigantic-pages. Signed-off-by: Erwann Roussy <[email protected]>
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |