put env vars in docker_stack compose
This commit is contained in:
parent
bf53429e0f
commit
144a460ed5
@ -3,6 +3,13 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
our_vfs_mount_tag: "{{ lookup('dotenv', 'VULTR_VFS_MOUNT_TAG', file='../../../../.env.production') }}"
|
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
|
- name: Mount VFS
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
src: "{{ our_vfs_mount_tag }}"
|
src: "{{ our_vfs_mount_tag }}"
|
||||||
@ -10,3 +17,4 @@
|
|||||||
fstype: virtiofs
|
fstype: virtiofs
|
||||||
opts: defaults,_netdev
|
opts: defaults,_netdev
|
||||||
state: mounted
|
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
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Copy env file
|
# - name: Copy env file
|
||||||
ansible.builtin.copy:
|
# ansible.builtin.copy:
|
||||||
src: ../../../../.env.production
|
# src: ../../../../.env.production
|
||||||
dest: /etc/futureporn/our/.env
|
# dest: /etc/futureporn/our/.env
|
||||||
mode: "0600"
|
# mode: "0600"
|
||||||
|
|
||||||
- name: Clone the latest code
|
- name: Clone the latest code
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
@ -46,6 +46,13 @@
|
|||||||
compose:
|
compose:
|
||||||
- /etc/futureporn/our/compose.production.yaml
|
- /etc/futureporn/our/compose.production.yaml
|
||||||
- /etc/futureporn/our/compose.green.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
|
- name: Deploy stack to blue
|
||||||
community.docker.docker_stack:
|
community.docker.docker_stack:
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea.futureporn.net/futureporn/our:latest
|
image: gitea.futureporn.net/futureporn/our:latest
|
||||||
env_file: ./.env
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
init: true
|
init: true
|
||||||
@ -13,7 +12,6 @@ services:
|
|||||||
|
|
||||||
worker:
|
worker:
|
||||||
image: gitea.futureporn.net/futureporn/our:latest
|
image: gitea.futureporn.net/futureporn/our:latest
|
||||||
env_file: ./.env
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
init: true
|
init: true
|
||||||
@ -38,7 +36,6 @@ services:
|
|||||||
|
|
||||||
qbittorrent:
|
qbittorrent:
|
||||||
image: gitea.futureporn.net/futureporn/qbittorrent-nox:latest
|
image: gitea.futureporn.net/futureporn/qbittorrent-nox:latest
|
||||||
env_file: ./.env
|
|
||||||
init: false
|
init: false
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/vfs/futureporn:/mnt/vfs/futureporn
|
- /mnt/vfs/futureporn:/mnt/vfs/futureporn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user