diff --git a/roles/linkwarden/defaults/main.yml b/roles/linkwarden/defaults/main.yml index dc67b3b88f..213d7f7b80 100644 --- a/roles/linkwarden/defaults/main.yml +++ b/roles/linkwarden/defaults/main.yml @@ -13,6 +13,19 @@ linkwarden_name: linkwarden +################################ +# Settings +################################ + +linkwarden_postgres_name: "{{ linkwarden_name }}-postgres" +linkwarden_postgres_docker_env_username: "{{ linkwarden_name }}" +linkwarden_postgres_docker_env_password: "{{ linkwarden_name }}" +linkwarden_postgres_docker_env_db: "{{ linkwarden_name }}" +linkwarden_postgres_docker_image_tag: "16-alpine" +linkwarden_postgres_docker_image_repo: "postgres" +linkwarden_postgres_paths_folder: "{{ linkwarden_name }}" +linkwarden_postgres_paths_location: "{{ server_appdata_path }}/{{ postgres_paths_folder }}/postgres" + ################################ # Paths ################################ @@ -78,7 +91,7 @@ linkwarden_docker_envs_default: STORAGE_FOLDER: "/data" NEXTAUTH_SECRET: "{{ linkwarden_secret_key.stdout }}" NEXTAUTH_URL: "{{ linkwarden_web_url }}/api/v1/auth" - DATABASE_URL: "postgresql://{{ user.name }}:{{ postgres_docker_env_password }}@{{ linkwarden_name }}-postgres:5432/{{ linkwarden_name }}" + DATABASE_URL: "postgresql://{{ linkwarden_postgres_docker_env_username }}:{{ linkwarden_postgres_docker_env_password }}@{{ linkwarden_postgres_name }}:5432/{{ linkwarden_postgres_docker_env_db }}" linkwarden_docker_envs_custom: {} linkwarden_docker_envs: "{{ linkwarden_docker_envs_default | combine(linkwarden_docker_envs_custom) }}" diff --git a/roles/linkwarden/tasks/main.yml b/roles/linkwarden/tasks/main.yml index 12c3cd1a93..3812e85b8b 100644 --- a/roles/linkwarden/tasks/main.yml +++ b/roles/linkwarden/tasks/main.yml @@ -11,11 +11,14 @@ ansible.builtin.include_role: name: postgres vars: - postgres_instances: ["{{ linkwarden_name }}-postgres"] - postgres_docker_env_db: "{{ linkwarden_name }}" - postgres_docker_image_tag: "16-alpine" - postgres_paths_folder: "{{ linkwarden_name }}" - postgres_paths_location: "{{ server_appdata_path }}/{{ postgres_paths_folder }}/postgres" + postgres_instances: ["{{ linkwarden_postgres_name }}"] + postgres_docker_env_username: "{{ linkwarden_postgres_docker_env_username }}" + postgres_docker_env_password: "{{ linkwarden_postgres_docker_env_password }}" + postgres_docker_env_db: "{{ linkwarden_postgres_docker_env_db }}" + postgres_docker_image_tag: "{{ linkwarden_postgres_docker_image_tag }}" + postgres_docker_image_repo: "{{ linkwarden_postgres_docker_image_repo }}" + postgres_paths_folder: "{{ linkwarden_postgres_paths_folder }}" + postgres_paths_location: "{{ linkwarden_postgres_paths_location }}" - name: "Generate Secret Key" ansible.builtin.shell: "openssl rand -base64 45"