This commit is contained in:
Kris Lamoureux 2022-10-23 03:46:27 -04:00
parent f68f57d0cf
commit 3223c88773
9 changed files with 126 additions and 0 deletions

View File

@ -18,6 +18,8 @@ proxy:
proxy_pass: "http://127.0.0.1:8080" proxy_pass: "http://127.0.0.1:8080"
- domain: "{{ gitea_domain }}" - domain: "{{ gitea_domain }}"
proxy_pass: "http://127.0.0.1:3000" proxy_pass: "http://127.0.0.1:3000"
- domain: "{{ kutt_domain }}"
proxy_pass: "http://127.0.0.1:3030"
# docker # docker
docker_users: docker_users:
@ -35,3 +37,16 @@ bitwarden_install_key: 1yB3Z2gRI0KnnH90C6p
gitea_domain: "git.{{ base_domain }}" gitea_domain: "git.{{ base_domain }}"
gitea_version: 1 gitea_version: 1
gitea_dbpass: password gitea_dbpass: password
# kutt
kutt_version: latest
kutt_redis_version: 6
kutt_postgres_version: 12
kutt_domain: "kutt.{{ base_domain }}"
kutt_dbpass: password
kutt_jwt_secret: long&random
kutt_mail_user: kutt-noreply@example.com
kutt_mail_host: smtp.example.com
kutt_mail_password: realpassword
kutt_report_email: realemail@example.com
kutt_admin_emails: realemail@example.com

View File

@ -10,3 +10,4 @@
- docker - docker
- gitea - gitea
- bitwarden - bitwarden
- kutt

3
roles/.gitignore vendored
View File

@ -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*/

View File

@ -0,0 +1,16 @@
# container settings
kutt_name: kutt
kutt_default_domain: "{{ kutt_domain }}"
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 }}"

View File

@ -0,0 +1,5 @@
- name: Restart Kutt
service:
name: "{{ docker_compose_service }}@{{ kutt_name }}"
state: restarted
listen: restart_kutt

22
roles/kutt/tasks/main.yml Normal file
View 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

View File

@ -0,0 +1,17 @@
# {{ ansible_managed }}
kutt_version={{ kutt_version }}
kutt_web={{ kutt_web }}
kutt_domain={{ kutt_domain }}
kutt_default_domain={{ kutt_default_domain }}
kutt_jwt_secret={{ kutt_jwt_secret }}
kutt_dbname={{ kutt_dbname }}
kutt_dbuser={{ kutt_dbuser }}
kutt_dbpass={{ kutt_dbpass }}
kutt_mail_user={{ kutt_mail_user }}
kutt_mail_host={{ kutt_mail_host }}
kutt_mail_password={{ kutt_mail_password }}
kutt_report_email={{ kutt_report_email }}
kutt_admin_emails={{ kutt_admin_emails }}
kutt_redis_version={{ kutt_redis_version }}
kutt_postgres_version={{ kutt_postgres_version }}
kutt_postgres_volume={{ kutt_postgres_volume }}

View File

@ -0,0 +1,46 @@
version: "3.7"
services:
kutt:
image: kutt/kutt:${kutt_version}
depends_on:
- postgres
- redis
command: ["./wait-for-it.sh", "postgres:5432", "--", "npm", "start"]
ports:
- ${kutt_web}:3000
environment:
SITE_NAME: ${kutt_domain}
DEFAULT_DOMAIN: ${kutt_default_domain}
JWT_SECRET: ${kutt_jwt_secret}
DB_HOST: postgres
DB_NAME: ${kutt_dbname}
DB_USER: ${kutt_dbuser}
DB_PASSWORD: ${kutt_dbpass}
REDIS_HOST: redis
MAIL_USER: ${kutt_mail_user}
MAIL_HOST: ${kutt_mail_host}
MAIL_PORT: ${kutt_mail_port}
MAIL_PASSWORD: ${kutt_mail_password}
REPORT_EMAIL: ${kutt_report_email}
ADMIN_EMAILS: ${kutt_admin_emails}
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 }}:

View File

@ -14,6 +14,7 @@ HOST[8]="wordpress.${DOMAIN}"
HOST[9]="site1.wordpress.${DOMAIN}" HOST[9]="site1.wordpress.${DOMAIN}"
HOST[10]="site2.wordpress.${DOMAIN}" HOST[10]="site2.wordpress.${DOMAIN}"
HOST[11]="unifi.${DOMAIN}" HOST[11]="unifi.${DOMAIN}"
HOST[11]="kutt.${DOMAIN}"
# Get Vagrantbox guest IP # Get Vagrantbox guest IP
VAGRANT_OUTPUT=$(vagrant ssh -c "hostname -I | cut -d' ' -f2" 2>/dev/null) VAGRANT_OUTPUT=$(vagrant ssh -c "hostname -I | cut -d' ' -f2" 2>/dev/null)