testing
This commit is contained in:
parent
f68f57d0cf
commit
4b90ca5262
@ -10,3 +10,4 @@
|
|||||||
- docker
|
- docker
|
||||||
- gitea
|
- gitea
|
||||||
- bitwarden
|
- bitwarden
|
||||||
|
- kutt
|
||||||
|
3
roles/.gitignore
vendored
3
roles/.gitignore
vendored
@ -1,11 +1,14 @@
|
|||||||
|
# Sort roles: tail -n +6 roles/.gitignore | sort
|
||||||
/*
|
/*
|
||||||
!.gitignore
|
!.gitignore
|
||||||
!requirements.yml
|
!requirements.yml
|
||||||
|
# roles
|
||||||
!base*/
|
!base*/
|
||||||
!bitwarden*/
|
!bitwarden*/
|
||||||
!docker*/
|
!docker*/
|
||||||
!gitea*/
|
!gitea*/
|
||||||
!jenkins*/
|
!jenkins*/
|
||||||
|
!kutt*/
|
||||||
!libvirt*/
|
!libvirt*/
|
||||||
!mariadb*/
|
!mariadb*/
|
||||||
!minecraft*/
|
!minecraft*/
|
||||||
|
15
roles/kutt/defaults/main.yml
Normal file
15
roles/kutt/defaults/main.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# container settings
|
||||||
|
kutt_name: kutt
|
||||||
|
kutt_webport: 3030
|
||||||
|
kutt_web: "127.0.0.1:{{ kutt_webport }}"
|
||||||
|
|
||||||
|
# database settings
|
||||||
|
kutt_dbname: "{{ kutt_name }}"
|
||||||
|
kutt_dbuser: "{{ kutt_name }}"
|
||||||
|
kutt_postgres_volume: postgres_data
|
||||||
|
|
||||||
|
# redis
|
||||||
|
kutt_redis_volume: redis_data
|
||||||
|
|
||||||
|
# host
|
||||||
|
kutt_root: "{{ docker_compose_root }}/{{ kutt_name }}"
|
22
roles/kutt/tasks/main.yml
Normal file
22
roles/kutt/tasks/main.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
- name: Create Kutt directory
|
||||||
|
file:
|
||||||
|
path: "{{ kutt_root }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Install Kutt's docker-compose file
|
||||||
|
template:
|
||||||
|
src: docker-compose.yml.j2
|
||||||
|
dest: "{{ kutt_root }}/docker-compose.yml"
|
||||||
|
notify: restart_kutt
|
||||||
|
|
||||||
|
- name: Install Kutt's docker-compose variables
|
||||||
|
template:
|
||||||
|
src: compose-env.j2
|
||||||
|
dest: "{{ kutt_root }}/.env"
|
||||||
|
notify: restart_kutt
|
||||||
|
|
||||||
|
- name: Start and enable Gitea service
|
||||||
|
service:
|
||||||
|
name: "{{ docker_compose_service }}@{{ kutt_name }}"
|
||||||
|
state: started
|
||||||
|
enabled: true
|
11
roles/kutt/templates/compose-env.j2
Normal file
11
roles/kutt/templates/compose-env.j2
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
|
kutt_version={{ kutt_version }}
|
||||||
|
kutt_name={{ kutt_name }}
|
||||||
|
kutt_web={{ kutt_web }}
|
||||||
|
kutt_dbname={{ kutt_dbname }}
|
||||||
|
kutt_dbuser={{ kutt_dbuser }}
|
||||||
|
kutt_dbpass={{ kutt_dbpass }}
|
||||||
|
kutt_redis_version={{ kutt_redis_version }}
|
||||||
|
kutt_postgres_version={{ kutt_postgres_version }}
|
||||||
|
kutt_postgres_volume={{ kutt_postgres_volume }}
|
36
roles/kutt/templates/docker-compose.yml.j2
Normal file
36
roles/kutt/templates/docker-compose.yml.j2
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
version: "3.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
kutt:
|
||||||
|
image: kutt/kutt:${kutt_version}
|
||||||
|
container_name: ${kutt_name}
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
command: ["./wait-for-it.sh", "postgres:5432", "--", "npm", "start"]
|
||||||
|
ports:
|
||||||
|
- ${kutt_web}:3000
|
||||||
|
environment:
|
||||||
|
DB_HOST: postgres
|
||||||
|
DB_NAME: ${kutt_dbname}
|
||||||
|
DB_USER: ${kutt_dbuser}
|
||||||
|
DB_PASSWORD: ${kutt_dbpass}
|
||||||
|
REDIS_HOST: redis
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:${kutt_redis_version}
|
||||||
|
volumes:
|
||||||
|
- {{ kutt_redis_volume }}:/data
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:${kutt_postgres_version}
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: ${kutt_dbuser}
|
||||||
|
POSTGRES_PASSWORD: ${kutt_dbpass}
|
||||||
|
POSTGRES_DB: ${kutt_dbname}
|
||||||
|
volumes:
|
||||||
|
- {{ kutt_postgres_volume }}:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
{{ kutt_redis_volume }}:
|
||||||
|
{{ kutt_postgres_volume }}:
|
Loading…
Reference in New Issue
Block a user