From 6f22a3e47b447dfb81884463347629af3abdc6f6 Mon Sep 17 00:00:00 2001 From: VC Date: Wed, 16 Apr 2025 13:43:20 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8:=20add=20wwwdev.nintendojo.fr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory/host_vars/web3.yml | 24 ++++++++++ playbooks/webapps.yml | 7 +++ .../vhosts/wwwdev.nintendojo.fr.conf.j2 | 46 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 inventory/host_vars/web3.yml create mode 100644 roles/nginx/templates/vhosts/wwwdev.nintendojo.fr.conf.j2 diff --git a/inventory/host_vars/web3.yml b/inventory/host_vars/web3.yml new file mode 100644 index 0000000..46bbd52 --- /dev/null +++ b/inventory/host_vars/web3.yml @@ -0,0 +1,24 @@ +--- +php_modules: ['opcache', 'mysql', 'mbstring', 'gd', 'intl', 'xml', 'bcmath', 'curl', 'imagick'] + +web_hostname: + - host: wwwdev.nintendojo.fr + type: wordpress + +mariadb_root_pass: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 65373663323065306532306235313032383331353337396131383766323535633831383062393632 + 3438613735613365333264356465336162346263666236300a306234336566303863346539343531 + 37313932653964366233393038306235353134356230653336306232373430386662306634616431 + 6332333837663064340a643535386465626636343436303263666333383461383730396135396666 + 3539 + +wordpress_maria_database: "dojo_wpdev" +wordpress_maria_user: "adm_wpdev" +wordpress_maria_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 66613837353166633536656166383232646232303535643931313531636230353265633638626231 + 6231323738656466333164326238666166383931633133380a633764366462323261376632666565 + 63646365636133363338383233653930663139343238313131313365646663393761656361333332 + 6634333736356438390a316237373836373132666334306661363863383665663139623935646437 + 6331 diff --git a/playbooks/webapps.yml b/playbooks/webapps.yml index caa79e4..46e480b 100644 --- a/playbooks/webapps.yml +++ b/playbooks/webapps.yml @@ -29,3 +29,10 @@ tags: [never, phpbb] - role: retrodojo tags: [never, retrodojo] + +- name: Install dojo webapplications + hosts: web3 + diff: true + roles: + - role: wordpress + tags: [never, wordpress] diff --git a/roles/nginx/templates/vhosts/wwwdev.nintendojo.fr.conf.j2 b/roles/nginx/templates/vhosts/wwwdev.nintendojo.fr.conf.j2 new file mode 100644 index 0000000..28d7668 --- /dev/null +++ b/roles/nginx/templates/vhosts/wwwdev.nintendojo.fr.conf.j2 @@ -0,0 +1,46 @@ +## WP dev NintendojoFR +server { +{% include './templates/header.conf.j2' %} + + root /var/www/wwwdev.nintendojo.fr/; + index index.html index.htm index.php; + + client_max_body_size 2G; + + # couper les fichiers cachés + location ~* /(?:uploads|files)/.*\.php$ { + deny all; + } + + # couper les fichiers textes du captcha + location ~* /wp-content/uploads/wpcf7_captcha/.*\.txt$ { + deny all; + } + + # Optimisation des images + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 1w; + log_not_found off; + } + + # Interprétation PHP + location ~ ^/(index).php(/.*)+ { + fastcgi_split_path_info ^(.+\.php)(/.*)$; + try_files $fastcgi_script_name =404; + fastcgi_ignore_headers Cache-Control Expires Set-Cookie; + fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock; + fastcgi_read_timeout 60; + include fastcgi_params; + } + + location ~ \.php$ { + try_files $uri $uri/ =404; + fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock; + fastcgi_read_timeout 60; + include fastcgi_params; + } + + location / { + try_files $uri $uri/ /index.php$uri?$args; + } +}