Skip to content

Commit

Permalink
add oracle_sysctl_file and oracle_hugepages_sysctl_file variables
Browse files Browse the repository at this point in the history
  • Loading branch information
bartowl authored and Rendanic committed Apr 26, 2024
1 parent 9b73293 commit d2fb91b
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 25 deletions.
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)"
79 changes: 57 additions & 22 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 All @@ -66,6 +68,7 @@ Role to configure the hostsystem for ansible-oracle

- Minimum Ansible version: `2.14.0`


## Default Variables

### asmlib_rpm
Expand All @@ -87,8 +90,7 @@ Name / Url for rpm oracleasm-support for RHEL6/OL6.
#### Default value
```YAML
asmlib_rpm_el6:
http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm
asmlib_rpm_el6: http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el6.x86_64.rpm
```
### asmlib_rpm_el7
Expand All @@ -98,8 +100,7 @@ Name / Url for rpm oracleasm-support for RHEL7/OL7.
#### Default value
```YAML
asmlib_rpm_el7:
http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
asmlib_rpm_el7: http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
```
### asmlib_rpm_el8
Expand All @@ -109,8 +110,7 @@ Name / Url for rpm oracleasm-support for RHEL8/OL8.
#### Default value
```YAML
asmlib_rpm_el8:
https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.17-1.el8.x86_64.rpm
asmlib_rpm_el8: https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.17-1.el8.x86_64.rpm
```
### asmlib_rpm_sles
Expand All @@ -120,8 +120,7 @@ Name / Url for rpm oracleasm-support for SLES.
#### Default value
```YAML
asmlib_rpm_sles:
http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/sles12/amd64/2.1.8/oracleasm-support-2.1.8-1.SLE12.x86_64.rpm
asmlib_rpm_sles: http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/sles12/amd64/2.1.8/oracleasm-support-2.1.8-1.SLE12.x86_64.rpm
```
### asmlibsupport_rpm
Expand All @@ -147,26 +146,23 @@ asmlibsupport_rpm: Value from `asmlibsupport_rpm_el6`, `asmlibsupport_rpm_el7` o
#### Default value

```YAML
asmlibsupport_rpm_el6:
http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/rhel6/amd64/2.1.8/oracleasm-support-2.1.8-1.el6.x86_64.rpm
asmlibsupport_rpm_el6: http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/rhel6/amd64/2.1.8/oracleasm-support-2.1.8-1.el6.x86_64.rpm
```
### asmlibsupport_rpm_el7
#### Default value
```YAML
asmlibsupport_rpm_el7:
https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
asmlibsupport_rpm_el7: https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
```
### asmlibsupport_rpm_el8
#### Default value
```YAML
asmlibsupport_rpm_el8:
https://yum.oracle.com/repo/OracleLinux/OL8/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el8.x86_64.rpm
asmlibsupport_rpm_el8: https://yum.oracle.com/repo/OracleLinux/OL8/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el8.x86_64.rpm
```
### configure_etc_hosts
Expand Down Expand Up @@ -291,8 +287,8 @@ Set IP to 2nd Interface on virtualbox and 1st for all otehr installations
#### Default value

```YAML
etc_hosts_ip: "{% if 'virtualbox' in ansible_virtualization_type %}{{ ansible_all_ipv4_addresses[1]
}}{% else %}{{ ansible_default_ipv4.address }}{% endif %}"
etc_hosts_ip: "{% if 'virtualbox' in ansible_virtualization_type %}{{ ansible_all_ipv4_addresses[1]\
\ }}{% else %}{{ ansible_default_ipv4.address }}{% endif %}"
```

### extrarepos_disabled
Expand All @@ -310,8 +306,8 @@ extrarepos_disabled: '[]'
#### Default value

```YAML
extrarepos_enabled: "{%- if ansible_distribution == 'OracleLinux' -%}ol{{ ansible_distribution_major_version
}}_addons{%- else -%}{%- endif %}"
extrarepos_enabled: "{%- if ansible_distribution == 'OracleLinux' -%}ol{{ ansible_distribution_major_version\
\ }}_addons{%- else -%}{%- endif %}"
```

### firewall_service
Expand Down Expand Up @@ -480,6 +476,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 +669,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 All @@ -677,8 +708,8 @@ Support is limited to RHE/OL and SuSE
#### Default value

```YAML
os_family_supported: "{% if ansible_os_family == 'Suse' %}Suse{% else %}RedHat{% endif
%}"
os_family_supported: "{% if ansible_os_family == 'Suse' %}Suse{% else %}RedHat{% endif\
\ %}"
```

### os_min_supported_version
Expand All @@ -688,8 +719,8 @@ Minimum supported versions for SLES is 12.1 and RHEL/OL >= 6.4
#### Default value

```YAML
os_min_supported_version: "{% if ansible_os_family == 'Suse' %}12.1{% else %}6.4{%
endif %}"
os_min_supported_version: "{% if ansible_os_family == 'Suse' %}12.1{% else %}6.4{%\
\ endif %}"
```

### percent_hugepages
Expand Down Expand Up @@ -765,6 +796,8 @@ transparent_hugepage_disable:

**_hugepages_**

**_iptables,firewalld_**

**_molecule-idempotence-notest_**

**_nozeroconf_**
Expand All @@ -791,6 +824,8 @@ transparent_hugepage_disable:

**_sysctl_**

**_timezone_**

**_tphnuma_**

**_tphnuma,molecule-idempotence-notest_**
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

0 comments on commit d2fb91b

Please sign in to comment.