pgadmin with an external volume.
This commit is contained in:
parent
e3b303ad2d
commit
431d0be42b
|
@ -23,10 +23,10 @@ open_asfa_db_volume: 'asfa_pg_data'
|
||||||
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.asfa_pg_data==asfa_server]'
|
open_asfa_db_constraints: '[node.labels.asfa_pg_data==asfa_server]'
|
||||||
open_asfa_pgadmin_image: 'dpage/pgadmin4'
|
open_asfa_pgadmin_image: 'dpage/pgadmin4:6'
|
||||||
open_asfa_pgadmin_data_vol: 'asfa_test_pgadmin_data'
|
open_asfa_pgadmin_data_vol: 'open_asfa_test_pgadmin_data'
|
||||||
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.asfa_pgadmin_data==asfa_server]'
|
open_asfa_pgadmin_constraints: '[node.role == worker]'
|
||||||
open_asfa_pgadmin_email: 'noreply@example.com'
|
open_asfa_pgadmin_email: 'noreply@example.com'
|
||||||
#open_asfa_pgadmin_default_pwd: 'Use a vault'
|
#open_asfa_pgadmin_default_pwd: 'Use a vault'
|
||||||
open_asfa_pgadmin_inactivity_timeout: '1200'
|
open_asfa_pgadmin_inactivity_timeout: '1200'
|
||||||
|
|
|
@ -75,6 +75,31 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0400
|
mode: 0400
|
||||||
|
|
||||||
|
- name: Install the pgadmin configuration files
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: '{{ open_asfa_pgadmin_config_item }}.j2'
|
||||||
|
dest: '{{ open_asfa_compose_dir }}/{{ open_asfa_pgadmin_config_item }}'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0444
|
||||||
|
loop:
|
||||||
|
- pgadmin_config_local.py
|
||||||
|
- pgadmin_servers.json
|
||||||
|
loop_control:
|
||||||
|
loop_var: open_asfa_pgadmin_config_item
|
||||||
|
|
||||||
|
- name: Create the secret for the pgadmin config local
|
||||||
|
community.docker.docker_secret:
|
||||||
|
name: open_asfa_pgadmin_config
|
||||||
|
data_src: '{{ open_asfa_compose_dir }}/pgadmin_config_local.py'
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Create the secret for the pgadmin config servers
|
||||||
|
community.docker.docker_secret:
|
||||||
|
name: open_asfa_pgadmin_servers
|
||||||
|
data_src: '{{ open_asfa_compose_dir }}/pgadmin_servers.json'
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Start the OpenAsfa stack
|
- name: Start the OpenAsfa stack
|
||||||
community.docker.docker_stack:
|
community.docker.docker_stack:
|
||||||
name: open-asfa
|
name: open-asfa
|
||||||
|
|
|
@ -12,6 +12,18 @@ volumes:
|
||||||
{{ open_asfa_db_volume }}:
|
{{ open_asfa_db_volume }}:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ open_asfa_pgadmin_data_vol }}:
|
{{ open_asfa_pgadmin_data_vol }}:
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: nfs4
|
||||||
|
# o: "nfsvers=4,addr=146.48.123.250,rw,nolock,soft"
|
||||||
|
o: "nfsvers=4,addr=146.48.123.250,rw"
|
||||||
|
device: ":/nfs/open_asfa_pgadmin_data"
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
pgadmin_config:
|
||||||
|
external: true
|
||||||
|
pgadmin_servers:
|
||||||
|
external: true
|
||||||
|
|
||||||
services:
|
services:
|
||||||
{% if open_asfa_db_as_container %}
|
{% if open_asfa_db_as_container %}
|
||||||
|
@ -58,6 +70,13 @@ services:
|
||||||
PGADMIN_LISTEN_ADDRESS: 0.0.0.0
|
PGADMIN_LISTEN_ADDRESS: 0.0.0.0
|
||||||
PGADMIN_LISTEN_PORT: 5050
|
PGADMIN_LISTEN_PORT: 5050
|
||||||
GUNICORN_THREADS: 20
|
GUNICORN_THREADS: 20
|
||||||
|
secrets:
|
||||||
|
- source: open_asfa_pgadmin_config
|
||||||
|
target: /pgadmin4/config_local.py
|
||||||
|
mode: 0444
|
||||||
|
- source: open_asfa_pgadmin_servers
|
||||||
|
target: /pgadmin4/servers.json
|
||||||
|
mode: 0444
|
||||||
deploy:
|
deploy:
|
||||||
placement:
|
placement:
|
||||||
constraints: {{ open_asfa_pgadmin_constraints }}
|
constraints: {{ open_asfa_pgadmin_constraints }}
|
||||||
|
|
Loading…
Reference in New Issue