Compare commits

..

No commits in common. "699aaefac3be5da2ba56440d2c2c289c8d5a71c7" and "83a5d988af28d5082ad9f9aac5e1122705f2f687" have entirely different histories.

13 changed files with 27 additions and 63 deletions

View File

@ -297,79 +297,46 @@ jobs:
set -e 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
# Use a known working version to avoid download issues # Download and install SonarScanner
SONAR_SCANNER_VERSION="5.0.1.3006" echo "Detecting latest SonarScanner version..."
SCANNER_URL="https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.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//')
if [ -z "$SONAR_SCANNER_VERSION" ]; then
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}" 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}" echo "Downloading from: ${SCANNER_URL}"
if ! wget -q --show-progress "${SCANNER_URL}" -O /tmp/sonar-scanner.zip; then
# Download with verbose error output
if ! wget --progress=bar:force "${SCANNER_URL}" -O /tmp/sonar-scanner.zip 2>&1; then
echo "❌ Failed to download SonarScanner" echo "❌ Failed to download SonarScanner"
echo "Checking if file was partially downloaded:"
ls -lh /tmp/sonar-scanner.zip 2>/dev/null || echo "No file found"
exit 1 exit 1
fi fi
# Verify download
if [ ! -f /tmp/sonar-scanner.zip ] || [ ! -s /tmp/sonar-scanner.zip ]; then
echo "❌ Downloaded file is missing or empty"
exit 1
fi
echo "Download complete. File size: $(du -h /tmp/sonar-scanner.zip | cut -f1)"
echo "Extracting SonarScanner..." echo "Extracting SonarScanner..."
if ! unzip -q /tmp/sonar-scanner.zip -d /tmp; then if ! unzip -q /tmp/sonar-scanner.zip -d /tmp; then
echo "❌ Failed to extract SonarScanner" echo "❌ Failed to extract SonarScanner"
echo "Archive info:"
file /tmp/sonar-scanner.zip || true
unzip -l /tmp/sonar-scanner.zip 2>&1 | head -20 || true
exit 1 exit 1
fi fi
# Find the extracted directory (handle both naming conventions)
EXTRACTED_DIR=""
if [ -d "/tmp/sonar-scanner-${SONAR_SCANNER_VERSION}-linux" ]; then if [ -d "/tmp/sonar-scanner-${SONAR_SCANNER_VERSION}-linux" ]; then
EXTRACTED_DIR="/tmp/sonar-scanner-${SONAR_SCANNER_VERSION}-linux" mv /tmp/sonar-scanner-${SONAR_SCANNER_VERSION}-linux /opt/sonar-scanner
elif [ -d "/tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux" ]; then elif [ -d "/tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux" ]; then
EXTRACTED_DIR="/tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux" mv /tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux /opt/sonar-scanner
else else
# Try to find any sonar-scanner directory
EXTRACTED_DIR=$(find /tmp -maxdepth 1 -type d -name "*sonar-scanner*" | head -1)
fi
if [ -z "$EXTRACTED_DIR" ] || [ ! -d "$EXTRACTED_DIR" ]; then
echo "❌ SonarScanner directory not found after extraction" echo "❌ SonarScanner directory not found after extraction"
echo "Contents of /tmp:" ls -la /tmp/ | grep sonar
ls -la /tmp/ | grep -E "(sonar|zip)" || ls -la /tmp/ | head -20
exit 1 exit 1
fi fi
echo "Found extracted directory: ${EXTRACTED_DIR}" ln -sf /opt/sonar-scanner/bin/sonar-scanner /usr/local/bin/sonar-scanner
mv "${EXTRACTED_DIR}" /opt/sonar-scanner chmod +x /opt/sonar-scanner/bin/sonar-scanner
chmod +x /usr/local/bin/sonar-scanner
# Create symlink
if [ -f /opt/sonar-scanner/bin/sonar-scanner ]; then
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
else
echo "❌ sonar-scanner binary not found in /opt/sonar-scanner/bin/"
echo "Contents of /opt/sonar-scanner/bin/:"
ls -la /opt/sonar-scanner/bin/ || true
exit 1
fi
echo "Verifying installation..." echo "Verifying installation..."
if ! sonar-scanner --version; then sonar-scanner --version || (echo "❌ SonarScanner verification failed" && exit 1)
echo "❌ SonarScanner verification failed"
echo "PATH: $PATH"
which sonar-scanner || echo "sonar-scanner not in PATH"
exit 1
fi
echo "✓ SonarScanner installed successfully"
- name: Verify SonarQube connection - name: Verify SonarQube connection
run: | run: |

View File

@ -6,4 +6,4 @@ ansible_become: true
ansible_become_method: sudo ansible_become_method: sudo
# Configure shell for ladmin user # Configure shell for ladmin user
shell_users: shell_users:
- ladmin - ladmin

View File

@ -45,7 +45,6 @@
fi fi
register: brave_repo_check register: brave_repo_check
failed_when: false failed_when: false
changed_when: false
when: applications_brave_needs_install when: applications_brave_needs_install
- name: Clean up duplicate Brave repository files - name: Clean up duplicate Brave repository files

View File

@ -16,4 +16,4 @@ install_r: false
r_packages: r_packages:
- r-base - r-base
- r-base-dev - r-base-dev
- r-recommended - r-recommended

View File

@ -4,4 +4,4 @@
name: jupyter-notebook name: jupyter-notebook
state: restarted state: restarted
daemon_reload: true daemon_reload: true
become: true become: true

View File

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

View File

@ -199,4 +199,4 @@
- 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

@ -46,7 +46,6 @@
fi fi
register: nodesource_key_check register: nodesource_key_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: Remove incorrect NodeSource repository - name: Remove incorrect NodeSource repository

View File

@ -43,4 +43,4 @@
ansible.builtin.file: ansible.builtin.file:
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

@ -26,4 +26,4 @@
repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable" repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
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

@ -34,4 +34,4 @@
repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ docker_ubuntu_codename }} stable" repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ docker_ubuntu_codename }} stable"
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

@ -26,4 +26,4 @@
repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable" repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
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

@ -34,7 +34,6 @@
fi fi
register: tailscale_repo_check register: tailscale_repo_check
failed_when: false failed_when: false
changed_when: false
when: tailscale_version_check.rc != 0 when: tailscale_version_check.rc != 0
- name: Remove incorrect Tailscale GPG key - name: Remove incorrect Tailscale GPG key