Compare commits
2 commits
6d60f03461
...
5c1a8a879c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5c1a8a879c | ||
![]() |
7bca0113de |
8 changed files with 59 additions and 0 deletions
5
ansible/roles/deploy_container_chartdb/defaults/main.yml
Normal file
5
ansible/roles/deploy_container_chartdb/defaults/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
###########
|
||||||
|
# ChartDB #
|
||||||
|
###########
|
||||||
|
container_chartdb_version: latest
|
||||||
|
container_chartdb_domain: chartdb.example.com
|
0
ansible/roles/deploy_container_chartdb/files/.gitkeep
Normal file
0
ansible/roles/deploy_container_chartdb/files/.gitkeep
Normal file
0
ansible/roles/deploy_container_chartdb/handlers/main.yml
Normal file
0
ansible/roles/deploy_container_chartdb/handlers/main.yml
Normal file
0
ansible/roles/deploy_container_chartdb/meta/main.yml
Normal file
0
ansible/roles/deploy_container_chartdb/meta/main.yml
Normal file
27
ansible/roles/deploy_container_chartdb/tasks/main.yml
Normal file
27
ansible/roles/deploy_container_chartdb/tasks/main.yml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
---
|
||||||
|
- name: Ensure data directories exist
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ container_base_dir }}/"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Deploy Docker Compose and .env files
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: '{{ item.src }}'
|
||||||
|
dest: '{{ item.dest }}'
|
||||||
|
mode: '0775'
|
||||||
|
loop:
|
||||||
|
- {src: '.env.j2', dest: '{{ container_base_dir }}/.env'}
|
||||||
|
- {src: 'docker-compose.yml.j2', dest: '{{ container_base_dir }}/docker-compose.yml'}
|
||||||
|
|
||||||
|
- name: Stop Container
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ container_base_dir }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Start Container
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ container_base_dir }}"
|
||||||
|
state: present
|
||||||
|
pull: always
|
||||||
|
recreate: always
|
2
ansible/roles/deploy_container_chartdb/templates/.env.j2
Normal file
2
ansible/roles/deploy_container_chartdb/templates/.env.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
CHARTDB_VERSION={{ container_chartdb_version }}
|
||||||
|
CHARTDB_DOMAIN={{ container_chartdb_domain }}
|
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
services:
|
||||||
|
chartdb:
|
||||||
|
image: ghcr.io/chartdb/chartdb:${CHARTDB_VERSION:-latest}
|
||||||
|
container_name: chartdb
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=traefik"
|
||||||
|
- "traefik.http.routers.chartdb.entrypoints=http"
|
||||||
|
- "traefik.http.routers.chartdb.rule=Host(`${CHARTDB_DOMAIN}`)"
|
||||||
|
- "traefik.http.middlewares.chartdb-https-redirect.redirectscheme.scheme=https"
|
||||||
|
- "traefik.http.routers.chartdb.middlewares=chartdb-https-redirect"
|
||||||
|
- "traefik.http.routers.chartdb-secure.entrypoints=https"
|
||||||
|
- "traefik.http.routers.chartdb-secure.rule=Host(`${CHARTDB_DOMAIN}`)"
|
||||||
|
- "traefik.http.routers.chartdb-secure.tls=true"
|
||||||
|
- "traefik.http.routers.chartdb-secure.service=chartdb"
|
||||||
|
- "traefik.http.services.chartdb.loadbalancer.server.port=80"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik:
|
||||||
|
external: true
|
1
ansible/roles/deploy_container_chartdb/vars/main.yml
Normal file
1
ansible/roles/deploy_container_chartdb/vars/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
container_base_dir: /opt/docker/chartdb
|
Loading…
Add table
Reference in a new issue