mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-13 03:58:47 +00:00
66 lines
2.5 KiB
YAML
66 lines
2.5 KiB
YAML
---
|
|
- name: Start Miniflux
|
|
block:
|
|
- name: Create Miniflux Directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
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:
|
|
POSTGRES_USER: "miniflux"
|
|
POSTGRES_PASSWORD: "supersecure"
|
|
restart_policy: unless-stopped
|
|
memory: "{{ miniflux_postgres_memory }}"
|
|
|
|
- name: Create Miniflux Docker Container
|
|
community.docker.docker_container:
|
|
container_default_behavior: no_defaults
|
|
name: "{{ miniflux_container_name }}"
|
|
image: "{{ miniflux_image_name }}:{{ miniflux_image_version }}"
|
|
pull: true
|
|
networks:
|
|
- name: "{{ miniflux_network_name }}"
|
|
network_mode: "{{ miniflux_network_name }}"
|
|
ports:
|
|
- "{{ miniflux_port }}:8080"
|
|
env:
|
|
DATABASE_URL: "postgres://miniflux:supersecure@{{ miniflux_db_container_name }}/miniflux?sslmode=disable"
|
|
RUN_MIGRATIONS: "1"
|
|
CREATE_ADMIN: "1"
|
|
ADMIN_USERNAME: "{{ miniflux_admin_username }}"
|
|
ADMIN_PASSWORD: "{{ miniflux_admin_password }}"
|
|
restart_policy: unless-stopped
|
|
memory: "{{ miniflux_memory }}"
|
|
labels:
|
|
traefik.enable: "{{ miniflux_available_externally | string }}"
|
|
traefik.http.routers.miniflux.rule: "Host(`{{ miniflux_hostname }}.{{ ansible_nas_domain }}`)"
|
|
traefik.http.routers.miniflux.tls.certresolver: "letsencrypt"
|
|
traefik.http.routers.miniflux.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
traefik.http.routers.miniflux.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
|
traefik.http.services.miniflux.loadbalancer.server.port: "8080"
|
|
when: miniflux_enabled is true
|
|
|
|
- name: Stop Miniflux
|
|
block:
|
|
- name: Stop Miniflux
|
|
community.docker.docker_container:
|
|
name: "{{ miniflux_container_name }}"
|
|
state: absent
|
|
when: miniflux_enabled is false
|