fix: resolve all YAML linting errors in playbooks and inventories

- Fix line length violations by using YAML folded strings (>-)
- Remove trailing whitespace from all files
- Add missing document start markers (---) to inventory files
- Improve readability of long Jinja2 template expressions
- Maintain YAML linting compliance for production-ready code

All files now pass yamllint validation successfully.
This commit is contained in:
Sebastian Palencsár
2025-06-21 00:30:13 +02:00
parent b339ed1e43
commit 2045307d1d
4 changed files with 34 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
# Docker Testing Environment Inventory # Docker Testing Environment Inventory
# For testing deployments before production # For testing deployments before production
---
wordpress_servers: wordpress_servers:
hosts: hosts:
docker-test: docker-test:
@@ -10,22 +10,22 @@ wordpress_servers:
ansible_ssh_pass: ansible123 ansible_ssh_pass: ansible123
ansible_become_pass: ansible123 ansible_become_pass: ansible123
domain_name: localhost domain_name: localhost
# SSL Configuration (usually disabled for testing) # SSL Configuration (usually disabled for testing)
ssl_enabled: false ssl_enabled: false
# WordPress Database (Test credentials) # WordPress Database (Test credentials)
mysql_root_password: "test_root_password" mysql_root_password: "test_root_password"
wordpress_db_name: "wordpress" wordpress_db_name: "wordpress"
wordpress_db_user: "wp_user" wordpress_db_user: "wp_user"
wordpress_db_password: "test_wp_password" wordpress_db_password: "test_wp_password"
# WordPress Admin (Test credentials) # WordPress Admin (Test credentials)
wp_admin_user: "admin" wp_admin_user: "admin"
wp_admin_password: "test_admin_password" wp_admin_password: "test_admin_password"
wp_admin_email: "admin@localhost" wp_admin_email: "admin@localhost"
wp_site_title: "Test WordPress Site" wp_site_title: "Test WordPress Site"
# Ultimate Features (for testing Ultimate-Playbook) # Ultimate Features (for testing Ultimate-Playbook)
enable_redis: true enable_redis: true
enable_opcache: true enable_opcache: true

View File

@@ -1,6 +1,6 @@
# Production Server Configuration # Production Server Configuration
# SECURITY: Change all passwords before deployment! # SECURITY: Change all passwords before deployment!
---
wordpress_servers: wordpress_servers:
hosts: hosts:
your-server.example.com: your-server.example.com:
@@ -9,23 +9,23 @@ wordpress_servers:
# ansible_ssh_pass: "your_password" # Use SSH keys instead! # ansible_ssh_pass: "your_password" # Use SSH keys instead!
# ansible_become_pass: "your_sudo_password" # Use passwordless sudo instead! # ansible_become_pass: "your_sudo_password" # Use passwordless sudo instead!
domain_name: example.com domain_name: example.com
# SSL Configuration # SSL Configuration
ssl_enabled: false # Set to true for HTTPS with Let's Encrypt ssl_enabled: false # Set to true for HTTPS with Let's Encrypt
ssl_email: admin@example.com # Required if ssl_enabled=true ssl_email: admin@example.com # Required if ssl_enabled=true
# WordPress Database (CHANGE THESE!) # WordPress Database (CHANGE THESE!)
mysql_root_password: "CHANGE_ME_ROOT_PASSWORD" mysql_root_password: "CHANGE_ME_ROOT_PASSWORD"
wordpress_db_name: "wordpress" wordpress_db_name: "wordpress"
wordpress_db_user: "wp_user" wordpress_db_user: "wp_user"
wordpress_db_password: "CHANGE_ME_WP_PASSWORD" wordpress_db_password: "CHANGE_ME_WP_PASSWORD"
# WordPress Admin (CHANGE THESE!) # WordPress Admin (CHANGE THESE!)
wp_admin_user: "admin" wp_admin_user: "admin"
wp_admin_password: "CHANGE_ME_ADMIN_PASSWORD" wp_admin_password: "CHANGE_ME_ADMIN_PASSWORD"
wp_admin_email: "admin@example.com" wp_admin_email: "admin@example.com"
wp_site_title: "My WordPress Site" wp_site_title: "My WordPress Site"
# Ultimate Performance Features (for lemp-wordpress-ultimate.yml) # Ultimate Performance Features (for lemp-wordpress-ultimate.yml)
enable_redis: false # Redis object caching enable_redis: false # Redis object caching
enable_opcache: false # PHP OPcache optimization enable_opcache: false # PHP OPcache optimization

