From 90ebf4f66c128ebd30a1a705d4b452c34334de3b Mon Sep 17 00:00:00 2001 From: Muhammed Hussein Karimi Date: Fri, 22 Oct 2021 20:52:13 +0330 Subject: [PATCH] using variables for domain and guid to run added to readme --- ansible/README.md | 10 ++++++++-- ansible/roles/nginx/templates/nginx.conf | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ansible/README.md b/ansible/README.md index 4220dc80..fd255f56 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -9,5 +9,11 @@ This playbook comes with three roles To see more info see docker-compose, tasks and config files I will try to make this readme better - -> Replace status.yoursite with your domain name +## To run it +1. run `ansible-galaxy install -r ansible-requirements.yml` to get requirements +2. prepare inventory hosts +3. to run playbook +```bash +ansible-playbook ./playbook.yml -i --extra-vars "kuma_domain=" +``` +you can use other ansible playbook options too diff --git a/ansible/roles/nginx/templates/nginx.conf b/ansible/roles/nginx/templates/nginx.conf index 3fb78fed..fc23747e 100644 --- a/ansible/roles/nginx/templates/nginx.conf +++ b/ansible/roles/nginx/templates/nginx.conf @@ -20,8 +20,8 @@ http { ### SSL Settings for all servers (https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.2&config=intermediate) # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate - ssl_certificate /etc/nginx/ssl/status.yoursite.fullchain.pem; - ssl_certificate_key /etc/nginx/ssl/status.yoursite.privkey.pem; + ssl_certificate /etc/nginx/ssl/{{ kuma_domain }}.fullchain.pem; + ssl_certificate_key /etc/nginx/ssl/{{ kuma_domain }}.privkey.pem; ssl_session_timeout 1d; ssl_session_cache shared:MozSSL:10m; # about 40000 sessions ssl_session_tickets off; @@ -59,12 +59,12 @@ http { # Redirect HTTP request to HTTPS server { listen 80 default_server; - server_name status.yoursite; + server_name {{ kuma_domain }}; return 302 https://$host$request_uri; } server { - server_name status.yoursite; + server_name {{ kuma_domain }}; listen 443 ssl http2 default_server; access_log /var/log/nginx/yoursite.access.log main;