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:

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:

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
@@ -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
@@ -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
@@ -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