put env vars in docker_stack compose
This commit is contained in:
parent
bf53429e0f
commit
144a460ed5
@ -3,6 +3,13 @@
|
||||
ansible.builtin.set_fact:
|
||||
our_vfs_mount_tag: "{{ lookup('dotenv', 'VULTR_VFS_MOUNT_TAG', file='../../../../.env.production') }}"
|
||||
|
||||
- name: Check if /mnt/vfs is already mounted
|
||||
ansible.builtin.command: findmnt -n /mnt/vfs
|
||||
register: our_vfs_mounted
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
|
||||
# there's a bug. we dont want to run this unless needed. https://gitlab.com/virtio-fs/virtiofsd/-/issues/213
|
||||
- name: Mount VFS
|
||||
ansible.posix.mount:
|
||||
src: "{{ our_vfs_mount_tag }}"
|
||||
@ -10,3 +17,4 @@
|
||||
fstype: virtiofs
|
||||
opts: defaults,_netdev
|
||||
state: mounted
|
||||
when: our_vfs_mounted.rc != 0
|
||||
|
4
ansible/roles/our/tasks/router.yml
Normal file
4
ansible/roles/our/tasks/router.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
# router.yml
|
||||
# here we make changes to the load balancer app routing
|
||||
|
@ -5,11 +5,11 @@
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Copy env file
|
||||
ansible.builtin.copy:
|
||||
src: ../../../../.env.production
|
||||
dest: /etc/futureporn/our/.env
|
||||
mode: "0600"
|
||||
# - name: Copy env file
|
||||
# ansible.builtin.copy:
|
||||
# src: ../../../../.env.production
|
||||
# dest: /etc/futureporn/our/.env
|
||||
# mode: "0600"
|
||||
|
||||
- name: Clone the latest code
|
||||
ansible.builtin.git:
|
||||
@ -46,6 +46,13 @@
|
||||
compose:
|
||||
- /etc/futureporn/our/compose.production.yaml
|
||||
- /etc/futureporn/our/compose.green.yaml
|
||||
- services:
|
||||
worker:
|
||||
environment:
|
||||
DATABASE_URL: "{{ lookup('dotenv', 'DATABASE_URL', file='../../../../.env.production') }}"
|
||||
server:
|
||||
environment:
|
||||
DATABASE_URL: "{{ lookup('dotenv', 'DATABASE_URL', file='../../../../.env.production') }}"
|
||||
|
||||
- name: Deploy stack to blue
|
||||
community.docker.docker_stack:
|
||||
|
@ -1,7 +1,6 @@
|
||||
services:
|
||||
server:
|
||||
image: gitea.futureporn.net/futureporn/our:latest
|
||||
env_file: ./.env
|
||||
depends_on:
|
||||
- postgres
|
||||
init: true
|
||||
@ -13,7 +12,6 @@ services:
|
||||
|
||||
worker:
|
||||
image: gitea.futureporn.net/futureporn/our:latest
|
||||
env_file: ./.env
|
||||
depends_on:
|
||||
- postgres
|
||||
init: true
|
||||
@ -38,7 +36,6 @@ services:
|
||||
|
||||
qbittorrent:
|
||||
image: gitea.futureporn.net/futureporn/qbittorrent-nox:latest
|
||||
env_file: ./.env
|
||||
init: false
|
||||
volumes:
|
||||
- /mnt/vfs/futureporn:/mnt/vfs/futureporn
|
||||
|
Loading…
x
Reference in New Issue
Block a user