refactor(web-app-wordpress): unify variable naming to uppercase WORDPRESS_* style

- Replaced all lowercase wordpress_* variables with uppercase WORDPRESS_* equivalents
- Ensured consistency across tasks, templates, and vars
- Improves readability and aligns with naming conventions

Conversation: https://chatgpt.com/share/68af29b5-8e7c-800f-bd12-48cc5956311c
This commit is contained in:
2025-08-27 17:52:38 +02:00
parent bae2bc21ec
commit 73e7fbdc8a
11 changed files with 70 additions and 70 deletions

View File

@@ -2,11 +2,11 @@
- name: "Include role srv-domain-provision for {{ application_id }}"
include_role:
name: srv-domain-provision
loop: "{{ wordpress_domains }}"
loop: "{{ WORDPRESS_DOMAINS }}"
loop_control:
loop_var: domain
vars:
proxy_extra_configuration: "client_max_body_size {{ wordpress_max_upload_size }};"
proxy_extra_configuration: "client_max_body_size {{ WORDPRESS_MAX_UPLOAD_SIZE }};"
http_port: "{{ ports.localhost.http[application_id] }}"
- name: "load docker and db for {{ application_id }}"
@@ -21,22 +21,22 @@
dest: "{{ docker_compose.directories.instance }}upload.ini"
notify: docker compose up
- name: "Transfering msmtprc to {{ host_msmtp_conf }}"
- name: "Transfering msmtprc to {{ WORDPRESS_HOST_MSMTP_CONF }}"
template:
src: "{{ playbook_dir }}/roles/sys-svc-msmtp/templates/msmtprc.conf.j2"
dest: "{{ host_msmtp_conf }}"
dest: "{{ WORDPRESS_HOST_MSMTP_CONF }}"
notify: docker compose up
- name: Flush handlers to make {{ wordpress_config_file }} available before patch
- name: Flush handlers to make {{ WORDPRESS_CONFIG_FILE }} available before patch
meta: flush_handlers
- name: Check if {{ wordpress_config_file }} exists in WordPress
command: docker exec -u {{ wordpress_user }} {{ wordpress_container }} test -f {{ wordpress_config_path }}
- name: Check if {{ WORDPRESS_CONFIG_FILE }} exists in WordPress
command: docker exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER }} test -f {{ WORDPRESS_CONFIG_PATH }}
register: wp_config_file_exists
changed_when: false
failed_when: false
- name: Patch WordPress {{ wordpress_config_file }} with updated DB credentials
- name: Patch WordPress {{ WORDPRESS_CONFIG_FILE }} with updated DB credentials
include_tasks: 01_patch_config.yml
when: wp_config_file_exists.rc == 0
@@ -47,7 +47,7 @@
block:
- name: "Iterate through WordPress plugins"
include_tasks: 03_enable_plugin.yml
loop: "{{ wordpress_plugins }}"
loop: "{{ WORDPRESS_PLUGINS }}"
loop_control:
label: "{{ item.key }}"
vars:
@@ -58,8 +58,8 @@
- name: Detect if WordPress is Multisite
command: >
docker exec -u {{ wordpress_user }} {{ wordpress_container }}
wp eval 'echo (int) is_multisite();' --path={{ wordpress_docker_html_path }}
docker exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER }}
wp eval 'echo (int) is_multisite();' --path={{ WORDPRESS_DOCKER_HTML_PATH }}
register: wp_is_multisite
changed_when: false