Initial commit

This commit is contained in:
nemunaire 2023-06-15 00:42:55 +02:00
commit 7a1897b0cb
4 changed files with 45 additions and 0 deletions

6
defaults/main.yml Normal file
View File

@ -0,0 +1,6 @@
---
path: /
error_pages:
404: /404.html
notls: false
rewrite: []

18
meta/main.yml Normal file
View File

@ -0,0 +1,18 @@
---
dependencies: []
galaxy_info:
role_name: nginx-config-dual
author: 'Pierre-Olivier Mercier <nemunaire+iac@nemunai.re>'
description: Abstraction to configure nginx server for a domain shared with multiple hosts
license: GPL-3.0-or-later
min_ansible_version: 2.9
platforms:
- name: Alpine
versions:
- all
- name: Debian
versions:
- all
galaxy_tags: []

19
tasks/main.yml Normal file
View File

@ -0,0 +1,19 @@
---
- ansible.builtin.set_fact:
unsecure_server: |
location @{{ instance_name | default(ansible_play_name) | replace(" ", "_") }}_neighbor {
proxy_pass http://{{ neighbor.host }};
proxy_set_header Host {{ neighbor.target }};
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
nginx_acme_challenge: |
try_files $uri $uri/ @{{ instance_name | default(ansible_play_name) | replace(" ", "_") }}_neighbor;
- ansible.builtin.set_fact:
onlyifnotexist: true
server: ""
when: notls
- ansible.builtin.include_role:
name: "{{ next_role }}"

2
vars/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
next_role: re.nemunai.nginx-config-svc