Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add task/entry to set vm.hugetlb_shm_group #461

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -48,7 +48,7 @@
- name: Add manually defined hosts to /etc/hosts
# e.g. on non-DNS environments or if we don't rely on DNS
ansible.builtin.lineinfile:
dest: /etc/hosts

Check warning on line 51 in roles/orahost/tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

jinja[spacing]

Jinja2 spacing could be improved: {{ __orahost_etc_hosts_entry.ip }} {{ (__orahost_etc_hosts_entry.fqdn|split('.'))[0] }} {{ __orahost_etc_hosts_entry.fqdn is search('\.') | ternary(__orahost_etc_hosts_entry.fqdn, '') }}{% for alias in __orahost_etc_hosts_entry.aliases|default([]) %} {{ alias }}{% endfor %} # ANSIBLE managed -> {{ __orahost_etc_hosts_entry.ip }} {{ (__orahost_etc_hosts_entry.fqdn | split('.'))[0] }} {{ __orahost_etc_hosts_entry.fqdn is search('\.') | ternary(__orahost_etc_hosts_entry.fqdn, '') }}{% for alias in __orahost_etc_hosts_entry.aliases | default([]) %} {{ alias }}{% endfor %} # ANSIBLE managed
regexp: '.*{{ __orahost_etc_hosts_entry.fqdn }}$'
line:
"{{ __orahost_etc_hosts_entry.ip }}
Expand Down 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
Loading