Skip to content

Commit

Permalink
WikiJS: Convert Postgres to inventory vars
Browse files Browse the repository at this point in the history
  • Loading branch information
owine committed Jan 30, 2024
1 parent 1a65723 commit e26d097
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
15 changes: 13 additions & 2 deletions roles/wikijs/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@

wikijs_name: wikijs

################################
# Settings
################################

wikijs_postgres_name: "{{ wikijs_name }}-postgres"
wikijs_postgres_docker_env_db: "{{ wikijs_name }}"
wikijs_postgres_docker_image_tag: "14-alpine"
wikijs_postgres_docker_image_repo: "postgres"
wikijs_postgres_paths_folder: "{{ wikijs_name }}"
wikijs_postgres_paths_location: "{{ server_appdata_path }}/{{ postgres_paths_folder }}/postgres"

################################
# Paths
################################
Expand Down Expand Up @@ -76,11 +87,11 @@ wikijs_docker_ports: "{{ wikijs_docker_ports_defaults
wikijs_docker_envs_default:
TZ: "{{ tz }}"
DB_TYPE: "postgres"
DB_HOST: "{{ wikijs_name }}-postgres"
DB_HOST: "{{ wikijs_postgres_name }}"
DB_PORT: "5432"
DB_USER: "{{ postgres_docker_env_user }}"
DB_PASS: "{{ postgres_docker_env_password }}"
DB_NAME: "{{ wikijs_name }}"
DB_NAME: "{{ wikijs_postgres_docker_env_db }}"
wikijs_docker_envs_custom: {}
wikijs_docker_envs: "{{ wikijs_docker_envs_default
| combine(wikijs_docker_envs_custom) }}"
Expand Down
11 changes: 6 additions & 5 deletions roles/wikijs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
ansible.builtin.include_role:
name: postgres
vars:
postgres_instances: ["{{ wikijs_name }}-postgres"]
postgres_docker_env_db: "{{ wikijs_name }}"
postgres_docker_image_tag: "14-alpine"
postgres_paths_folder: "{{ wikijs_name }}"
postgres_paths_location: "{{ server_appdata_path }}/{{ postgres_paths_folder }}/postgres"
postgres_instances: ["{{ wikijs_postgres_name }}"]
postgres_docker_env_db: "{{ wikijs_postgres_docker_env_db }}"
postgres_docker_image_tag: "{{ wikijs_postgres_docker_image_tag }}"
postgres_docker_image_repo: "{{ wikijs_postgres_docker_image_repo }}"
postgres_paths_folder: "{{ wikijs_postgres_paths_folder }}"
postgres_paths_location: "{{ wikijs_postgres_paths_location }}"

- name: Add DNS record
ansible.builtin.include_tasks: "{{ resources_tasks_path }}/dns/tasker.yml"
Expand Down

0 comments on commit e26d097

Please sign in to comment.