View File

@@ -44,14 +44,17 @@
- name: Set deployment environment (auto-detect or override) - name: Set deployment environment (auto-detect or override)
set_fact: set_fact:
deployment_environment: "{{ deployment_environment | default('docker' if docker_env.stat.exists else 'bare_metal') }}" deployment_environment: >-
{{ deployment_environment | default('docker' if docker_env.stat.exists else 'bare_metal') }}
tags: always tags: always
- name: Set WordPress site URL with smart defaults - name: Set WordPress site URL with smart defaults
set_fact: set_fact:
wp_site_url: "{{ wp_site_url | default(_auto_wp_url) }}" wp_site_url: "{{ wp_site_url | default(_auto_wp_url) }}"
vars: vars:
_auto_wp_url: "{{ 'http://localhost:8080' if (deployment_environment == 'docker') else 'http://' + (ansible_default_ipv4.address | default('localhost')) }}" _auto_wp_url: >-
{{ 'http://localhost:8080' if (deployment_environment == 'docker')
else 'http://' + (ansible_default_ipv4.address | default('localhost')) }}
tags: always tags: always
- name: Debug deployment configuration - name: Debug deployment configuration
@@ -223,7 +226,7 @@
-keyout {{ ssl_cert_key_path | default('/etc/ssl/private/nginx-selfsigned.key') }} -keyout {{ ssl_cert_key_path | default('/etc/ssl/private/nginx-selfsigned.key') }}
-out {{ ssl_cert_path | default('/etc/ssl/certs/nginx-selfsigned.crt') }} -out {{ ssl_cert_path | default('/etc/ssl/certs/nginx-selfsigned.crt') }}
-subj "/C=DE/ST=State/L=City/O=Organization/OU=OrgUnit/CN={{ domain_name }}" -subj "/C=DE/ST=State/L=City/O=Organization/OU=OrgUnit/CN={{ domain_name }}"
when: when:
- ssl_enabled | default(false) - ssl_enabled | default(false)
- not (ssl_cert_path is defined and ssl_cert_key_path is defined) - not (ssl_cert_path is defined and ssl_cert_key_path is defined)
tags: ssl tags: ssl
@@ -231,7 +234,9 @@
# Nginx Configuration # Nginx Configuration
- name: Create Nginx configuration for WordPress - name: Create Nginx configuration for WordPress
template: template:
src: ../templates/{% if ssl_enabled | default(false) %}wordpress-ssl.nginx.j2{% else %}wordpress.nginx.j2{% endif %} src: >-
../templates/{% if ssl_enabled | default(false) %}wordpress-ssl.nginx.j2{%
else %}wordpress.nginx.j2{% endif %}
dest: "{{ nginx_sites_available }}/wordpress" dest: "{{ nginx_sites_available }}/wordpress"
backup: yes backup: yes
notify: restart nginx notify: restart nginx
@@ -505,7 +510,7 @@
block: | block: |
# Ultimate Performance optimizations (unique directives only) # Ultimate Performance optimizations (unique directives only)
keepalive_requests 1000; keepalive_requests 1000;
# Enhanced Gzip compression # Enhanced Gzip compression
gzip_vary on; gzip_vary on;
gzip_min_length 1000; gzip_min_length 1000;
@@ -520,18 +525,18 @@
application/xml+rss application/xml+rss
application/atom+xml application/atom+xml
image/svg+xml; image/svg+xml;
# Buffer sizes # Buffer sizes
client_body_buffer_size 128k; client_body_buffer_size 128k;
client_max_body_size 64m; client_max_body_size 64m;
client_header_buffer_size 1k; client_header_buffer_size 1k;
large_client_header_buffers 4 4k; large_client_header_buffers 4 4k;
# Timeouts # Timeouts
client_body_timeout 12; client_body_timeout 12;
client_header_timeout 12; client_header_timeout 12;
send_timeout 10; send_timeout 10;
# Cache for file handles # Cache for file handles
open_file_cache max=200000 inactive=20s; open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s; open_file_cache_valid 30s;
@@ -554,7 +559,8 @@
- name: Display Nginx optimization status - name: Display Nginx optimization status
debug: debug:
msg: "Nginx performance optimization {{ 'ENABLED' if enable_nginx_optimization | default(false) else 'DISABLED' }}" msg: >-
Nginx performance optimization {{ 'ENABLED' if enable_nginx_optimization | default(false) else 'DISABLED' }}
tags: nginx-optimization tags: nginx-optimization
handlers: handlers:

