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
# For testing deployments before production
---
wordpress_servers:
hosts:
docker-test:

View File

@@ -1,6 +1,6 @@
# Production Server Configuration
# SECURITY: Change all passwords before deployment!
---
wordpress_servers:
hosts:
your-server.example.com:

View File

@@ -44,14 +44,17 @@
- name: Set deployment environment (auto-detect or override)
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
- name: Set WordPress site URL with smart defaults
set_fact:
wp_site_url: "{{ wp_site_url | default(_auto_wp_url) }}"
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
- name: Debug deployment configuration
@@ -231,7 +234,9 @@
# Nginx Configuration
- name: Create Nginx configuration for WordPress
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"
backup: yes
notify: restart nginx
@@ -554,7 +559,8 @@
- name: Display Nginx optimization status
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
handlers:

View File

@@ -44,14 +44,17 @@
- name: Set deployment environment (auto-detect or override)
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
- name: Set WordPress site URL with smart defaults
set_fact:
wp_site_url: "{{ wp_site_url | default(_auto_wp_url) }}"
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
- name: Debug deployment configuration
@@ -231,7 +234,9 @@
# Nginx Configuration
- name: Configure Nginx for WordPress
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"
notify: restart nginx
tags: nginx