From 029ab55dc29b41ce2b3886e966a3a7832e10bd24 Mon Sep 17 00:00:00 2001 From: Bruno Paz <184563+brpaz@users.noreply.github.com> Date: Sun, 27 Aug 2023 10:10:46 +0100 Subject: [PATCH] updates --- .vscode/settings.json | 9 ++++ provision/tasks/docker-apps/_main.yml | 6 +++ provision/tasks/docker-apps/cadvisor.yml | 11 +---- provision/tasks/docker-apps/flame.yml | 23 ++++++++++ provision/tasks/docker-apps/sourcegraph.yml | 50 +++++++++++++++++++++ 5 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 provision/tasks/docker-apps/flame.yml create mode 100644 provision/tasks/docker-apps/sourcegraph.yml diff --git a/.vscode/settings.json b/.vscode/settings.json index 82c7120..de61a2a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,14 @@ "**/.hg/store/**": true, ".flatpak/**": true, "_build/**": true + }, + "yaml.schemas": { + "/home/bruno/Code/Personal/other/schemastore/src/schemas/json/hadolint.json": ".hadolint.yaml", + "kubernetes": "k8s/*.yaml", + "/home/bruno/Code/Personal/other/schemastore/src/schemas/json/container-structure-test.json": "structure-tests.yaml", + "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json#/$defs/tasks": [ + "file:///home/bruno/Code/Personal/other/my-linux-setup/provision/tasks/docker-apps/traefik.yml", + "file:///home/bruno/Code/Personal/other/my-linux-setup/provision/tasks/docker-apps/prometheus.yml" + ] } } diff --git a/provision/tasks/docker-apps/_main.yml b/provision/tasks/docker-apps/_main.yml index 2fa4bc7..5eb3bfc 100644 --- a/provision/tasks/docker-apps/_main.yml +++ b/provision/tasks/docker-apps/_main.yml @@ -28,3 +28,9 @@ - import_tasks: 'node-exporter.yml' tags: ['node-exporter', 'docker-monitoring-stack'] + +- import_tasks: 'sourcegraph.yml' + tags: ['sourcegraph'] + +- import_tasks: 'flame.yml' + tags: ['flame'] diff --git a/provision/tasks/docker-apps/cadvisor.yml b/provision/tasks/docker-apps/cadvisor.yml index d2b7745..b9b5c87 100644 --- a/provision/tasks/docker-apps/cadvisor.yml +++ b/provision/tasks/docker-apps/cadvisor.yml @@ -9,16 +9,7 @@ - name: monitoring - name: traefik-public volumes: - - /:/rootfs:ro - - /var/run:/var/run:ro - - /sys:/sys:ro - /var/lib/docker/:/var/lib/docker:ro - - /dev/kmsg:/dev/kmsg labels: - traefik.enable: "true" - traefik.http.routers.cadvisor.rule: "Host(`cadvisor.docker`)" - traefik.http.routers.cadvisor.entrypoints: "web" - traefik.http.services.cadvisor.loadbalancer.server.port: "8080" - traefik.docker.network: traefik-public - + traefik.enable: "false" diff --git a/provision/tasks/docker-apps/flame.yml b/provision/tasks/docker-apps/flame.yml new file mode 100644 index 0000000..a1694a9 --- /dev/null +++ b/provision/tasks/docker-apps/flame.yml @@ -0,0 +1,23 @@ + +- name: Flame | Create volume + community.docker.docker_volume: + name: flame_data + state: present +- name: Flame | Start container + community.docker.docker_container: + name: flame + image: pawelmalak/flame:2.3.1 + restart_policy: "unless-stopped" + networks: + - name: traefik-public + volumes: + - "flame_data:/app/data" + - "/var/run/docker.sock:/var/run/docker.sock" + env: + PASSWORD: "admin" + labels: + traefik.enable: "true" + traefik.http.routers.flame.rule: "Host(`flame.docker`)" + traefik.http.routers.flame.tls: "false" + traefik.http.routers.flame.entrypoints: "web" + traefik.http.services.flame.loadbalancer.server.port: "5005" diff --git a/provision/tasks/docker-apps/sourcegraph.yml b/provision/tasks/docker-apps/sourcegraph.yml new file mode 100644 index 0000000..4245762 --- /dev/null +++ b/provision/tasks/docker-apps/sourcegraph.yml @@ -0,0 +1,50 @@ +- name: Sourcegraph | Ensure Sourcegraph data volume is present + community.docker.docker_volume: + name: sourcegraph_data + state: present + +- name: Sourcegraph | Create configuration directory + ansible.builtin.file: + path: /etc/sourcegraph + state: directory + mode: "0755" + become: true + +- name: Sourcegraph | Create network + community.docker.docker_network: + name: sourcegraph + state: present + +- name: Sourcegraph | Start Server container + community.docker.docker_container: + name: sourcegraph + image: sourcegraph/server:5.1.7 + restart_policy: "unless-stopped" + networks: + - name: sourcegraph + - name: traefik-public + volumes: + - "sourcegraph_data:/var/opt/sourcegraph sourcegraph/" + - "/etc/sourcegraph/:/etc/sourcegraph/" + env: + DISABLE_OBSERVABILITY: "true" + labels: + traefik.enable: "true" + traefik.http.routers.sourcegraph.rule: "Host(`sg.docker`)" + traefik.http.routers.sourcegraph.tls: "false" + traefik.http.routers.sourcegraph.entrypoints: "web" + traefik.http.services.sourcegraph.loadbalancer.server.port: "7080" + +- name: Sourcegraph | Start Serve git + community.docker.docker_container: + name: sourcegraph-serv-git + image: sourcegraph/src-cli:5.1 + command: serve-git /data/repos + restart_policy: "unless-stopped" + networks: + - name: sourcegraph + volumes: + - '~/Code:/data/repos' + labels: + traefik.enable: "true" + traefik.docker.network: traefik-public