Skip to content

Commit

Permalink
fix: community.general usage, updated RFS
Browse files Browse the repository at this point in the history
Signed-off-by: stafaniasaju <[email protected]>
  • Loading branch information
stafaniasaju committed Dec 3, 2024
1 parent 834314d commit 2fbeb57
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-11-06T09:16:31Z",
"generated_at": "2024-12-03T13:11:54Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -130,7 +130,7 @@
"hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5",
"is_secret": false,
"is_verified": false,
"line_number": 27,
"line_number": 26,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
104 changes: 46 additions & 58 deletions roles/powervs_configure_os_for_sap/tasks/rfs.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,48 @@
---
# Ensure RFS configuration persists
- name: Configure RFS with 32768
hosts: all
become: yes
tasks:
- name: Update rps_sock_flow_entries runtime value
ansible.builtin.shell: sysctl -w net.core.rps_sock_flow_entries=32768
changed_when: false

- name: Persist rps_sock_flow_entries in sysctl.conf
lineinfile:
path: /etc/sysctl.conf
regexp: '^net.core.rps_sock_flow_entries'
line: 'net.core.rps_sock_flow_entries=32768'

- name: Reload sysctl configuration
ansible.builtin.shell: sysctl -p

- name: Create custom systemd unit for RFS configuration
copy:
dest: /etc/systemd/system/rfs-config.service
content: |
[Unit]
Description=Set RPS flow control settings
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/bin/bash -c "sleep 5; for file in $(find /sys/class/net/*/queues/ -name 'rx-*' | grep -v '/lo/'); do echo 32768 > $file/rps_flow_cnt; done"
[Install]
WantedBy=multi-user.target
- name: Reload systemd manager configuration
ansible.builtin.shell: systemctl daemon-reload

- name: Enable and start RFS configuration service
systemd:
name: rfs-config.service
enabled: yes
state: restarted

- name: Verify sysctl value after service start
ansible.builtin.shell: sysctl net.core.rps_sock_flow_entries
register: sysctl_value

- name: Debug sysctl value
debug:
var: sysctl_value.stdout

- name: Verify RFS runtime configuration
ansible.builtin.shell: |
find /sys/class/net/*/queues/ -name 'rx-*' | grep -v '/lo/' | xargs -I{} cat {}/rps_flow_cnt
register: rfs_runtime_values

- name: Debug RFS runtime values
debug:
var: rfs_runtime_values.stdout_lines
- name: Ensure rps_sock_flow_entries is set at runtime
ansible.posix.sysctl:
name: net.core.rps_sock_flow_entries
value: 32768
state: present

- name: Persist rps_sock_flow_entries in sysctl.conf
ansible.builtin.lineinfile:
path: /etc/sysctl.conf
regexp: "^net.core.rps_sock_flow_entries"
line: "net.core.rps_sock_flow_entries=32768"
state: present

- name: Reload sysctl configuration
ansible.builtin.shell: sysctl -p
register: sysctl_reload
changed_when: "'net.core.rps_sock_flow_entries' in sysctl_reload.stdout"

- name: Ensure custom systemd unit for RFS configuration exists
ansible.builtin.copy:
dest: /etc/systemd/system/rfs-config.service
content: |
[Unit]
Description=Set RPS flow control settings
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/bin/bash -c "sleep 5; for file in $(find /sys/class/net/*/queues/ -name 'rx-*' | grep -v '/lo/'); do echo 32768 > $file/rps_flow_cnt; done"
[Install]
WantedBy=multi-user.target
owner: root
group: root
mode: "0644"

- name: Reload systemd manager
ansible.builtin.systemd:
daemon_reload: true

- name: Enable and start RFS configuration service
ansible.builtin.systemd:
name: rfs-config.service
enabled: true
state: restarted
6 changes: 3 additions & 3 deletions roles/powervs_configure_os_for_sap/tasks/rhel_saptune.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Tuning for SAP on RHEL
- name: Run SAP general preconfigure
ansible.builtin.include_role:
name: sap_general_preconfigure
name: redhat.sap_install.sap_general_preconfigure
vars:
sap_general_preconfigure_fail_if_reboot_required: false
- name: Run SAP HANA preconfigure
ansible.builtin.include_role:
name: sap_hana_preconfigure
name: redhat.sap_install.sap_hana_preconfigure
vars:
sap_hana_preconfigure_fail_if_reboot_required: false
when:
- sap_solution is match("HANA")
- name: Run SAP Netweaver preconfigure
ansible.builtin.include_role:
name: sap_netweaver_preconfigure
name: redhat.sap_install.sap_netweaver_preconfigure
when:
- sap_solution is match("NETWEAVER")
3 changes: 1 addition & 2 deletions roles/powervs_configure_os_for_sap/tasks/sles_saptune.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

# following task checked for SAPTUNE profile on system and apply {{ sap_solution }} profile if not applied. Also check for saptune rpm installation
- name: Check saptune package installation
# noqa fqcn[action]
zypper:
community.general.zypper:
name: saptune
state: present

Expand Down
6 changes: 2 additions & 4 deletions roles/powervs_os_registration/tasks/rhel_byol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
when: byol is defined
block:
- name: Subscribing to RHEL and setting release to {{ ansible_distribution_version }}
# noqa fqcn[action]
redhat_subscription:
community.general.redhat_subscription:
state: present
username: "{{ byol.username }}"
password: "{{ byol.password }}"
Expand All @@ -31,8 +30,7 @@

# Add repos for installing RHEL packages required for SAP installation
- name: Enable required RHEL repositories
# noqa fqcn[action]
rhsm_repository:
community.general.rhsm_repository:
name: "{{ item }}"
state: enabled
with_items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,14 @@

# Creating volume group.
- name: Create LVM volume group {{ file_system.name }}vg on {{ wwn_to_dm_list }}
lvg:
# noqa fqcn[action]
community.general.lvg:
vg: "{{ file_system.name }}vg"
pvs: "{{ wwn_to_dm_list }}"
state: present

# Making use of --stripesize as 64K as default, unless passed explicitly in extra vars
- name: Create Logical Volume {{ file_system.name }}lv
lvol:
# noqa fqcn[action]
community.general.lvol:
vg: "{{ file_system.name }}vg"
lv: "{{ file_system.name }}lv"
size: 100%VG
Expand All @@ -91,15 +89,13 @@
mode: "0755"

- name: Create filesystem
filesystem:
# noqa fqcn[action]
community.general.filesystem:
fstype: xfs
dev: "/dev/mapper/{{ file_system.name }}vg-{{ file_system.name }}lv"
opts: -K

- name: Mount lv {{ file_system.name }}lv on {{ file_system.mount }}
mount:
# noqa fqcn[action]
ansible.posix.mount:
path: "{{ file_system.mount }}"
src: "/dev/mapper/{{ file_system.name }}vg-{{ file_system.name }}lv"
fstype: xfs
Expand Down

0 comments on commit 2fbeb57

Please sign in to comment.