diff --git a/ansible/inventory.yml b/ansible/inventory.yml index 37616f2..3d28116 100644 --- a/ansible/inventory.yml +++ b/ansible/inventory.yml @@ -1,5 +1,56 @@ php_version: 8.1 php: "php{{ php_version }}" +cert: + name: "{{ domain_name }}" + alternative_names: + - dashy: + nginx_config: dashy + domain: "www.{{ domain_name }}" + - gitea: + nginx_config: gitea + domain: "{{ gitea_domain_name }}" + - selfoss: + nginx_config: selfoss + domain: "{{ selfoss_domain_name }}" + - munin: + nginx_config: munin + domain: "{{ munin_domain_name }}" + - web1090: + nginx_config: web1090 + domain: "{{ web1090_domain_name }}" + - uptime_kuma: + nginx_config: uptime_kuma + domain: "{{ uptime_kuma_domain_name }}" + - grafana: + nginx_config: grafana + domain: "{{ grafana_domain_name }}" + - drone: + nginx_config: drone + domain: "{{ drone_domain_name }}" + - shopware6: + nginx_config: shopware6 + domain: "{{ shopware6_domain_name }}" + - wordpress: + nginx_config: wordpress + domain: "{{ wordpress_domain_name }}" + - bracket: + nginx_config: bracket + domain: "{{ bracket_api_domain_name }}" + - authelia: + nginx_config: authelia + domain: "{{ authelia_domain_name }}" + - alertmanager: + nginx_config: alertmanager + domain: "{{ alertmanager_domain_name }}" + - prometheus: + nginx_config: prometheus + domain: "{{ prometheus_domain_name }}" + - wg_easy_ui: + nginx_config: wg_easy_ui + domain: "{{ wg_easy_ui_domain_name }}" + - nomad: + nginx_config: nomad + domain: "{{ nomad_domain_name }}" authelia: secrets: diff --git a/ansible/provision.yml b/ansible/provision.yml index 56b2441..c35fa4c 100644 --- a/ansible/provision.yml +++ b/ansible/provision.yml @@ -15,6 +15,7 @@ - role: "homedir" - role: "letsencrypt" - role: "munin" + - role: "nomad" - role: "nginx" - role: "nix" - role: "postgres" diff --git a/ansible/roles/nginx/templates/sites-available/nomad.j2 b/ansible/roles/nginx/templates/sites-available/nomad.j2 new file mode 100644 index 0000000..878f511 --- /dev/null +++ b/ansible/roles/nginx/templates/sites-available/nomad.j2 @@ -0,0 +1,17 @@ +server { + server_name {{ nomad_domain_name }}; + + listen 443 ssl; + listen [::]:443 ssl; + + include /etc/authelia/nginx/authelia-location.conf; + + location / { + include /etc/authelia/nginx/proxy.conf; + include /etc/authelia/nginx/authelia-authrequest.conf; + proxy_pass http://localhost:4646; + } + + ssl_certificate /etc/letsencrypt/live/{{ domain_name }}/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/{{ domain_name }}/privkey.pem; +} diff --git a/ansible/roles/nomad/tasks/main.yml b/ansible/roles/nomad/tasks/main.yml new file mode 100644 index 0000000..87f17e6 --- /dev/null +++ b/ansible/roles/nomad/tasks/main.yml @@ -0,0 +1,19 @@ +--- +- name: Add hashicorp gpg key + shell: curl https://apt.releases.hashicorp.com/gpg | apt-key add - + become: true + +- name: Add hashicorp repo + apt_repository: + repo: deb https://apt.releases.hashicorp.com stable main + state: present + filename: hashicorp + become: true + +- name: Install Nomad + apt: + name: + - nomad + state: present + update_cache: yes + become: true