diff --git a/group_vars/all.yml b/group_vars/all.yml index ea422fcb..6d6d2859 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -33,9 +33,6 @@ youtubedlmaterial_enabled: false # Music mymediaforalexa_enabled: false -# News -miniflux_enabled: false - # System Management glances_enabled: false stats_enabled: false @@ -379,15 +376,6 @@ guacamole_available_externally: "false" guacamole_data_directory: "{{ docker_home }}/guacamole" guacamole_port: "8090" -### -### Miniflux -### -miniflux_available_externally: "false" -miniflux_data_directory: "{{ docker_home }}/miniflux" -miniflux_admin_username: admin -miniflux_admin_password: supersecure -miniflux_port: "8070" - ### ### CloudCmd ### diff --git a/nas.yml b/nas.yml index b3d30af3..2cb4517f 100644 --- a/nas.yml +++ b/nas.yml @@ -108,6 +108,11 @@ - minidlna when: (minidlna_enabled | default(False)) + - role: miniflux + tags: + - miniflux + when: (miniflux_enabled | default(False)) + - role: mylar tags: - mylar @@ -223,10 +228,6 @@ when: (znc_enabled | default(False)) tags: znc - - import_tasks: tasks/miniflux.yml - when: (miniflux_enabled | default(False)) - tags: miniflux - - import_tasks: tasks/gitlab.yml when: (gitlab_enabled | default(False)) tags: gitlab diff --git a/roles/miniflux/defaults/main.yml b/roles/miniflux/defaults/main.yml new file mode 100644 index 00000000..0880b4f4 --- /dev/null +++ b/roles/miniflux/defaults/main.yml @@ -0,0 +1,19 @@ +--- +# enable or disable the application +miniflux_enabled: false +miniflux_available_externally: "false" + +# directories +miniflux_data_directory: "{{ docker_home }}/miniflux" + + +# env +miniflux_admin_username: admin +miniflux_admin_password: supersecure + +# network +miniflux_hostname: "miniflux" +miniflux_port: "8070" + +# specs +miniflux_memory: "1g" diff --git a/tasks/miniflux.yml b/roles/miniflux/tasks/main.yml similarity index 77% rename from tasks/miniflux.yml rename to roles/miniflux/tasks/main.yml index a22110e0..aeec94e2 100644 --- a/tasks/miniflux.yml +++ b/roles/miniflux/tasks/main.yml @@ -1,7 +1,9 @@ +--- - name: Create Miniflux Directories file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ miniflux_data_directory }}/postgres" @@ -18,13 +20,18 @@ restart_policy: unless-stopped memory: 1g -- name: Create Miniflux container +- name: Create Miniflux Docker Container docker_container: name: miniflux image: miniflux/miniflux:latest pull: true links: - miniflux-postgres:db + volumes: + - "{{ miniflux_config_directory }}:/config:rw" + - "{{ miniflux_logs }}:/logs:rw" + - "{{ miniflux_data_directory }}:/data:rw" + network_mode: "bridge" ports: - "{{ miniflux_port }}:8080" env: @@ -34,11 +41,11 @@ ADMIN_USERNAME: "{{ miniflux_admin_username }}" ADMIN_PASSWORD: "{{ miniflux_admin_password }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ miniflux_memory }}" labels: traefik.enable: "{{ miniflux_available_externally }}" - traefik.http.routers.miniflux.rule: "Host(`miniflux.{{ ansible_nas_domain }}`)" + 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" \ No newline at end of file + traefik.http.services.miniflux.loadbalancer.server.port: "8080"