From 5ffa13fc54a57e21dcd033f094bfeea19a146a20 Mon Sep 17 00:00:00 2001 From: bartowl Date: Fri, 10 May 2024 16:28:14 +0200 Subject: [PATCH] add task/entry to set vm.hugetlb_shm_group --- changelogs/fragments/hugepages.yml | 2 ++ roles/orahost/README.md | 2 ++ roles/orahost/defaults/main.yml | 1 + roles/orahost/tasks/main.yml | 7 +++++++ 4 files changed, 12 insertions(+) create mode 100644 changelogs/fragments/hugepages.yml diff --git a/changelogs/fragments/hugepages.yml b/changelogs/fragments/hugepages.yml new file mode 100644 index 000000000..1a191a329 --- /dev/null +++ b/changelogs/fragments/hugepages.yml @@ -0,0 +1,2 @@ +minor_changes: + - "orahost: set vm.hugetlb_shm_group to oracle user GID (oravirt#461)" diff --git a/roles/orahost/README.md b/roles/orahost/README.md index 996a00d46..835371dd5 100644 --- a/roles/orahost/README.md +++ b/roles/orahost/README.md @@ -506,6 +506,8 @@ This is an internal variable. Do not change it! ```YAML oracle_hugepages: - {name: vm.nr_hugepages, value: '{{ nr_hugepages }}'} + - {name: vm.hugetlb_shm_group, value: "{{ oracle_user_getent['ansible_facts']['getent_passwd'][oracle_user][2] + }}"} ``` ### oracle_hugepages_sysctl_file diff --git a/roles/orahost/defaults/main.yml b/roles/orahost/defaults/main.yml index 2e8e3d3d8..2fe6bab58 100644 --- a/roles/orahost/defaults/main.yml +++ b/roles/orahost/defaults/main.yml @@ -451,6 +451,7 @@ oracle_sysctl: # @end oracle_hugepages: - {name: vm.nr_hugepages, value: "{{ nr_hugepages }}"} + - {name: vm.hugetlb_shm_group, value: "{{ oracle_user_getent['ansible_facts']['getent_passwd'][oracle_user][2] }}"} # @var oracle_hugepages_sysctl_file:description: > # Allows to specify the file in which sysctl settings for huge pages will be stored. diff --git a/roles/orahost/tasks/main.yml b/roles/orahost/tasks/main.yml index 49fb2eb00..9b98382de 100644 --- a/roles/orahost/tasks/main.yml +++ b/roles/orahost/tasks/main.yml @@ -397,6 +397,13 @@ - hugepages - molecule-idempotence-notest block: + - name: Lookup oracle user GID for hugepages + ansible.builtin.getent: + database: passwd + key: "{{ oracle_user }}" + split: ":" + register: oracle_user_getent + - name: Oracle hugepages ansible.posix.sysctl: name: "{{ item.name }}"