From 942f869c1590240aaf8c8cd71f60c48579e28f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Mon, 15 Jul 2024 19:35:45 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(ascii-facemaker):=20Added=20a=20ne?= =?UTF-8?q?w=20Ansible=20role=20for=20`ascii-facemaker`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.yml | 3 +++ roles/ascii-facemaker/files/docker-compose.yml | 9 +++++++++ roles/ascii-facemaker/tasks/main.yml | 11 +++++++++++ roles/ascii-facemaker/templates/nginx.j2 | 16 ++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 roles/ascii-facemaker/files/docker-compose.yml create mode 100644 roles/ascii-facemaker/tasks/main.yml create mode 100644 roles/ascii-facemaker/templates/nginx.j2 diff --git a/main.yml b/main.yml index e9e90c4..17cff24 100644 --- a/main.yml +++ b/main.yml @@ -119,6 +119,9 @@ - role: linkstack tags: linkstack + + - role: ascii-facemaker + tags: ascii-facemaker - role: vitalk.secure-ssh tags: ssh diff --git a/roles/ascii-facemaker/files/docker-compose.yml b/roles/ascii-facemaker/files/docker-compose.yml new file mode 100644 index 0000000..f330ec8 --- /dev/null +++ b/roles/ascii-facemaker/files/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.8" + +services: + linkstack: + image: theobori/ascii-facemaker:1.0 + container_name: ascii-facemaker + ports: + - "127.0.0.1:9999:80" + restart: unless-stopped diff --git a/roles/ascii-facemaker/tasks/main.yml b/roles/ascii-facemaker/tasks/main.yml new file mode 100644 index 0000000..e9dc4f5 --- /dev/null +++ b/roles/ascii-facemaker/tasks/main.yml @@ -0,0 +1,11 @@ +- name: Include service role + ansible.builtin.include_role: + name: "service" + vars: + service_name: "ascii-facemaker" + service_fqdn: "ascii-facemaker.{{ domain }}" + service_nginx_port: "9999" + service_certbot: true + service_nginx: true + service_docker_compose: true + service_systemd_service: true diff --git a/roles/ascii-facemaker/templates/nginx.j2 b/roles/ascii-facemaker/templates/nginx.j2 new file mode 100644 index 0000000..027f63d --- /dev/null +++ b/roles/ascii-facemaker/templates/nginx.j2 @@ -0,0 +1,16 @@ +server { + include listen-443; + server_name {{ server_name }}; + + include ssl_params; + ssl_certificate /etc/letsencrypt/live/{{ server_name }}/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/{{ server_name }}/privkey.pem; + + include header_params; + + location / { + include proxy_params; + + proxy_pass http://127.0.0.1:{{ server_port }}/; + } +}