Skip to content

Commit

Permalink
Postgres: Fix hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
owine committed Jan 5, 2024
1 parent eea0358 commit d844c1b
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 12 deletions.
2 changes: 1 addition & 1 deletion roles/immich/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ immich_docker_envs_default:
PUID: "{{ uid }}"
PGID: "{{ gid }}"
TZ: "{{ tz }}"
DB_HOSTNAME: "{{ immich_name }}_postgres"
DB_HOSTNAME: "{{ immich_name }}-postgres"
DB_USERNAME: "{{ postgres_docker_env_user }}"
DB_PASSWORD: "{{ postgres_docker_env_password }}"
DB_DATABASE_NAME: "{{ immich_name }}"
Expand Down
7 changes: 6 additions & 1 deletion roles/immich/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@
redis_paths_folder: "{{ immich_name }}"
redis_paths_location: "{{ server_appdata_path }}/{{ redis_paths_folder }}/redis"

- name: Remove legacy PostgreSQL Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/remove_docker_container.yml"
vars:
var_prefix: "{{ immich_name }}_postgres"

- name: Import PostgreSQL Role
ansible.builtin.include_role:
name: postgres
vars:
postgres_instances: ["{{ immich_name }}_postgres"]
postgres_instances: ["{{ immich_name }}-postgres"]
postgres_docker_env_db: "{{ immich_name }}"
postgres_docker_image_tag: "pg14-v0.1.11"
postgres_docker_image_repo: "tensorchord/pgvecto-rs"
Expand Down
2 changes: 1 addition & 1 deletion roles/joplin/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ joplin_docker_envs_default:
POSTGRES_DATABASE: "joplin"
POSTGRES_USER: "joplin"
POSTGRES_PORT: "5432"
POSTGRES_HOST: "{{ joplin_name }}_postgres"
POSTGRES_HOST: "{{ joplin_name }}-postgres"
DB_CLIENT: "pg"
joplin_docker_envs_custom: {}
joplin_docker_envs: "{{ joplin_docker_envs_default
Expand Down
8 changes: 7 additions & 1 deletion roles/joplin/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
# GNU General Public License v3.0 #
#########################################################################
---
- name: Remove legacy PostgreSQL Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/remove_docker_container.yml"
vars:
var_prefix: "{{ joplin_name }}_postgres"


- name: PostgreSQL Role
ansible.builtin.include_role:
name: postgres
vars:
postgres_instances: ["{{ joplin_name }}_postgres"]
postgres_instances: ["{{ joplin_name }}-postgres"]
postgres_docker_image_tag: "13"
postgres_docker_env_db: "joplin"
postgres_docker_env_user: "joplin"
Expand Down
2 changes: 1 addition & 1 deletion roles/miniflux/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ miniflux_docker_ports: "{{ miniflux_docker_ports_defaults
miniflux_postgres_username: "{{ lookup('vars', miniflux_name + '_postgres_docker_env_user', default=postgres_docker_env_user) }}"
miniflux_postgres_password: "{{ lookup('vars', miniflux_name + '_postgres_docker_env_password', default=postgres_docker_env_password) }}"
miniflux_docker_envs_default:
DATABASE_URL: "postgres://{{ miniflux_postgres_username }}:{{ miniflux_postgres_password }}@{{ miniflux_name }}_postgres/miniflux?sslmode=disable"
DATABASE_URL: "postgres://{{ miniflux_postgres_username }}:{{ miniflux_postgres_password }}@{{ miniflux_name }}-postgres/miniflux?sslmode=disable"
RUN_MIGRATIONS: "{{ miniflux_run_migrations }}"
CREATE_ADMIN: "{{ miniflux_create_admin }}"
ADMIN_USERNAME: "{{ miniflux_admin_username }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/miniflux/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ansible.builtin.include_role:
name: postgres
vars:
postgres_instances: ["{{ miniflux_name }}_postgres"]
postgres_instances: ["{{ miniflux_name }}-postgres"]
postgres_docker_env_db: "miniflux"
postgres_docker_image_tag: "{{ miniflux_postgres_image_tag }}"
postgres_paths_folder: "{{ miniflux_name }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/n8n/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ n8n_docker_envs_default:
TZ: "{{ tz }}"
DB_TYPE: "postgresdb"
DB_POSTGRESDB_DATABASE: "{{ n8n_name }}"
DB_POSTGRESDB_HOST: "{{ n8n_name }}_postgres"
DB_POSTGRESDB_HOST: "{{ n8n_name }}-postgres"
DB_POSTGRESDB_PORT: "5432"
DB_POSTGRESDB_USER: "{{ postgres_docker_env_user }}"
DB_POSTGRESDB_PASSWORD: "{{ postgres_docker_env_password }}"
Expand Down
8 changes: 7 additions & 1 deletion roles/n8n/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
# GNU General Public License v3.0 #
#########################################################################
---
- name: Remove legacy PostgreSQL Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/remove_docker_container.yml"
vars:
var_prefix: "{{ n8n_name }}_postgres"


