mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 07:18:09 +02:00
Nginx variable refactoring and general bug solving. Got interupted commit not tested
This commit is contained in:
@@ -11,7 +11,7 @@ This Ansible role configures an Nginx server to serve a static homepage. It hand
|
||||
|
||||
## Role Variables
|
||||
|
||||
- `nginx_homepage_root`: The directory where the homepage content will be stored (default: `/usr/share/nginx/homepage`)
|
||||
- `nginx.directories.homepage`: The directory where the homepage content will be stored (default: `/usr/share/nginx/homepage`)
|
||||
- `domain`: The domain name for the Nginx server configuration
|
||||
- `administrator_email`: The email used for SSL certificate registration with Let's Encrypt
|
||||
- `nginx_static_repository_address`: The Git repository address containing the homepage content
|
||||
|
@@ -2,14 +2,14 @@
|
||||
- name: "pull homepage from {{nginx_static_repository_address}}"
|
||||
git:
|
||||
repo: "{{nginx_static_repository_address}}"
|
||||
dest: "{{nginx_homepage_root}}"
|
||||
dest: "{{nginx.directories.homepage}}"
|
||||
update: yes
|
||||
ignore_errors: true
|
||||
|
||||
- name: configure {{primary_domain}}.conf
|
||||
template:
|
||||
src: "static.nginx.conf.j2"
|
||||
dest: "{{nginx_servers_directory}}{{primary_domain}}.conf"
|
||||
dest: "{{nginx.directories.http.servers}}{{primary_domain}}.conf"
|
||||
vars:
|
||||
domain: "{{primary_domain}}"
|
||||
notify: restart nginx
|
||||
|
@@ -13,12 +13,12 @@ server
|
||||
|
||||
location /
|
||||
{
|
||||
root {{nginx_homepage_root}};
|
||||
root {{nginx.directories.homepage}};
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /.well-known/ {
|
||||
alias {{nginx_well_known_root}};
|
||||
alias {{nginx.directories.well_known}};
|
||||
allow all;
|
||||
default_type "text/plain";
|
||||
autoindex on;
|
||||
|
Reference in New Issue
Block a user