Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ansible2 #662

Open
wants to merge 25 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
80eaec1
Bring in HotFix repairs (#651)
KimForss Oct 31, 2024
33bc56b
Fix conditional statement in install_workloadzone.sh
hdamecharla Oct 31, 2024
b823388
Pipeline hotfixes (#654)
KimForss Oct 31, 2024
2e4284c
Add second frontend to HANA loadbalancer for active/read-enabled setup
hjstam Oct 28, 2024
2b8af37
Add support for HANA active/read-enabled system replication
hjstam Oct 29, 2024
00b3168
Remove duplicate code and simplify 5.5-hanadb-pacemaker cluster Red Hat
hjstam Oct 31, 2024
6728093
Add support for HANA active/read-enabled system replication for SUSE
hjstam Nov 4, 2024
2da6303
Bugfix creation of sapadm user
hjstam Nov 4, 2024
43ecff8
New branch based of development for flow timeout and route propagatio…
SteffenBoThomsen Nov 11, 2024
2d5a38d
Feature: Enable SAPHanaSR-angi configuration for scale-up configurati…
hdamecharla Nov 24, 2024
f164864
Add two node cluster properties for DB2 on RHEL8 (#665)
hjstam Nov 27, 2024
2dce7a1
Pipeline and script improvements (#666)
KimForss Nov 28, 2024
1087d23
created functionality on a new branch and replaced ansible variabe pa…
dhruvmicrosoft Dec 4, 2024
7eab013
Removed trailing space
dhruvmicrosoft Dec 4, 2024
36bcea4
added a variable called input_vars for easier reference
dhruvmicrosoft Dec 4, 2024
e3ed71b
fixed spacing for linting
dhruvmicrosoft Dec 4, 2024
e168148
fixed nfs service issue/fixed calling distribution id
dhruvmicrosoft Dec 4, 2024
8710718
fixed nfs service issue/fixed calling distribution id
dhruvmicrosoft Dec 4, 2024
10b4d0e
fixed calling distribution id
dhruvmicrosoft Dec 4, 2024
157540b
added a variable for distribution_full_id to pass to setting vars
dhruvmicrosoft Dec 4, 2024
2fab47d
changed formatting and cleaned up file names
dhruvmicrosoft Dec 4, 2024
49c2cda
cleaning up comments
dhruvmicrosoft Dec 4, 2024
4655010
took out extra lines
dhruvmicrosoft Dec 4, 2024
1d94151
moved code into try catch
dhruvmicrosoft Dec 4, 2024
ab906ff
refactored all code to convert results dictionary to object
dhruvmicrosoft Dec 4, 2024
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
37 changes: 36 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,52 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

# Python files
[*.py]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.yml, *.yaml]
[*.{y{a,}ml}]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false
insert_final_newline = false

[*.{sh,bat}]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab

[*.cs]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

# reference: https://github.com/microsoft/vscode-python/blob/main/.editorconfig
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
[{.travis.yml,npm-shrinkwrap.json,package.json}]
indent_style = space
indent_size = 4
10 changes: 7 additions & 3 deletions deploy/ansible/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ display_skipped_hosts = False
conditional_bare_variables = False
interpreter_python = auto_silent
callbacks_enabled = profile_tasks
#stdout_callback = json
stdout_callback = yaml
stdout_callback = json
# stdout_callback = yaml
# Use the stdout_callback when running ad-hoc commands.
bin_ansible_callbacks = True
host_key_checking = False
error_on_undefined_vars = True
log_path = /var/tmp/ansible.log
# log_path = /var/tmp/ansible.log

allow_world_readable_tmpfiles = True

[callback_log_plays]
log_folder = /var/tmp/ansible/hosts
log_path = /var/tmp/ansible/hosts

[connection]
# ServerAliveInternal - Coming from Achmea, keeps the connection alive and
# prevent timeouts.
Expand Down
92 changes: 47 additions & 45 deletions deploy/ansible/playbook_04_00_01_db_ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# +------------------------------------4--------------------------------------*/

- hosts: localhost
name: Get SAP Password from KeyVault
name: "Get SAP Password from KeyVault"
gather_facts: true
vars_files:
- vars/ansible-input-api.yaml # API Input template with defaults
Expand All @@ -19,19 +19,20 @@
- db_high_availability is defined
- database_high_availability is not defined

- name: Initialization
- name: "Initialization"
when: database_high_availability
block:

- name: Create Progress folder
- name: "Create Progress folder"
ansible.builtin.file:
path: "{{ _workspace_directory }}/.progress"
state: directory
mode: 0755

- name: Remove db-ha-done flag
- name: "Remove db-ha-done flag"
ansible.builtin.file:
path: "{{ _workspace_directory }}/.progress/db-ha-done"
state: absent
state: absent

- name: "Ensure passlib is installed on the controller"
become: true
Expand All @@ -54,46 +55,46 @@
# ansible.builtin.set_fact:
# tier: fencing

- name: "Run the misc/password role"
- name: "Run the misc/password role"
ansible.builtin.include_role:
name: roles-misc/0.1-passwords
public: true
name: roles-misc/0.1-passwords
public: true
tags:
- 0.1-passwords
- 0.1-passwords

- name: "OS configuration playbook: - Read password"
- name: "OS configuration playbook: - Read password"
ansible.builtin.include_role:
name: roles-misc/0.1-passwords
tasks_from: windows.yaml
public: true
when: platform == "SQLSERVER"
name: roles-misc/0.1-passwords
tasks_from: windows.yaml
public: true
when: platform == "SQLSERVER"
tags:
- 0.1-win-passwords
- 0.1-win-passwords

- name: "WinCluster-Create: Get witness account details"
- name: "WinCluster-Create: Get witness account details"
ansible.builtin.include_role:
name: roles-misc/0.2-kv-secrets
tasks_from: wincluster-witness.yaml
public: true
name: roles-misc/0.2-kv-secrets
tasks_from: wincluster-witness.yaml
public: true
vars:
operation: fencing
operation: fencing
when:
- platform | upper == "SQLSERVER"
- platform | upper == "SQLSERVER"
tags:
- 0.2-wincluster-witness
- 0.2-wincluster-witness

- name: Run the keyvault role
- name: "Run the keyvault role"
ansible.builtin.include_role:
name: roles-misc/0.2-kv-secrets
name: roles-misc/0.2-kv-secrets
vars:
operation: fencing
operation: fencing
tags:
- kv-secrets
- kv-secrets


when: database_high_availability
# +------------------------------------4--------------------------------------*/

- hosts: "{{ sap_sid | upper }}_DB"
- hosts: "{{ sap_sid | upper }}_DB"
name: HANA DB HA Configuration
remote_user: "{{ orchestration_ansible_user }}"
gather_facts: true # Important to collect hostvars information
Expand All @@ -107,11 +108,12 @@
#
# -------------------------------------+---------------------------------------8
- name: "Backward Compatibility - Check required Database HA variables"
when:
- db_high_availability is defined
- database_high_availability is not defined
ansible.builtin.set_fact:
database_high_availability: "{{ db_high_availability | default(false) }}"
when:
- db_high_availability is defined
- database_high_availability is not defined


- name: "0.0 Validations: - Gather facts for first time"
ansible.builtin.setup:
Expand All @@ -120,6 +122,9 @@

- name: "HANA HA Setup"
become: true
when:
- database_high_availability
- platform == 'HANA'
block:
- name: "Install HANA System Replication"
block:
Expand All @@ -129,7 +134,7 @@
use_proxy: false
headers:
Metadata: true
register: azmetadata
register: azmetadata

- name: "Show IMDS results"
ansible.builtin.debug:
Expand All @@ -154,9 +159,9 @@
ansible.builtin.include_role:
name: roles-db/4.0.1-hdb-hsr
when:
- node_tier == 'hana'
- node_tier == 'hana'
tags:
- 4.0.1-hdb-hsr
- 4.0.1-hdb-hsr

- name: "Install HANA Pacemaker resources"
block:
Expand All @@ -173,35 +178,32 @@
fencing_spn_client_pwd: "{% if not use_msi_for_clusters %}{{ hostvars.localhost.sap_fencing_spn_pwd }}{% endif %}"
fencing_spn_tenant_id: "{% if not use_msi_for_clusters %}{{ hostvars.localhost.sap_fencing_spn_tenant_id }}{% endif %}"
tags:
- always
- always

- name: "HANA HA Setup: - Ensure the needed services are started"
ansible.builtin.include_role:
name: roles-os/1.16-services
tags:
- 1.16-services
- 1.16-services

- name: "HANA HA Setup: - run the Pacemaker role"
ansible.builtin.include_role:
name: roles-sap/5.5-hanadb-pacemaker
when:
- database_high_availability
- not database_scale_out
- database_high_availability
- not database_scale_out
tags:
- 5.5-hanadb-pacemaker
- 5.5-hanadb-pacemaker

- name: "HANA HA Setup: - run the Pacemaker role for scale out"
ansible.builtin.include_role:
name: roles-sap/5.8-hanadb-scaleout-pacemaker
when:
- database_high_availability
- database_scale_out
- database_high_availability
- database_scale_out
tags:
- 5.8-hanadb-scaleout-pacemaker
- 5.8-hanadb-scaleout-pacemaker

when:
- database_high_availability
- platform == 'HANA'

# -------------------------------------+---------------------------------------8
#
Expand Down
Loading
Loading