- name: PostgreSQL Role
ansible.builtin.include_role:
name: postgres
vars:
postgres_instances: ["{{ n8n_name }}_postgres"]
postgres_instances: ["{{ n8n_name }}-postgres"]
postgres_docker_env_db: "{{ n8n_name }}"
postgres_docker_image_tag: "14-alpine"
postgres_paths_folder: "{{ n8n_name }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/paperless_ngx/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ paperless_ngx_docker_envs_default:
USERMAP_UID: "{{ uid }}"
USERMAP_GID: "{{ gid }}"
PAPERLESS_REDIS: "redis://{{ paperless_ngx_name }}-redis:6379"
PAPERLESS_DBHOST: "{{ paperless_ngx_name }}_postgres"
PAPERLESS_DBHOST: "{{ paperless_ngx_name }}-postgres"
PAPERLESS_DBPORT: "5432"
PAPERLESS_DBNAME: "{{ paperless_ngx_name }}"
PAPERLESS_DBPASS: "{{ postgres_docker_env_password }}"
Expand Down
7 changes: 6 additions & 1 deletion roles/paperless_ngx/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@
redis_paths_folder: "{{ paperless_ngx_name }}"
redis_paths_location: "{{ server_appdata_path }}/{{ redis_paths_folder }}/redis"

- name: Remove legacy PostgreSQL Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/remove_docker_container.yml"
vars:
var_prefix: "{{ paperless_ngx_name }}_postgres"

- name: PostgreSQL Role
ansible.builtin.include_role:
name: postgres
vars:
postgres_instances: ["{{ paperless_ngx_name }}_postgres"]
postgres_instances: ["{{ paperless_ngx_name }}-postgres"]
postgres_docker_env_db: "{{ paperless_ngx_name }}"
postgres_docker_image_tag: "14-alpine"
postgres_paths_folder: "{{ paperless_ngx_name }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/wikijs/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ wikijs_docker_ports: "{{ wikijs_docker_ports_defaults
wikijs_docker_envs_default:
TZ: "{{ tz }}"
DB_TYPE: "postgres"
DB_HOST: "{{ wikijs_name }}_postgres"
DB_HOST: "{{ wikijs_name }}-postgres"
DB_PORT: "5432"
DB_USER: "{{ postgres_docker_env_user }}"
DB_PASS: "{{ postgres_docker_env_password }}"
Expand Down
8 changes: 7 additions & 1 deletion roles/wikijs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
# GNU General Public License v3.0 #
#########################################################################
---
- name: Remove legacy PostgreSQL Docker container
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/docker/remove_docker_container.yml"
vars:
var_prefix: "{{ wikijs_name }}_postgres"


- name: PostgreSQL Role
ansible.builtin.include_role:
name: postgres
vars:
postgres_instances: ["{{ wikijs_name }}_postgres"]
postgres_instances: ["{{ wikijs_name }}-postgres"]
postgres_docker_env_db: "{{ wikijs_name }}"
postgres_docker_image_tag: "14-alpine"
postgres_paths_folder: "{{ wikijs_name }}"
Expand Down

0 comments on commit d844c1b

Please sign in to comment.