Skip to content

Commit

Permalink
add task/entry to set vm.hugetlb_shm_group
Browse files Browse the repository at this point in the history
  • Loading branch information
bartowl authored and Rendanic committed May 11, 2024
1 parent 39639be commit 5ffa13f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/hugepages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- "orahost: set vm.hugetlb_shm_group to oracle user GID (oravirt#461)"
2 changes: 2 additions & 0 deletions roles/orahost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions roles/orahost/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions roles/orahost/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit 5ffa13f

Please sign in to comment.