#####################################
### someone"s ansible provisioner ###
#####################################
# Part of: https://git.somenet.org/root/pub/somesible.git
# 2017-2025 by someone <someone@somenet.org>
#
---
- name: include vars_nginx_vhost_custom
  include_vars:
    file: "{{item}}"
    name: vars_nginx_vhost_custom
  with_first_found:
    - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/{{mediawiki_domain}}-vars_nginx_vhost_custom.yml"
    - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/{{mediawiki_domain}}-vars_nginx_vhost_custom.yml"
    - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/{{mediawiki_domain}}-vars_nginx_vhost_custom.yml"
    - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/vars_nginx_vhost_custom.yml"
    - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/vars_nginx_vhost_custom.yml"
    - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/vars_nginx_vhost_custom.yml"
    - "default/vars_nginx_vhost_custom.yml"


- name: configure vhost
  include_role:
    name: server/nginx/vhost-unified
  vars:
    vhost_type: "php"
    vhost_name: "{{mediawiki_domain}}"
    vhost_php_custom: ["bzip2", "php-apcu", "php8.4-pgsql", "php8.4-curl", "php8.4-gd", "php8.4-intl", "php-imagick", "php8.4-mbstring", "php8.4-mysql", "php8.4-xml", "php8.4-zip"]
    vhost_fix_perms: False
    vhost_custom:
      vhost_custom_pre_server: "{{vars_nginx_vhost_custom.vhost_custom_pre_server}}"
      vhost_custom: "{{vars_nginx_vhost_custom.vhost_custom}}"