View File

@@ -44,14 +44,17 @@
- name: Set deployment environment (auto-detect or override) - name: Set deployment environment (auto-detect or override)
set_fact: set_fact:
deployment_environment: "{{ deployment_environment | default('docker' if docker_env.stat.exists else 'bare_metal') }}" deployment_environment: >-
{{ deployment_environment | default('docker' if docker_env.stat.exists else 'bare_metal') }}
tags: always tags: always
- name: Set WordPress site URL with smart defaults - name: Set WordPress site URL with smart defaults
set_fact: set_fact:
wp_site_url: "{{ wp_site_url | default(_auto_wp_url) }}" wp_site_url: "{{ wp_site_url | default(_auto_wp_url) }}"
vars: vars:
_auto_wp_url: "{{ 'http://localhost:8080' if (deployment_environment == 'docker') else 'http://' + (ansible_default_ipv4.address | default('localhost')) }}" _auto_wp_url: >-
{{ 'http://localhost:8080' if (deployment_environment == 'docker')
else 'http://' + (ansible_default_ipv4.address | default('localhost')) }}
tags: always tags: always
- name: Debug deployment configuration - name: Debug deployment configuration
@@ -223,7 +226,7 @@
-keyout {{ ssl_cert_key_path | default('/etc/ssl/private/nginx-selfsigned.key') }} -keyout {{ ssl_cert_key_path | default('/etc/ssl/private/nginx-selfsigned.key') }}
-out {{ ssl_cert_path | default('/etc/ssl/certs/nginx-selfsigned.crt') }} -out {{ ssl_cert_path | default('/etc/ssl/certs/nginx-selfsigned.crt') }}
-subj "/C=DE/ST=State/L=City/O=Organization/OU=OrgUnit/CN={{ domain_name }}" -subj "/C=DE/ST=State/L=City/O=Organization/OU=OrgUnit/CN={{ domain_name }}"
when: when:
- ssl_enabled | default(false) - ssl_enabled | default(false)
- not (ssl_cert_path is defined and ssl_cert_key_path is defined) - not (ssl_cert_path is defined and ssl_cert_key_path is defined)
tags: ssl tags: ssl
@@ -231,7 +234,9 @@
# Nginx Configuration # Nginx Configuration
- name: Configure Nginx for WordPress - name: Configure Nginx for WordPress
template: template:
src: ../templates/{% if ssl_enabled | default(false) %}wordpress-ssl.nginx.j2{% else %}wordpress.nginx.j2{% endif %} src: >-
../templates/{% if ssl_enabled | default(false) %}wordpress-ssl.nginx.j2{%
else %}wordpress.nginx.j2{% endif %}
dest: "{{ nginx_sites_available }}/wordpress" dest: "{{ nginx_sites_available }}/wordpress"
notify: restart nginx notify: restart nginx
tags: nginx tags: nginx