From 4b5218986193f45490b6c5bbfe6e54b280fda36e Mon Sep 17 00:00:00 2001 From: Anarion Date: Sat, 11 Mar 2023 14:31:35 +0100 Subject: [PATCH] Add network to miniflux --- roles/miniflux/defaults/main.yml | 1 + roles/miniflux/tasks/main.yml | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/roles/miniflux/defaults/main.yml b/roles/miniflux/defaults/main.yml index 010223fd..b89a8fc4 100644 --- a/roles/miniflux/defaults/main.yml +++ b/roles/miniflux/defaults/main.yml @@ -12,6 +12,7 @@ miniflux_admin_password: supersecure # network miniflux_hostname: "miniflux" +miniflux_network_name: "miniflux" miniflux_port: "8070" # docker diff --git a/roles/miniflux/tasks/main.yml b/roles/miniflux/tasks/main.yml index 664813df..f70b1c91 100644 --- a/roles/miniflux/tasks/main.yml +++ b/roles/miniflux/tasks/main.yml @@ -8,12 +8,19 @@ with_items: - "{{ miniflux_data_directory }}/postgres" + - name: Create Miniflux network + community.docker.docker_network: + name: "{{ miniflux_network_name }}" + - name: Create Postgres for Miniflux community.docker.docker_container: container_default_behavior: no_defaults name: "{{ miniflux_db_container_name }}" image: "{{ miniflux_db_image_name }}:{{ miniflux_db_image_version }}" pull: true + networks: + - name: "{{ miniflux_network_name }}" + network_mode: "{{ miniflux_network_name }}" volumes: - "{{ miniflux_data_directory }}/postgres:/var/lib/postgresql/data:rw" env: @@ -28,12 +35,13 @@ name: "{{ miniflux_container_name }}" image: "{{ miniflux_image_name }}:{{ miniflux_image_version }}" pull: true - links: - - miniflux-postgres:db + networks: + - name: "{{ miniflux_network_name }}" + network_mode: "{{ miniflux_network_name }}" ports: - "{{ miniflux_port }}:8080" env: - DATABASE_URL: "postgres://miniflux:supersecure@db/miniflux?sslmode=disable" + DATABASE_URL: "postgres://miniflux:supersecure@{{ miniflux_db_container_name }}/miniflux?sslmode=disable" RUN_MIGRATIONS: "1" CREATE_ADMIN: "1" ADMIN_USERNAME: "{{ miniflux_admin_username }}"