Skip to content

Commit

Permalink
more ansible-lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Koenig committed Sep 25, 2023
1 parent ba9bb05 commit dfbebc5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
register: __sap_hypervisor_node_preconfigure_cpu_stepping_output_assert
changed_when: __sap_hypervisor_node_preconfigure_cpu_stepping_output_assert.rc != 0

- name: register stepping as fact
set_fact:
- name: Register stepping as fact
ansible.builtin.set_fact:
__sap_hypervisor_node_preconfigure_cpu_stepping_assert: "{{ __sap_hypervisor_node_preconfigure_cpu_stepping_output_assert.stdout }}"

- name: Print CPU Stepping
Expand All @@ -47,6 +47,7 @@

# skylake:
- name: Assert - Check Intel Skylake CPU Platform
when: __sap_hypervisor_node_preconfigure_cpu_stepping_assert == "4"
block:
- name: Get ple_gap
ansible.builtin.command: grep -E '^options\s+kvm_intel.*?ple_gap\s*=\s*0.*$' /etc/modprobe.d/kvm.conf
Expand All @@ -67,9 +68,9 @@
fail_msg: "FAIL: spectre_v2=retpoline is not on Kernel command line"
success_msg: "PASS: spectre_v2=retpoline is on Kernel command line"
ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}"
when: __sap_hypervisor_node_preconfigure_cpu_stepping_assert == "4"

- name: Assert - check sap_hypervisor_node_preconfigure_nx_huge_pages
when: sap_hypervisor_node_preconfigure_nx_huge_pages is defined
block:
- name: "Assert - Check kvm.nx_huge_pages is {{ sap_hypervisor_node_preconfigure_nx_huge_pages }}"
ansible.builtin.assert:
Expand All @@ -78,8 +79,6 @@
success_msg: "PASS: kvm.nx_huge_pages is {{ sap_hypervisor_node_preconfigure_nx_huge_pages }}"
ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}"

when: sap_hypervisor_node_preconfigure_nx_huge_pages is defined

- name: Assert - check seccomp_sanbox=0
block:
- name: Get seccomp setting
Expand All @@ -104,7 +103,7 @@

- name: "Check that at least {{ sap_hypervisor_node_preconfigure_reserved_ram }} GB are available for the hypervisor and the rest are 1G hugepages"
ansible.builtin.assert:
that: "{{ ( ansible_memtotal_mb / 1024 )|int - sap_hypervisor_node_preconfigure_reserved_ram }} >= {{ __sap_hypervisor_node_preconfigure_1Ghugepages_assert.stdout }}"
that: "{{ (ansible_memtotal_mb / 1024) | int - sap_hypervisor_node_preconfigure_reserved_ram }} >= {{ __sap_hypervisor_node_preconfigure_1g_hugepages_assert.stdout }}"
fail_msg: "FAIL: Not enough memory reserved for hypervisor"
success_msg: "PASS: Enough memory reserved for hypervisor"
ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
changed_when: cpu_stepping_output.rc != 0

- name: Register CPU stepping as fact
set_fact:
ansible.builtin.set_fact:
cpu_stepping: "{{ cpu_stepping_output.stdout }}"
become: true
become_user: root
Expand Down Expand Up @@ -92,7 +92,7 @@
with_items:
- default_hugepagesz=1GB
- hugepagesz=1GB
- hugepages={{ ( ansible_memtotal_mb / 1024 )|int - sap_hypervisor_node_preconfigure_reserved_ram }}
- hugepages={{ (ansible_memtotal_mb / 1024) | int - sap_hypervisor_node_preconfigure_reserved_ram }}
notify: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler
tags: grubconfig
when: sap_hypervisor_node_preconfigure_reserve_hugepages == "static"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@
assert_prefix: "assert-"
when: sap_hypervisor_node_preconfigure_assert|d(false)

- include_tasks: '{{ assert_prefix }}installation.yml'
- name: Include "{{ assert_prefix }}installation.yml"
ansible.builtin.include_tasks: '{{ assert_prefix }}installation.yml'

- include_tasks: '{{ assert_prefix }}configuration.yml'
- name: Include "{{ assert_prefix }}configuration.yml"
ansible.builtin.include_tasks: '{{ assert_prefix }}configuration.yml'

- include_tasks: '{{ assert_prefix }}set-tuned-profile.yml'
- name: Include "{{ assert_prefix }}set-tuned-profile.yml"
ansible.builtin.i include_tasks: '{{ assert_prefix }}set-tuned-profile.yml'

- include_tasks: "{{ assert_prefix }}rhv-hooks.yml"
- name: Include "{{ assert_prefix }}rhv-hooks.yml"
ansible.builtin.include_tasks: "{{ assert_prefix }}rhv-hooks.yml"
loop:
- "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/50_hana"
- "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/50_iothread_pinning"

0 comments on commit dfbebc5

Please sign in to comment.