Skip to content

Commit

Permalink
Merge old project from trento-project / trento (trento-project#34)
Browse files Browse the repository at this point in the history
* fixing regex strings for Ansible, using different methode for SBD config verification

* adapting values for AWS infrastructure, not all checks are covered by the vars file and need to be adapted in addition

* fixing typos

* changing pacemaker package version to SLES15 SP1 shipped version, to be consistent with the OS release version check

* adapting values for GCP infrastructure, not all checks are covered by the vars file and need to be adapted in addition

* fixing typos

* adapting documentation links for CSP

* adapting documentation links for CSP

* adapting documentation links for CSP

* adapting documentation links for CSP

* improve readability of the provider documentation

* changing search value and result comparison
  • Loading branch information
pirat013 authored and fmherschel committed Apr 28, 2022
1 parent e666946 commit f7cf5c4
Show file tree
Hide file tree
Showing 43 changed files with 538 additions and 66 deletions.
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.1.runtime/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,22 @@ remediation: |
`crm corosync reload`
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
Azure:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles#create_the_corosync_configuration_files
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# check id. This value must not be changed over the life of this check
Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.1/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,22 @@ remediation: |
`crm corosync reload`
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
Azure:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles#create_the_corosync_configuration_files
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# Test data
Expand Down
7 changes: 4 additions & 3 deletions runner/ansible/roles/checks/1.1.1/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
- name: "{{ name }}.check"
lineinfile:
path: /etc/corosync/corosync.conf
regexp: '^(\s+){{ key_name }}:'
line: "\t{{ key_name }}: {{ expected[name] }}"
insertafter: 'totem {'
regexp: '^(\s*){{ key_name }}:(\s*)\S*(\s)*$'
line: '\g<1>{{ key_name }}:\g<2>{{ expected[name] }}\g<3>'
backrefs: yes
#insertafter: 'totem {'
register: config_updated
when:
- ansible_check_mode
Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.2.runtime/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ remediation: |
Adjust the corosync `consensus` timeout as recommended by the Azure best practices, and reload the corosync service.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
Azure:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
GCP:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# check id. This value must not be changed over the life of this check
Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.2/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ remediation: |
Adjust the Corosync `consensus` timeout as recommended by the Azure best practices.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
Azure:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
GCP:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# Test data
Expand Down
7 changes: 4 additions & 3 deletions runner/ansible/roles/checks/1.1.2/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
- name: "{{ name }}.check"
lineinfile:
path: /etc/corosync/corosync.conf
regexp: '^(\s+){{ key_name }}:'
line: "\t{{ key_name }}: {{ expected[name] }}"
insertafter: 'totem {'
regexp: '^(\s*){{ key_name }}:(\s*)\S*(\s)*$'
line: '\g<1>{{ key_name }}:\g<2>{{ expected[name] }}\g<3>'
backrefs: yes
#insertafter: 'totem {'
register: config_updated
when: ansible_check_mode

Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.3.runtime/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ remediation: |
Adjust the corosync `max_messages` parameter as recommended by the Azure best practices, and reload the corosync service.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AZURE:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker#install-the-cluster
AWS:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# check id. This value must not be changed over the life of this check
Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.3/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ remediation: |
Adjust the Corosync `max_messages` parameter as recommended by the Azure best practices.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AZURE:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker#install-the-cluster
AWS:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# Test data
Expand Down
7 changes: 4 additions & 3 deletions runner/ansible/roles/checks/1.1.3/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
- name: "{{ name }}.check"
lineinfile:
path: /etc/corosync/corosync.conf
regexp: '^(\s+){{ key_name }}:'
line: "\t{{ key_name }}: {{ expected[name] }}"
insertafter: 'totem {'
regexp: '^(\s*){{ key_name }}:(\s*)\S*(\s)*$'
line: '\g<1>{{ key_name }}:\g<2>{{ expected[name] }}\g<3>'
backrefs: yes
#insertafter: 'totem {'
register: config_updated
when: ansible_check_mode

Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.4.runtime/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ remediation: |
Adjust the corosync `join` parameter as recommended by the Azure best practices, and reload the corosync service.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AZURE:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker#install-the-cluster
AWS:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# check id. This value must not be changed over the life of this check
Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.4/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ remediation: |
Adjust the Corosync `join` parameter as recommended by the Azure best practices.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AZURE:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker#install-the-cluster
AWS:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# Test data
Expand Down
7 changes: 4 additions & 3 deletions runner/ansible/roles/checks/1.1.4/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
- name: "{{ name }}.check"
lineinfile:
path: /etc/corosync/corosync.conf
regexp: '^(\s+){{ key_name }}:'
line: "\t{{ key_name }}: {{ expected[name] }}"
insertafter: 'totem {'
regexp: '^(\s*){{ key_name }}:(\s*)\S*(\s)*$'
line: '\g<1>{{ key_name }}:\g<2>{{ expected[name] }}\g<3>'
backrefs: yes
#insertafter: 'totem {'
register: config_updated
when: ansible_check_mode

Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.5.runtime/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ remediation: |
Adjust the corosync `token_retransmits_before_loss_const` parameter as recommended on the Azure best practices, and reload the corosync service.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AZURE:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker#install-the-cluster
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# check id. This value must not be changed over the life of this check
Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.5/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ remediation: |
Adjust the corosync `token_retransmits_before_loss_const` parameter to `{{ expected[name] }}` as recommended by the Azure best practices.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AZURE:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker#install-the-cluster
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# Test data
Expand Down
7 changes: 4 additions & 3 deletions runner/ansible/roles/checks/1.1.5/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
- name: "{{ name }}.check"
lineinfile:
path: /etc/corosync/corosync.conf
regexp: '^(\s+){{ key_name }}:'
line: "\t{{ key_name }}: {{ expected[name] }}"
insertafter: 'totem {'
regexp: '^(\s*){{ key_name }}:(\s*)\S*(\s)*$'
line: '\g<1>{{ key_name }}:\g<2>{{ expected[name] }}\g<3>'
backrefs: yes
#insertafter: 'totem {'
register: config_updated
when: ansible_check_mode

Expand Down
19 changes: 17 additions & 2 deletions runner/ansible/roles/checks/1.1.6.runtime/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,23 @@ remediation: |
cluster, where the **ring0_addr** is the IP address of the node
## References
- section 9.1.3 in https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-adapting-the-corosync-and-sbd-configuration
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
Azure:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles#create_the_corosync_configuration_files
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-adapting-the-corosync-and-sbd-configuration
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# check id. This value must not be changed over the life of this check
Expand Down
19 changes: 17 additions & 2 deletions runner/ansible/roles/checks/1.1.6/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,23 @@ remediation: |
cluster, where the **ring0_addr** is the IP address of the node
## References
- section 9.1.3 in https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-adapting-the-corosync-and-sbd-configuration
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
Azure:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles#create_the_corosync_configuration_files
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-adapting-the-corosync-and-sbd-configuration
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# Test data
Expand Down
7 changes: 4 additions & 3 deletions runner/ansible/roles/checks/1.1.6/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
- name: "{{ name }}.check"
lineinfile:
path: /etc/corosync/corosync.conf
regexp: '^(\s+){{ key_name }}:'
line: "\t{{ key_name }}: {{ expected[name] }}"
insertafter: 'totem {'
regexp: '^(\s*){{ key_name }}:(\s*)\S*(\s)*$'
line: '\g<1>{{ key_name }}:\g<2>{{ expected[name] }}\g<3>'
backrefs: yes
#insertafter: 'totem {'
register: config_updated
when: ansible_check_mode

Expand Down
17 changes: 16 additions & 1 deletion runner/ansible/roles/checks/1.1.7/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ remediation: |
Adjust the corosync `expected_votes` parameter to `{{ expected[name] }}` to make sure pacemaker calculates the actions properly for a two-node cluster.
## References
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
Azure:
- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker#install-the-cluster
AWS:
- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html
GCP:
- https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles
SUSE / KVM:
- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-example-for-etccorosynccorosync-conf
implementation: "{{ lookup('file', 'roles/checks/'+name+'/tasks/main.yml') }}"

# Test data
Expand Down
Loading

0 comments on commit f7cf5c4

Please sign in to comment.