--- - name: VPS 2 setup hosts: vps2 gather_facts: false tasks: - name: Copy backup file ansible.builtin.copy: src: "../vps2/backup.sh" dest: "/apps/backup.sh" mode: "u=rx,g=rx,o=rx" - name: Configure backup cron ansible.builtin.cron: name: Daily backup minute: "5" hour: "7" job: "/apps/backup.sh" ##### # APP: karin bot, /apps/karin-bot ##### - name: Create /apps/karin-bot ansible.builtin.file: path: /apps/karin-bot state: directory mode: "u=rwx,g=rx,o=rx" - name: "Copy karin .env secret" ansible.builtin.copy: dest: "/apps/karin-bot/.env" src: "../secrets/karin-bot/.env" mode: "u=r,g=r,o=r" # TODO: Mount a volume in the karin-db to this directory ##### # APP: cors-school, /apps/cors-school ##### - name: Create /apps/cors-school ansible.builtin.file: path: /apps/cors-school state: directory mode: "u=rwx,g=rx,o=rx" - name: Copy secret envs ansible.builtin.copy: dest: "/apps/cors-school/{{ item }}" src: "../secrets/cors-school/{{ item }}" mode: "u=r,g=r,o=r" with_items: - bot.env - db.env - server.env ##### # APP: minecraft server, /apps/minecraft ##### - name: Create /apps/minecraft ansible.builtin.file: path: /apps/minecraft state: directory mode: "u=rwx,g=rx,o=rx" - name: Copy minecraft secrets ansible.builtin.copy: dest: "/apps/minecraft/.env" src: "../secrets/minecraft/.env" mode: "u=r,g=r,o=r" ##### # APP: openolat, /apps/openolat ##### - name: Create /apps/openolat ansible.builtin.file: path: /apps/openolat state: directory mode: "u=rwx,g=rx,o=rx" - name: Copy extra properties ansible.builtin.copy: dest: /apps/openolat/extra-properties.properties src: ../apps/openolat/extra-properties.properties mode: "u=r,g=r,o=r" - name: Olat data file permissions # TODO: a bit hacky. ansible.builtin.file: path: /apps/openolat/olatdata state: directory mode: "u=rwx,g=rwx,o=rwx" ##### # END: docker compose up! ##### # We want this to be last so that all app-specific config has been done. - name: Copy .env ansible.builtin.copy: dest: "/apps/.env" src: "../secrets/vps2.env" mode: "u=r,g=r,o=r" - name: Docker compose up! 🚀 community.docker.docker_compose_v2: project_src: /apps state: "present" ##### # POST: things after starting up ##### - name: Run CORS db migrations ansible.builtin.shell: | docker exec -w /app/server cors-school-server diesel migration run