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

Move ansible lint config to standard config file and fix few warnings #273

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
exclude_paths:
- ansible/roles/
- ansible/playbooks/registration_role.yaml
- ansible/playbooks/vars/hana_media.yaml
- ansible/playbooks/vars/hana_vars.yaml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static-ansible-syntax:
@python3 --version ; python3 tools/ansible_playbook_syntax_check.py

static-ansible-lint:
@ansible-lint ansible/ --exclude ansible/playbooks/registration_role.yaml --exclude ansible/playbooks/vars/hana_media.yaml --exclude ansible/playbooks/vars/hana_vars.yaml
@ansible-lint --offline ansible/

test-ut:
@cd scripts/qesap/ ; tox -e py311
Expand Down
6 changes: 3 additions & 3 deletions ansible/playbooks/additional_fence_agent_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

tasks:
- name: Verify installation
command: "rpm -qf $(which fence_azure_arm)"
ansible.builtin.shell: "rpm -qf $(which fence_azure_arm)"
args:
_uses_shell: true
register: verify_installation

- name: Display verification result
debug:
ansible.builtin.debug:
var: verify_installation.stdout_lines

- name: Install additional Python packages
zypper:
community.general.zypper:
name:
- python311-pexpect
- python311-pycurl
Expand Down
20 changes: 10 additions & 10 deletions ansible/playbooks/ptf_installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
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 @@ -39,7 +39,7 @@
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 }}"
ansible.builtin.command: "wget --no-directories --recursive --reject 'index.html*' --user={{ ptf_user }} --password={{ ptf_password }} --no-parent {{ ptf_url }}"
args:
chdir: "{{ ptf_dir }}"
when:
Expand All @@ -49,35 +49,35 @@
- ptf_url is defined

- name: List downloaded files
command: "ls -la"
ansible.builtin.command: "ls -la"
args:
chdir: "{{ ptf_dir }}"
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
2 changes: 1 addition & 1 deletion ansible/playbooks/registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Check if there are instances of `Not Registered` in it
- name: Check for 'Not Registered'
set_fact:
ansible.builtin.set_fact:
not_registered_found: "{{ 'Not Registered' in repos.stdout }}"
ignore_errors: true

Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/sap-hana-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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:
install_path: /var/lib/qedep
install_file: "{{ install_path }}/{{ sap_hana_install_sid }}_install"
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/sap-hana-system-replication-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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 Down
2 changes: 1 addition & 1 deletion ansible/playbooks/sap-hana-system-replication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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
2 changes: 1 addition & 1 deletion ansible/playbooks/tasks/azure-cluster-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
- max_tasks_int | int < 4096

- name: Flush handlers
meta: flush_handlers
ansible.builtin.meta: flush_handlers

- name: Ensure 'CLOUD_NETCONFIG_MANAGE' is disabled for eth0
ansible.builtin.lineinfile:
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/tasks/azure-cluster-hana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
- name: Validate cluster IP
vars:
ip_regex: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
assert:
ansible.legacy.assert:
that: cluster_ip is match(ip_regex)
fail_msg: "The provided cluster IP address is not valid."
when: cluster_ip is defined
Expand Down
6 changes: 3 additions & 3 deletions ansible/playbooks/tasks/cluster-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
mode: '0600'

- name: Flush handler
meta: flush_handlers
ansible.builtin.meta: flush_handlers

- name: Get DefaultTasksMax value
ansible.builtin.command: # noqa command-instead-of-module
Expand Down Expand Up @@ -181,7 +181,7 @@
- max_tasks_int | int < 4096

- name: Flush handlers
meta: flush_handlers
ansible.builtin.meta: flush_handlers

# check crm status and fail if not return code != 0
- name: Check the cluster is up
Expand Down Expand Up @@ -230,7 +230,7 @@
op stop interval=0 timeout=180 \
op monitor interval=120 timeout=60 \
meta target-role=Started \
params tag={{ aws_stonith_tag}} pcmk_delay_max=15
params tag={{ aws_stonith_tag }} pcmk_delay_max=15
when: cloud_platform_is_aws

- name: Set primary and secondary hostnames
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/tasks/iscsi-client-sbd-prep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- Restart iscsi

- name: Flush handlers
meta: flush_handlers
ansible.builtin.meta: flush_handlers

- name: Scan iscsi disks
ansible.builtin.command:
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/tasks/iscsi-server-sbd-prep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
sap_storage_cloud_type: 'generic'
sap_storage_sap_type: 'sap_hana'
sap_storage_action: 'prepare'
include_role:
ansible.buildin.include_role:
name: ../roles/qe_sap_storage

- name: Configure HANA SBD target
Expand Down
2 changes: 1 addition & 1 deletion terraform/aws/modules/drbd_node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ variable "drbd_count" {
}

variable "vm_size" {
description = "The instance type of DRDB node"
description = "The instance type of DRBD node"
type = string
}

Expand Down
4 changes: 2 additions & 2 deletions terraform/azure/modules/drbd_node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ variable "name" {
}

variable "drbd_count" {
description = "Number of DRDB machines to deploy"
description = "Number of DRBD machines to deploy"
type = number
default = 2
}

variable "vm_size" {
description = "The instance type of DRDB node"
description = "The instance type of DRBD node"
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/azure/modules/majority_maker_node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ variable "node_count" {
}

variable "vm_size" {
description = "The instance type of DRDB node"
description = "The instance type of DRBD node"
type = string
}

Expand Down
6 changes: 0 additions & 6 deletions terraform/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,6 @@ variable "drbd_os_image" {
default = ""
}

variable "drdb_os_major_version" {
description = "The major OS version of SLES drdb VMs. If not set, this value will be computed. Example: 15"
type = string
default = ""
}

variable "drbd_image_uri" {
description = "Path to a custom azure image in a storage account used to create the drbd machines"
type = string
Expand Down
4 changes: 2 additions & 2 deletions terraform/gcp/modules/drbd_node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ variable "name" {
}

variable "drbd_count" {
description = "Number of DRDB machines to deploy"
description = "Number of DRBD machines to deploy"
type = number
default = 2
}

variable "vm_size" {
description = "The instance type of DRDB node"
description = "The instance type of DRBD node"
type = string
}

Expand Down
Loading