From d6505d896cb4aadcae6c1fa8f36447fc2e3daafa Mon Sep 17 00:00:00 2001 From: Phil Date: Tue, 3 Dec 2024 17:56:24 -0700 Subject: [PATCH] added codeserver to stack --- dns.yml | 2 ++ roles/docker/files/Caddyfile | 4 ++++ roles/docker/tasks/codeserver.yml | 19 +++++++++++++++++++ roles/docker/tasks/main.yml | 6 +++++- .../templates/codeserver-compose.yml.j2 | 17 +++++++++++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 roles/docker/tasks/codeserver.yml create mode 100644 roles/docker/templates/codeserver-compose.yml.j2 diff --git a/dns.yml b/dns.yml index c1a1967..e1d1348 100644 --- a/dns.yml +++ b/dns.yml @@ -25,6 +25,8 @@ ip: "152.53.36.98" - name: "paper" ip: "152.53.36.98" + - name: "code" + ip: "152.53.36.98" - name: nerder.land dns_records: - name: "forms" diff --git a/roles/docker/files/Caddyfile b/roles/docker/files/Caddyfile index 8aa2e35..56d30f2 100644 --- a/roles/docker/files/Caddyfile +++ b/roles/docker/files/Caddyfile @@ -26,6 +26,10 @@ tasks.thesatelliteoflove.com { reverse_proxy authentik-server-1:9000 } +code.thesatelliteoflove.com { + reverse_proxy authentik-server-1:9000 +} + files.thesatelliteoflove.com { reverse_proxy pingvin-pingvin-share-1:3000 } diff --git a/roles/docker/tasks/codeserver.yml b/roles/docker/tasks/codeserver.yml new file mode 100644 index 0000000..693ab1d --- /dev/null +++ b/roles/docker/tasks/codeserver.yml @@ -0,0 +1,19 @@ +- name: make codeserver directories + ansible.builtin.file: + path: "{{ item}}" + state: directory + loop: + - /opt/stacks/codeserver + +- name: Template out the compose file + ansible.builtin.template: + src: codeserver-compose.yml.j2 + dest: /opt/stacks/codeserver/compose.yml + owner: root + mode: 644 + +- name: deploy codeserver stack + community.docker.docker_compose_v2: + project_src: /opt/stacks/codeserver + files: + - compose.yml \ No newline at end of file diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 06cc607..77e9cf8 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -124,4 +124,8 @@ - name: Install heyform import_tasks: heyform.yml - tags: heyform \ No newline at end of file + tags: heyform + +- name: Install codeserver + import_tasks: codeserver.yml + tags: codeserver \ No newline at end of file diff --git a/roles/docker/templates/codeserver-compose.yml.j2 b/roles/docker/templates/codeserver-compose.yml.j2 new file mode 100644 index 0000000..ceb7dd6 --- /dev/null +++ b/roles/docker/templates/codeserver-compose.yml.j2 @@ -0,0 +1,17 @@ +services: + codeserver: + stdin_open: true + tty: true + container_name: codeserver + volumes: + - home:/home + environment: + - DOCKER_USER=$USER + image: codercom/code-server:latest +volumes: + home: + driver: local +networks: + default: + external: true + name: lava \ No newline at end of file