Skip to content
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/sysctl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- "orahost: add oracle_sysctl_file and oracle_hugepages_sysctl_file variables (oravirt#432)"
37 changes: 37 additions & 0 deletions roles/orahost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ Role to configure the hostsystem for ansible-oracle
- [oracle_asm_packages_sles](#oracle_asm_packages_sles)
- [oracle_groups](#oracle_groups)
- [oracle_hugepages](#oracle_hugepages)
- [oracle_hugepages_sysctl_file](#oracle_hugepages_sysctl_file)
- [oracle_ic_net](#oracle_ic_net)
- [oracle_packages](#oracle_packages)
- [oracle_packages_sles_multi](#oracle_packages_sles_multi)
- [oracle_sysctl](#oracle_sysctl)
- [oracle_sysctl_file](#oracle_sysctl_file)
- [oracle_users](#oracle_users)
- [os_family_supported](#os_family_supported)
- [os_min_supported_version](#os_min_supported_version)
Expand Down Expand Up @@ -480,6 +482,24 @@ oracle_hugepages:
- {name: vm.nr_hugepages, value: '{{ nr_hugepages }}'}
```

### oracle_hugepages_sysctl_file

Allows to specify the file in which sysctl settings for huge pages will be stored.
When unspecified it will first fallback to be `oracle_sysctl_file`
and then to module defaults (`/etc/sysctl.conf`) should that one also be not defined.

#### Default value

```YAML
oracle_hugepages_sysctl_file: _unset_
```

#### Example usage

```YAML
oracle_hugepages_sysctl_file: '/etc/sysctl.d/oracle-hugepages.conf'
```

### oracle_ic_net

Picks the last octet from the public ip to use for
Expand Down Expand Up @@ -655,6 +675,23 @@ oracle_sysctl:
- {name: vm.min_free_kbytes, value: 524288}
```

### oracle_sysctl_file

Allows to specify the file in which sysctl settings will be stored. When unspecified it will
be put to `/etc/sysctl.conf` by the module defaults (omit)

#### Default value

```YAML
oracle_sysctl_file: _unset_
```

#### Example usage

```YAML
oracle_sysctl_file: '/etc/sysctl.d/oracle.conf'
```

### oracle_users

oracle OS-User
Expand Down
19 changes: 19 additions & 0 deletions roles/orahost/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,27 @@ oracle_sysctl:
- {name: kernel.panic_on_oops, value: 1}
- {name: vm.min_free_kbytes, value: 524288}

# @var oracle_sysctl_file:description: >
# Allows to specify the file in which sysctl settings will be stored. When unspecified it will
# be put to `/etc/sysctl.conf` by the module defaults (omit)
# @end
# @var oracle_sysctl_file: $ "_unset_"
# @var oracle_sysctl_file:example: >
# oracle_sysctl_file: '/etc/sysctl.d/oracle.conf'
# @end

# @var oracle_hugepages:description: >
# This is an internal variable. Do not change it!
# @end
oracle_hugepages:
- {name: vm.nr_hugepages, value: "{{ nr_hugepages }}"}

# @var oracle_hugepages_sysctl_file:description: >
# Allows to specify the file in which sysctl settings for huge pages will be stored.
# When unspecified it will first fallback to be `oracle_sysctl_file`
# and then to module defaults (`/etc/sysctl.conf`) should that one also be not defined.
# @end
# @var oracle_hugepages_sysctl_file: $ "_unset_"
# @var oracle_hugepages_sysctl_file:example: >
# oracle_hugepages_sysctl_file: '/etc/sysctl.d/oracle-hugepages.conf'
# @end
9 changes: 6 additions & 3 deletions roles/orahost/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@
ansible.posix.sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: "{{ item.sysctl_file | default(oracle_sysctl_file) | default(omit) }}"
state: "{{ item.state | default('present') }}"
reload: true
ignoreerrors: true
with_items: "{{ oracle_sysctl }}"
Expand All @@ -381,7 +382,8 @@
ansible.posix.sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: "{{ item.sysctl_file | default(oracle_hugepages_sysctl_file) | default(oracle_sysctl_file) | default(omit) }}"
state: "{{ item.state | default('present') }}"
reload: true
ignoreerrors: true
with_items: "{{ oracle_hugepages }}"
Expand All @@ -406,7 +408,8 @@
ansible.posix.sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: "{{ item.sysctl_file | default(oracle_hugepages_sysctl_file) | default(oracle_sysctl_file) | default(omit) }}"
state: "{{ item.state | default('present') }}"
reload: true
with_items: "{{ oracle_hugepages }}"

Expand Down