Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 0 additions & 28 deletions ansible/playbooks/additional_fence_agent_tasks.yaml

This file was deleted.

26 changes: 14 additions & 12 deletions ansible/playbooks/ptf_installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
ptf_dir: "/tmp/ptf_dir"

tasks:

- name: Create directory for PTF installation
file:
ansible.builtin.file:
path: "{{ ptf_dir }}"
state: directory
mode: '0755'

- name: Convert comma-separated string to list
set_fact:
ansible.builtin.set_fact:
az_blobs: "{{ ptf_files | split(',') }}"
when: sas_token is defined

Expand All @@ -38,46 +37,49 @@
with_items: "{{ az_blobs }}"
when: sas_token is defined

- name: Download PTF files recursively with wget
command: "wget --no-directories --recursive --reject 'index.html*' --user={{ ptf_user }} --password={{ ptf_password }} --no-parent {{ ptf_url }}"
- name: Download PTF files recursively with wget # noqa: command-instead-of-module
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here using wget was intentional. # noqa: is the way to add local exeptions

ansible.builtin.command: "wget --no-directories --recursive --reject 'index.html*' --user={{ ptf_user }} --password={{ ptf_password }} --no-parent {{ ptf_url }}"
args:
chdir: "{{ ptf_dir }}"
register: wget_ret
changed_when: wget_ret.rc == 0
when:
- sas_token is not defined
- ptf_user is defined
- ptf_password is defined
- ptf_url is defined

- name: List downloaded files
command: "ls -la"
ansible.builtin.command: "ls -la"
args:
chdir: "{{ ptf_dir }}"
changed_when: false
register: download_list

- name: Display downloaded files
debug:
ansible.builtin.debug:
var: download_list.stdout_lines

- name: Find downloaded RPM files
find:
ansible.builtin.find:
paths: "{{ ptf_dir }}"
patterns: "*.rpm"
register: rpm_files

- name: Display found RPM files
debug:
ansible.builtin.debug:
var: rpm_files.files

- name: Filter out src.rpm files
set_fact:
ansible.builtin.set_fact:
filtered_rpm_files: "{{ rpm_files.files | selectattr('path', 'search', '^(?!.*src\\.rpm$).*') | list }}"

- name: Display filtered RPM files
debug:
ansible.builtin.debug:
var: filtered_rpm_files

- name: Install PTF RPM packages
zypper:
community.general.zypper:
name: "{{ item.path }}"
state: present
disable_gpg_check: true
Expand Down
20 changes: 8 additions & 12 deletions ansible/playbooks/sap-hana-system-replication-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
- hosts: hana
- name: SAP Hana System Replication Hooks
hosts: hana
remote_user: cloudadmin
become: true
become_user: root

pre_tasks:
- name: Source hana install variables
include_vars: ./vars/hana_vars.yaml
ansible.builtin.include_vars: ./vars/hana_vars.yaml

vars:
is_primary: "{{ ansible_play_hosts[0] == inventory_hostname }}"
Expand All @@ -26,22 +27,17 @@
{{ __sapcontrol }}
-nr {{ sap_hana_install_instance_number }}
-function StopWait 600 10
register: stopwait
changed_when: stopwait.rc == 0 # Sucessfull output is like "\n24.06.2025 23:38:21\nStop\nOK\n\n24.06.2025 23:38:41\nStopWait\nOK"

- name: Start HANA Primary
- name: Start HANA
ansible.builtin.command: # StartWait will timeout after 600 seconds.
cmd: >-
{{ __sapcontrol }}
-nr {{ sap_hana_install_instance_number }}
-function StartWait 600 10
when: is_primary

- name: Start HANA Secondary
ansible.builtin.command: # StartWait will timeout after 600 seconds.
cmd: >-
{{ __sapcontrol }}
-nr {{ sap_hana_install_instance_number }}
-function StartWait 600 10
when: not is_primary
register: startwait
changed_when: startwait.rc == 0 # Sucessfull output is like "\n24.06.2025 23:38:42\nStart\nOK\n\n24.06.2025 23:39:52\nStartWait\nOK"

tasks:
- name: Assert that required variables are defined
Expand Down
7 changes: 4 additions & 3 deletions ansible/playbooks/sap-hana-system-replication.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- hosts: hana
- name: SAP Hana System Replication
hosts: hana
remote_user: cloudadmin
become: true
become_user: root
Expand All @@ -11,7 +12,7 @@
when: ansible_play_hosts | length != 2

- name: Load HANA vars
include_vars: ./vars/hana_vars.yaml
ansible.builtin.include_vars: ./vars/hana_vars.yaml

vars:
install_path: /var/lib/qedep
Expand Down Expand Up @@ -52,7 +53,7 @@

- name: Execute hana system replication role
ansible.builtin.include_role:
role: ../roles/sap_ha_install_hana_hsr
name: ../roles/sap_ha_install_hana_hsr

Check warning on line 56 in ansible/playbooks/sap-hana-system-replication.yaml

View workflow job for this annotation

GitHub Actions / build

role-name[path]

Avoid using paths when importing roles. (../roles/sap_ha_install_hana_hsr)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in the .ansiblelint demote this from fatal error to warning. The github workflow does not fails but the message is there and github annotate the file. It is good as we will not forget about it.

when: hsr_configured == 'absent'

- name: Write status file
Expand Down