nexus stuff

This commit is contained in:
Torma Kristóf 2022-04-16 18:04:52 +02:00
parent 473bedc5e9
commit 94d50a5072
5 changed files with 25 additions and 6 deletions

14
host_vars/nexus.yaml Normal file
View File

@ -0,0 +1,14 @@
---
webserver:
defaultservername: nexus.kmlabz.com
customrule: |
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name registry.kmlabz.com;
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
location /{
proxy_pass http://127.0.0.1:8080;
}
}

View File

@ -0,0 +1,3 @@
webserver:
customrule: ""
defaultservername: "_"

View File

@ -12,13 +12,13 @@
state: restarted state: restarted
enabled: yes enabled: yes
- name: Upload site config to destination - name: "Generate nginx configuration"
copy: ansible.builtin.template:
src: nginx.conf src: nginx.conf
dest: /etc/nginx/nginx.conf dest: /etc/nginx/nginx.conf
mode: 644
owner: root owner: root
group: root group: root
mode: '0644'
- name: Reload nginx daemon - name: Reload nginx daemon
service: service:

View File

@ -54,6 +54,8 @@ http {
proxy_buffering off; proxy_buffering off;
proxy_request_buffering off; proxy_request_buffering off;
{{webserver.customrule}}
server { server {
listen 80 default_server; listen 80 default_server;
@ -65,7 +67,7 @@ http {
server { server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name _; server_name {{webserver.defaultservername}};
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
location /{ location /{