From 9d297d144c9d50903721d744688541b5f8bf90d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Palencs=C3=A1r?= Date: Wed, 18 Jun 2025 19:41:02 +0200 Subject: [PATCH] Fix linting errors: Add YAML document start, remove trailing spaces, fix line length --- .yamllint.yml | 1 + playbooks/install-wordpress-official.yml | 3 ++- .../ultimate-performance-optimization.yml | 26 +++++++++---------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.yamllint.yml b/.yamllint.yml index b50462c..1371f59 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -1,3 +1,4 @@ +--- extends: default rules: diff --git a/playbooks/install-wordpress-official.yml b/playbooks/install-wordpress-official.yml index 03d4342..d769113 100644 --- a/playbooks/install-wordpress-official.yml +++ b/playbooks/install-wordpress-official.yml @@ -140,7 +140,8 @@ msg: | Status: {{ homepage_test.status | default('Fehler') }} Content-Length: {{ homepage_test.content | length if homepage_test.content is defined else 0 }} - Enthält WordPress: {{ 'Ja' if homepage_test.content is defined and 'WordPress' in homepage_test.content else 'Nein' }} + Enthält WordPress: {{ 'Ja' if homepage_test.content is defined and + 'WordPress' in homepage_test.content else 'Nein' }} - name: Erfolgreiche Installation debug: diff --git a/playbooks/ultimate-performance-optimization.yml b/playbooks/ultimate-performance-optimization.yml index ab9d783..6318f40 100644 --- a/playbooks/ultimate-performance-optimization.yml +++ b/playbooks/ultimate-performance-optimization.yml @@ -5,7 +5,7 @@ become: yes vars_files: - "../vars/{{ ansible_os_family | lower }}.yml" - + vars: # Performance Configuration enable_performance_monitoring: "{{ enable_performance_monitoring | default(true) }}" @@ -13,18 +13,18 @@ enable_nginx_optimization: "{{ enable_nginx_optimization | default(true) }}" enable_php_optimization: "{{ enable_php_optimization | default(true) }}" enable_mysql_optimization: "{{ enable_mysql_optimization | default(true) }}" - + # Nginx Performance Settings nginx_worker_processes: "{{ ansible_processor_vcpus }}" nginx_worker_connections: "{{ (ansible_memtotal_mb / 4) | int }}" nginx_fastcgi_cache_enabled: true nginx_fastcgi_cache_size: "{{ (ansible_memtotal_mb / 10) | int }}m" - + # PHP Performance Settings php_memory_limit: "{{ (ansible_memtotal_mb / 4) | int }}M" php_max_execution_time: 300 php_max_input_vars: 3000 - + # MySQL Performance Settings innodb_buffer_pool_size: "{{ (ansible_memtotal_mb / 2) | int }}M" max_connections: "{{ (ansible_memtotal_mb / 10) | int }}" @@ -198,13 +198,13 @@ content: | #!/bin/bash # Cache warming script for WordPress - + WORDPRESS_URL="{{ wordpress_url }}" SITEMAP_URL="${WORDPRESS_URL}/sitemap.xml" - + # Warm up homepage curl -s "$WORDPRESS_URL" > /dev/null - + # Warm up sitemap URLs (if sitemap exists) if curl -s "$SITEMAP_URL" | grep -q "xml"; then curl -s "$SITEMAP_URL" | grep -oP 'https?://[^<]+' | head -20 | while read url; do @@ -233,21 +233,21 @@ content: | #!/bin/bash # WordPress Database Optimization Script - + cd {{ wordpress_path }} - + # Optimize database tables wp db optimize --allow-root - + # Clean up spam comments wp comment delete $(wp comment list --status=spam --format=ids --allow-root) --allow-root 2>/dev/null || true - + # Clean up trash posts wp post delete $(wp post list --post_status=trash --format=ids --allow-root) --allow-root 2>/dev/null || true - + # Clean up expired transients wp transient delete --expired --allow-root - + # Update search index (if search plugin is installed) wp search-replace 'old-domain.com' '{{ domain_name }}' --dry-run --allow-root || true dest: /usr/local/bin/wordpress-db-optimize.sh