Skip to content

Commit 3cdcd03

Browse files
committed
Fix trivial ansible lint warnings
Remove no more used playbook, fix ansible-lint version used in the github workflow, tune the yamllint to be compliant with Ansible (remove warning about it reported by ansible-lint), add global exception about role-name[path] as it require project folder structure change, and last but not least fix some warnings.
1 parent 8d244d1 commit 3cdcd03

4 files changed

Lines changed: 26 additions & 55 deletions

File tree

ansible/playbooks/additional_fence_agent_tasks.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

ansible/playbooks/ptf_installation.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
ptf_dir: "/tmp/ptf_dir"
1212

1313
tasks:
14-
1514
- name: Create directory for PTF installation
16-
file:
15+
ansible.builtin.file:
1716
path: "{{ ptf_dir }}"
1817
state: directory
1918
mode: '0755'
2019

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

@@ -38,46 +37,49 @@
3837
with_items: "{{ az_blobs }}"
3938
when: sas_token is defined
4039

41-
- name: Download PTF files recursively with wget
42-
command: "wget --no-directories --recursive --reject 'index.html*' --user={{ ptf_user }} --password={{ ptf_password }} --no-parent {{ ptf_url }}"
40+
- name: Download PTF files recursively with wget # noqa: command-instead-of-module
41+
ansible.builtin.command: "wget --no-directories --recursive --reject 'index.html*' --user={{ ptf_user }} --password={{ ptf_password }} --no-parent {{ ptf_url }}"
4342
args:
4443
chdir: "{{ ptf_dir }}"
44+
register: wget_ret
45+
changed_when: wget_ret.rc == 0
4546
when:
4647
- sas_token is not defined
4748
- ptf_user is defined
4849
- ptf_password is defined
4950
- ptf_url is defined
5051

5152
- name: List downloaded files
52-
command: "ls -la"
53+
ansible.builtin.command: "ls -la"
5354
args:
5455
chdir: "{{ ptf_dir }}"
56+
changed_when: false
5557
register: download_list
5658

5759
- name: Display downloaded files
58-
debug:
60+
ansible.builtin.debug:
5961
var: download_list.stdout_lines
6062

6163
- name: Find downloaded RPM files
62-
find:
64+
ansible.builtin.find:
6365
paths: "{{ ptf_dir }}"
6466
patterns: "*.rpm"
6567
register: rpm_files
6668

6769
- name: Display found RPM files
68-
debug:
70+
ansible.builtin.debug:
6971
var: rpm_files.files
7072

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

7577
- name: Display filtered RPM files
76-
debug:
78+
ansible.builtin.debug:
7779
var: filtered_rpm_files
7880

7981
- name: Install PTF RPM packages
80-
zypper:
82+
community.general.zypper:
8183
name: "{{ item.path }}"
8284
state: present
8385
disable_gpg_check: true

ansible/playbooks/sap-hana-system-replication-hooks.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
2-
- hosts: hana
2+
- name: SAP Hana System Replication Hooks
3+
hosts: hana
34
remote_user: cloudadmin
45
become: true
56
become_user: root
67

78
pre_tasks:
89
- name: Source hana install variables
9-
include_vars: ./vars/hana_vars.yaml
10+
ansible.builtin.include_vars: ./vars/hana_vars.yaml
1011

1112
vars:
1213
is_primary: "{{ ansible_play_hosts[0] == inventory_hostname }}"
@@ -26,22 +27,17 @@
2627
{{ __sapcontrol }}
2728
-nr {{ sap_hana_install_instance_number }}
2829
-function StopWait 600 10
30+
register: stopwait
31+
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"
2932

30-
- name: Start HANA Primary
33+
- name: Start HANA
3134
ansible.builtin.command: # StartWait will timeout after 600 seconds.
3235
cmd: >-
3336
{{ __sapcontrol }}
3437
-nr {{ sap_hana_install_instance_number }}
3538
-function StartWait 600 10
36-
when: is_primary
37-
38-
- name: Start HANA Secondary
39-
ansible.builtin.command: # StartWait will timeout after 600 seconds.
40-
cmd: >-
41-
{{ __sapcontrol }}
42-
-nr {{ sap_hana_install_instance_number }}
43-
-function StartWait 600 10
44-
when: not is_primary
39+
register: startwait
40+
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"
4541

4642
tasks:
4743
- name: Assert that required variables are defined

ansible/playbooks/sap-hana-system-replication.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
- hosts: hana
2+
- name: SAP Hana System Replication
3+
hosts: hana
34
remote_user: cloudadmin
45
become: true
56
become_user: root
@@ -11,7 +12,7 @@
1112
when: ansible_play_hosts | length != 2
1213

1314
- name: Load HANA vars
14-
include_vars: ./vars/hana_vars.yaml
15+
ansible.builtin.include_vars: ./vars/hana_vars.yaml
1516

1617
vars:
1718
install_path: /var/lib/qedep
@@ -52,7 +53,7 @@
5253

5354
- name: Execute hana system replication role
5455
ansible.builtin.include_role:
55-
role: ../roles/sap_ha_install_hana_hsr
56+
name: ../roles/sap_ha_install_hana_hsr
5657
when: hsr_configured == 'absent'
5758

5859
- name: Write status file

0 commit comments

Comments
 (0)