diff --git a/ansible/main.yml b/ansible/main.yml index 6a7035b..ac3f7c2 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -66,7 +66,6 @@ - hosts: pve-docker roles: - pve_docker - - yourls - privatebin - vaultwarden - tandoor @@ -111,6 +110,7 @@ - website - slides - comentario + - macau - hosts: jellyfin roles: diff --git a/ansible/roles/macau/files/docker-compose.yml b/ansible/roles/macau/files/docker-compose.yml new file mode 100644 index 0000000..8aa2de5 --- /dev/null +++ b/ansible/roles/macau/files/docker-compose.yml @@ -0,0 +1,29 @@ +services: + macau: + image: ghcr.io/realorangeone/macau:latest + restart: unless-stopped + environment: + - TZ=Europe/London + - SECRET_KEY="{{ vault_secret_key }}" + - DATABASE_URL=postgres://macau:macau@db/macau + networks: + - default + - traefik + depends_on: + - db + labels: + - traefik.enable=true + - traefik.http.routers.macau.rule=Host(`0rng.one`) + + db: + image: pgautoupgrade/pgautoupgrade:17-alpine + restart: unless-stopped + volumes: + - ./postgres:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=macau + - POSTGRES_USER=macau + +networks: + traefik: + external: true diff --git a/ansible/roles/yourls/handlers/main.yml b/ansible/roles/macau/handlers/main.yml similarity index 51% rename from ansible/roles/yourls/handlers/main.yml rename to ansible/roles/macau/handlers/main.yml index 37cbdfb..0da79c6 100644 --- a/ansible/roles/yourls/handlers/main.yml +++ b/ansible/roles/macau/handlers/main.yml @@ -1,4 +1,4 @@ -- name: restart yourls +- name: restart macau shell: - chdir: /opt/yourls + chdir: /opt/macau cmd: "{{ docker_update_command }}" diff --git a/ansible/roles/yourls/tasks/main.yml b/ansible/roles/macau/tasks/main.yml similarity index 54% rename from ansible/roles/yourls/tasks/main.yml rename to ansible/roles/macau/tasks/main.yml index b48ed29..99d9122 100644 --- a/ansible/roles/yourls/tasks/main.yml +++ b/ansible/roles/macau/tasks/main.yml @@ -1,6 +1,9 @@ +- name: Include vault + include_vars: vault.yml + - name: Create install directory file: - path: /opt/yourls + path: /opt/macau state: directory owner: "{{ docker_user.name }}" mode: "{{ docker_compose_directory_mask }}" @@ -8,16 +11,8 @@ - name: Install compose file template: src: files/docker-compose.yml - dest: /opt/yourls/docker-compose.yml + dest: /opt/macau/docker-compose.yml mode: "{{ docker_compose_file_mask }}" owner: "{{ docker_user.name }}" validate: docker-compose -f %s config - notify: restart yourls - -- name: Install redirect file - template: - src: files/index.html - dest: /opt/yourls/index.html - mode: "{{ docker_compose_file_mask }}" - owner: "{{ docker_user.name }}" - notify: restart yourls + notify: restart macau diff --git a/ansible/roles/macau/vars/vault.yml b/ansible/roles/macau/vars/vault.yml new file mode 100644 index 0000000..c8fd7a6 --- /dev/null +++ b/ansible/roles/macau/vars/vault.yml @@ -0,0 +1,10 @@ +$ANSIBLE_VAULT;1.1;AES256 +39336366303934636462306533326665396364393638316261356262343835356533653162313265 +6561623261646237386361363939623132653739656435610a656631363761633565383538636564 +35383433373038616530353335383434343161303331623265333939363162636634326134623234 +3638303138343939620a656138323638303665396662363436323631616661373566633832646335 +39343761653536343466393863613764313930663362303934353962633961616231653830343434 +64356465346138393634303865336639336632616330636333363063636464653661623963373965 +35613234373935363632663932333563653233623937353062316361326166643061666165663630 +36363839636635363632643966656632353638376465326332613435343735316466356439313262 +3166 diff --git a/ansible/roles/yourls/files/docker-compose.yml b/ansible/roles/yourls/files/docker-compose.yml deleted file mode 100644 index c44a868..0000000 --- a/ansible/roles/yourls/files/docker-compose.yml +++ /dev/null @@ -1,36 +0,0 @@ -services: - yourls: - image: yourls:apache - restart: unless-stopped - depends_on: - - mariadb - environment: - - YOURLS_DB_PASS=yourls - - YOURLS_DB_USER=yourls - - YOURLS_DB_HOST=mariadb - - YOURLS_USER=jake - - YOURLS_PASS={{ yourls_password }} - - YOURLS_SITE=https://0rng.one - volumes: - - ./index.html:/var/www/html/index.html:ro - labels: - - traefik.enable=true - - traefik.http.routers.yourls.rule=Host(`0rng.one`) - networks: - - default - - traefik - - mariadb: - image: mariadb:10.11 - environment: - - MYSQL_ROOT_PASSWORD=root - - MYSQL_DATABASE=yourls - - MYSQL_USER=yourls - - MYSQL_PASSWORD=yourls - volumes: - - /mnt/speed/dbs/mariadb/yourls:/var/lib/mysql - restart: unless-stopped - -networks: - traefik: - external: true diff --git a/ansible/roles/yourls/files/index.html b/ansible/roles/yourls/files/index.html deleted file mode 100644 index 7f1407d..0000000 --- a/ansible/roles/yourls/files/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -
- - - - -