This commit is contained in:
Gabriel Augendre 2024-10-11 17:44:41 +02:00
parent 3bcb33d76c
commit 9bc26be65d
4 changed files with 72 additions and 0 deletions

View file

@ -2,6 +2,8 @@
- import_playbook: bin.yaml # noqa: name[play] - import_playbook: bin.yaml # noqa: name[play]
- import_playbook: caddy.yaml # noqa: name[play] - import_playbook: caddy.yaml # noqa: name[play]
- import_playbook: charasheet.yaml # noqa: name[play] - import_playbook: charasheet.yaml # noqa: name[play]
- import_playbook: checkout.yaml # noqa: name[play]
- import_playbook: code.yaml # noqa: name[play]
- import_playbook: ghost-update.yaml # noqa: name[play] - import_playbook: ghost-update.yaml # noqa: name[play]
- import_playbook: gitea.yaml # noqa: name[play] - import_playbook: gitea.yaml # noqa: name[play]
- import_playbook: goatcounter.yaml # noqa: name[play] - import_playbook: goatcounter.yaml # noqa: name[play]

52
playbooks/apps/code.yaml Normal file
View file

@ -0,0 +1,52 @@
---
- name: Visual Studio Code
hosts: servers
gather_facts: false
tasks:
- name: Create dir
ansible.builtin.file:
path: "{{ dir }}"
state: directory
mode: "0775"
- name: Write files
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ dir }}/"
mode: preserve
with_fileglob:
- files/{{ app_name }}/*
- files/{{ app_name }}/.*
notify:
- Restart service
- name: Write templates
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ dir }}/{{ item | basename | regex_replace('\\.j2$', '') }}"
mode: preserve
with_fileglob:
- templates/{{ app_name }}/*.j2
- templates/{{ app_name }}/.*.j2
notify:
- Restart service
- name: Ensure service is started
community.docker.docker_compose_v2:
project_src: "{{ dir }}"
state: present
handlers:
- name: Restart service
community.docker.docker_compose_v2:
project_src: "{{ dir }}"
state: restarted
vars:
app_name: code
dir: /mnt/data/{{ app_name }}
password: !vault |
$ANSIBLE_VAULT;1.1;AES256
65333933333436616332666161653932633431333334636364346239346530336337303939643435
3935336230623135343638646130313936363034396665650a653066313862326632333130656164
38346631366162393833333361633663636362653530666466376162643534303866363261373033
6339303930656638660a626635313736663065373535613132326531343737396662626434373039
38646136383662346264613534373663326136393361323933383062346336346264643731303333
6132373439346165313066353334353532393262346435306134

View file

@ -0,0 +1,11 @@
services:
code:
image: ghcr.io/linuxserver/code-server
env_file: code.env
restart: always
volumes:
- ./code_data:/config
mem_limit: 3g
cpus: 3
ports:
- "9002:8443"

View file

@ -0,0 +1,7 @@
PUID=1000
PGID=1000
TZ=Europe/Paris
PASSWORD={{ password }}
SUDO_PASSWORD={{ password }}
PROXY_DOMAIN=code.augendre.info
DOCKER_MODS=linuxserver/mods:code-server-python3|linuxserver/mods:code-server-golang