Remote volumes for pg and pgadmin
This commit is contained in:
parent
81ab45f289
commit
cc4eff77e8
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"ansible.python.interpreterPath": "/opt/local/bin/python3.10"
|
||||||
|
}
|
|
@ -19,11 +19,17 @@ open_asfa_db_port: 5432
|
||||||
open_asfa_db_name: 'asfadb'
|
open_asfa_db_name: 'asfadb'
|
||||||
open_asfa_db_user: 'asfadb_user'
|
open_asfa_db_user: 'asfadb_user'
|
||||||
open_asfa_db_volume: 'asfa_pg_data'
|
open_asfa_db_volume: 'asfa_pg_data'
|
||||||
|
open_asfa_pg_volume_type: 'local'
|
||||||
|
open_asfa_pg_volume_o: ""
|
||||||
|
open_asfa_pg_volume_device: ""
|
||||||
open_asfa_db_allowed_hosts:
|
open_asfa_db_allowed_hosts:
|
||||||
- '127.0.0.1/8'
|
- '127.0.0.1/8'
|
||||||
open_asfa_db_constraints: '[node.labels.pg_data_asfa_test==asfa_server_test]'
|
open_asfa_db_constraints: '[node.labels.pg_data_asfa_test==asfa_server_test]'
|
||||||
open_asfa_pgadmin_image: 'dpage/pgadmin4'
|
open_asfa_pgadmin_image: 'dpage/pgadmin4'
|
||||||
open_asfa_pgadmin_data_vol: 'asfa_test_pgadmin_data'
|
open_asfa_pgadmin_data_vol: 'asfa_test_pgadmin_data'
|
||||||
|
open_asfa_pgadmin_volume_type: 'local'
|
||||||
|
open_asfa_pgadmin_volume_o: ""
|
||||||
|
open_asfa_pgadmin_volume_device: ""
|
||||||
open_asfa_pgadmin_docker_host: '{{ open_asfa_db_docker_host }}'
|
open_asfa_pgadmin_docker_host: '{{ open_asfa_db_docker_host }}'
|
||||||
open_asfa_pgadmin_constraints: '[node.labels.pgadmin_data_asfa_test==asfa_server_test]'
|
open_asfa_pgadmin_constraints: '[node.labels.pgadmin_data_asfa_test==asfa_server_test]'
|
||||||
open_asfa_pgadmin_email: 'noreply@example.com'
|
open_asfa_pgadmin_email: 'noreply@example.com'
|
||||||
|
|
|
@ -8,8 +8,25 @@ networks:
|
||||||
{{ open_asfa_docker_network }}:
|
{{ open_asfa_docker_network }}:
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
{{ open_asfa_db_volume }}:
|
|
||||||
{{ open_asfa_pgadmin_data_vol }}:
|
{{ open_asfa_pgadmin_data_vol }}:
|
||||||
|
{% if open_asfa_pgadmin_volume_type == "nfs4" %}
|
||||||
|
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: {{ open_asfa_pgadmin_volume_type }}
|
||||||
|
o: "{{ open_asfa_pgadmin_volume_o }}"
|
||||||
|
device: "{{ open_asfa_pgadmin_volume_device }}"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{{ open_asfa_db_volume }}:
|
||||||
|
{% if open_asfa_pg_volume_type == "nfs4" %}
|
||||||
|
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: {{ open_asfa_pg_volume_type }}
|
||||||
|
o: "{{ open_asfa_pg_volume_o }}"
|
||||||
|
device: "{{ open_asfa_pg_volume_device }}"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
services:
|
services:
|
||||||
pg:
|
pg:
|
||||||
|
@ -27,7 +44,11 @@ services:
|
||||||
PGDATA: /var/lib/postgresql/data/pg_data
|
PGDATA: /var/lib/postgresql/data/pg_data
|
||||||
deploy:
|
deploy:
|
||||||
placement:
|
placement:
|
||||||
|
{% if open_asfa_pg_volume_type == "nfs4" %}
|
||||||
|
constraints: [node.role == worker]
|
||||||
|
{% else %}
|
||||||
constraints: {{ open_asfa_db_constraints }}
|
constraints: {{ open_asfa_db_constraints }}
|
||||||
|
{% endif %}
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
delay: 5s
|
delay: 5s
|
||||||
|
@ -56,7 +77,11 @@ services:
|
||||||
GUNICORN_THREADS: 20
|
GUNICORN_THREADS: 20
|
||||||
deploy:
|
deploy:
|
||||||
placement:
|
placement:
|
||||||
|
{% if open_asfa_pgadmin_volume_type == "nfs4" %}
|
||||||
|
constraints: [node.role == worker]
|
||||||
|
{% else %}
|
||||||
constraints: {{ open_asfa_pgadmin_constraints }}
|
constraints: {{ open_asfa_pgadmin_constraints }}
|
||||||
|
{% endif %}
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
delay: 5s
|
delay: 5s
|
||||||
|
|
Loading…
Reference in New Issue