Fix: Update ansible-lint configuration to exclude specific paths and skip certain rules for improved linting flexibility
Some checks failed
CI / lint-and-test (pull_request) Successful in 58s
CI / ansible-validation (pull_request) Successful in 2m17s
CI / secret-scanning (pull_request) Successful in 53s
CI / dependency-scan (pull_request) Successful in 57s
CI / sast-scan (pull_request) Successful in 2m17s
CI / license-check (pull_request) Successful in 55s
CI / vault-check (pull_request) Successful in 2m20s
CI / playbook-test (pull_request) Successful in 2m16s
CI / container-scan (pull_request) Successful in 1m25s
CI / sonar-analysis (pull_request) Failing after 1m56s
CI / workflow-summary (pull_request) Successful in 50s

This commit is contained in:
ilia 2025-12-14 21:04:45 -05:00
parent a45ee496e4
commit 83a5d988af
17 changed files with 66 additions and 30 deletions

View File

@ -4,11 +4,14 @@
exclude_paths: exclude_paths:
- .cache/ - .cache/
- .github/ - .github/
- .gitea/
- .ansible/ - .ansible/
# Skip specific rules # Skip specific rules
skip_list: skip_list:
- yaml[line-length] # Allow longer lines in some cases - yaml[line-length] # Allow longer lines in some cases
- yaml[document-start] # Allow missing document start in vault files
- yaml[truthy] # Allow different truthy values in workflow files
- name[casing] # Allow mixed case in task names - name[casing] # Allow mixed case in task names
- args[module] # Skip args rule that causes "file name too long" issues - args[module] # Skip args rule that causes "file name too long" issues
- var-naming[no-role-prefix] # Allow shorter variable names for readability - var-naming[no-role-prefix] # Allow shorter variable names for readability

View File

@ -294,15 +294,49 @@ jobs:
- name: Install Java and SonarScanner - name: Install Java and SonarScanner
run: | run: |
set -e
apt-get update && apt-get install -y wget curl unzip openjdk-17-jre apt-get update && apt-get install -y wget curl unzip openjdk-17-jre
# Download and install SonarScanner # Download and install SonarScanner
SONAR_SCANNER_VERSION=$(curl -s https://api.github.com/repos/SonarSource/sonar-scanner-cli/releases/latest | grep tag_name | cut -d '"' -f 4 | sed 's/v//') echo "Detecting latest SonarScanner version..."
wget -q "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip" -O /tmp/sonar-scanner.zip SONAR_SCANNER_VERSION=$(curl -s https://api.github.com/repos/SonarSource/sonar-scanner-cli/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/v//')
unzip -q /tmp/sonar-scanner.zip -d /opt
mv /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-linux /opt/sonar-scanner if [ -z "$SONAR_SCANNER_VERSION" ]; then
ln -s /opt/sonar-scanner/bin/sonar-scanner /usr/local/bin/sonar-scanner echo "Failed to detect version, using fallback version 5.0.1.3006"
SONAR_SCANNER_VERSION="5.0.1.3006"
fi
echo "Installing SonarScanner version: ${SONAR_SCANNER_VERSION}"
SCANNER_URL="https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip"
echo "Downloading from: ${SCANNER_URL}"
if ! wget -q --show-progress "${SCANNER_URL}" -O /tmp/sonar-scanner.zip; then
echo "❌ Failed to download SonarScanner"
exit 1
fi
echo "Extracting SonarScanner..."
if ! unzip -q /tmp/sonar-scanner.zip -d /tmp; then
echo "❌ Failed to extract SonarScanner"
exit 1
fi
if [ -d "/tmp/sonar-scanner-${SONAR_SCANNER_VERSION}-linux" ]; then
mv /tmp/sonar-scanner-${SONAR_SCANNER_VERSION}-linux /opt/sonar-scanner
elif [ -d "/tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux" ]; then
mv /tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux /opt/sonar-scanner
else
echo "❌ SonarScanner directory not found after extraction"
ls -la /tmp/ | grep sonar
exit 1
fi
ln -sf /opt/sonar-scanner/bin/sonar-scanner /usr/local/bin/sonar-scanner
chmod +x /opt/sonar-scanner/bin/sonar-scanner
chmod +x /usr/local/bin/sonar-scanner chmod +x /usr/local/bin/sonar-scanner
sonar-scanner --version
echo "Verifying installation..."
sonar-scanner --version || (echo "❌ SonarScanner verification failed" && exit 1)
- name: Verify SonarQube connection - name: Verify SonarQube connection
run: | run: |

View File

@ -1,3 +1,4 @@
---
ansible_become_password: root ansible_become_password: root
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3

View File

@ -1,3 +1,4 @@
---
# Configure sudo path for git-ci-01 # Configure sudo path for git-ci-01
# Sudo may not be in PATH for non-interactive shells # Sudo may not be in PATH for non-interactive shells
ansible_become_exe: /usr/bin/sudo ansible_become_exe: /usr/bin/sudo
@ -5,4 +6,3 @@ ansible_become_method: sudo
# Alternative: if sudo is in a different location, update this # Alternative: if sudo is in a different location, update this
# ansible_become_exe: /usr/local/bin/sudo # ansible_become_exe: /usr/local/bin/sudo

View File

@ -7,4 +7,3 @@ ansible_become_method: sudo
# Configure shell for ladmin user # Configure shell for ladmin user
shell_users: shell_users:
- ladmin - ladmin

View File

@ -29,6 +29,7 @@
fi fi
register: brave_key_check register: brave_key_check
failed_when: false failed_when: false
changed_when: false
when: applications_brave_needs_install when: applications_brave_needs_install
- name: Check if Brave repository exists and is correct - name: Check if Brave repository exists and is correct

View File

@ -17,4 +17,3 @@ r_packages:
- r-base - r-base
- r-base-dev - r-base-dev
- r-recommended - r-recommended

View File

@ -5,4 +5,3 @@
state: restarted state: restarted
daemon_reload: true daemon_reload: true
become: true become: true

View File

@ -1,4 +1,3 @@
--- ---
dependencies: dependencies:
- role: base - role: base

View File

@ -200,4 +200,3 @@
- name: Display R version - name: Display R version
ansible.builtin.debug: ansible.builtin.debug:
msg: "R version installed: {{ r_version.stdout_lines[0] if r_version.stdout_lines | length > 0 else 'Not checked in dry-run mode' }}" msg: "R version installed: {{ r_version.stdout_lines[0] if r_version.stdout_lines | length > 0 else 'Not checked in dry-run mode' }}"

View File

@ -30,6 +30,7 @@
fi fi
register: nodesource_repo_check register: nodesource_repo_check
failed_when: false failed_when: false
changed_when: false
when: node_version_check.rc != 0 or not node_version_check.stdout.startswith('v22') when: node_version_check.rc != 0 or not node_version_check.stdout.startswith('v22')
- name: Check if NodeSource GPG key exists and is correct - name: Check if NodeSource GPG key exists and is correct

View File

@ -12,6 +12,7 @@
fi fi
register: docker_key_check register: docker_key_check
failed_when: false failed_when: false
changed_when: false
- name: Remove incorrect Docker GPG key - name: Remove incorrect Docker GPG key
ansible.builtin.file: ansible.builtin.file:
@ -43,4 +44,3 @@
path: /tmp/docker.gpg path: /tmp/docker.gpg
state: absent state: absent
when: docker_key_check.stdout in ["not_exists", "wrong_key"] when: docker_key_check.stdout in ["not_exists", "wrong_key"]

View File

@ -12,6 +12,7 @@
fi fi
register: docker_repo_check register: docker_repo_check
failed_when: false failed_when: false
changed_when: false
- name: Remove incorrect Docker repository - name: Remove incorrect Docker repository
ansible.builtin.file: ansible.builtin.file:
@ -26,4 +27,3 @@
state: present state: present
update_cache: true update_cache: true
when: docker_repo_check.stdout in ["not_exists", "wrong_config"] when: docker_repo_check.stdout in ["not_exists", "wrong_config"]

View File

@ -20,6 +20,7 @@
fi fi
register: docker_repo_check register: docker_repo_check
failed_when: false failed_when: false
changed_when: false
- name: Remove incorrect Docker repository - name: Remove incorrect Docker repository
ansible.builtin.file: ansible.builtin.file:
@ -34,4 +35,3 @@
state: present state: present
update_cache: true update_cache: true
when: docker_repo_check.stdout in ["not_exists", "wrong_config"] when: docker_repo_check.stdout in ["not_exists", "wrong_config"]

View File

@ -12,6 +12,7 @@
fi fi
register: docker_repo_check register: docker_repo_check
failed_when: false failed_when: false
changed_when: false
- name: Remove incorrect Docker repository - name: Remove incorrect Docker repository
ansible.builtin.file: ansible.builtin.file:
@ -26,4 +27,3 @@
state: present state: present
update_cache: true update_cache: true
when: docker_repo_check.stdout in ["not_exists", "wrong_config"] when: docker_repo_check.stdout in ["not_exists", "wrong_config"]

View File

@ -18,6 +18,7 @@
fi fi
register: tailscale_key_check register: tailscale_key_check
failed_when: false failed_when: false
changed_when: false
when: tailscale_version_check.rc != 0 when: tailscale_version_check.rc != 0
- name: Check if Tailscale repository exists and is correct - name: Check if Tailscale repository exists and is correct