Vendor Galaxy Roles and Collections
Some checks failed
/ Ansible Lint (push) Failing after 5m45s
/ Ansible Lint (pull_request) Failing after 4m59s

This commit is contained in:
Stefan Bethke 2026-02-06 22:07:16 +01:00
commit 2aed20393f
8 changed files with 387444 additions and 2 deletions

View file

@ -0,0 +1,17 @@
debops.miniflux - Manage Miniflux with Ansible
Copyright (C) 2021-2022 Berkhan Berkdemir <berkhan@tekdanisman.com>
Copyright (C) 2015-2022 DebOps <https://debops.org/>
SPDX-License-Identifier: GPL-3.0-only
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses/

View file

@ -0,0 +1,378 @@
---
# Copyright (C) 2021-2022 Berkhan Berkdemir <berkhan@tekdanisman.com>
# Copyright (C) 2022 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2022 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# .. _miniflux__ref_defaults:
# debops.miniflux default variables
# =================================
# .. contents:: Sections
# :local:
#
# .. include:: ../../../../includes/global.rst
# Web service configuration [[[
# -----------------------------
# .. envvar:: miniflux__domain [[[
#
# The DNS domain used by other variables in the ``debops.miniflux``
# role.
miniflux__domain: '{{ ansible_domain }}'
# ]]]
# .. envvar:: miniflux__fqdn [[[
#
# String of the Fully Qualified domain names on which the Miniflux
# application will be available, used by the webserver.
miniflux__fqdn: 'miniflux.{{ miniflux__domain }}'
# ]]]
# .. envvar:: miniflux__bind [[[
#
# The ip address on which this Miniflux listens on.
miniflux__bind: '127.0.0.1'
# ]]]
# .. envvar:: miniflux__port [[[
#
# Port number on which this Miniflux listens on.
miniflux__port: '3366'
# ]]]
# ]]]
# Application user, group, home [[[
# ---------------------------------
# .. envvar:: miniflux__user [[[
#
# Name of the UNIX system account used by the Miniflux service.
miniflux__user: 'miniflux'
# ]]]
# .. envvar:: miniflux__group [[[
#
# Name of the UNIX system group used by the Miniflux service.
miniflux__group: 'miniflux'
# ]]]
# .. envvar:: miniflux__gecos [[[
#
# Contents of the GECOS field set for the Miniflux account.
miniflux__gecos: 'Miniflux'
# ]]]
# .. envvar:: miniflux__shell [[[
#
# The default shell set on the Miniflux account.
miniflux__shell: '/usr/sbin/nologin'
# ]]]
# .. envvar:: miniflux__home [[[
#
# The Miniflux account home directory.
miniflux__home: '{{ (ansible_local.fhs.home | d("/var/local"))
+ "/" + miniflux__user }}'
# ]]]
# ]]]
# PostgreSQL database configuration [[[
# -------------------------------------
# The Miniflux database configuration is managed by the
# :ref:`debops.postgresql` Ansible role. See its documentation for
# details about the default variable values used in the Miniflux role.
# .. envvar:: miniflux__database_host [[[
#
# The hostname or IP address of the PostgreSQL database server to use
# for the Miniflux database.
miniflux__database_host: '{{ ansible_local.postgresql.server | d("localhost") }}'
# ]]]
# .. envvar:: miniflux__database_port [[[
#
# The TCP port of the PostgreSQL database server which should be used by
# Miniflux.
miniflux__database_port: '{{ ansible_local.postgresql.port | d("5432") }}'
# ]]]
# .. envvar:: miniflux__database_name [[[
#
# Name of the PostgreSQL database and its corresponding role used by
# Miniflux. This role won't be able to login to the database server
# directly.
miniflux__database_name: 'miniflux_production'
# ]]]
# .. envvar:: miniflux__database_user [[[
#
# Name of the PostgreSQL role used by Miniflux. This role will be able
# to login to the PostgreSQL server and access the Miniflux database.
miniflux__database_user: 'miniflux'
# ]]]
# .. envvar:: miniflux__database_password [[[
#
# Autogenerated password to the Miniflux PostgreSQL user role.
miniflux__database_password: '{{ lookup("password", secret + "/postgresql/" +
(ansible_local.postgresql.delegate_to | d("localhost")) + "/" +
(ansible_local.postgresql.port | d("5432")) + "/credentials/" +
miniflux__database_user + "/password") }}'
# ]]]
# ]]]
# Go application deployment [[[
# -----------------------------
# These variables control how the :command:`miniflux` binary is
# installed on the host. The installation is performed by the
# :ref:`debops.golang` role, refer to its documentation for details. The
# installation definition can be found in the
# :envvar:`miniflux__golang__dependent_packages` variable.
# .. envvar:: miniflux__upstream_gpg_key [[[
#
# The fingerprint of the GPG key which is used to sign the Miniflux
# releases. It will be used to verify the downloaded signature file as
# well as the :command:`git` tags in the source repository.
miniflux__upstream_gpg_key: '5A7A 89AC F055 24CA A0F3 6F9B AEB7 A164 0710 8DB5'
# ]]]
# .. envvar:: miniflux__upstream_type [[[
#
# Specify the method which should be used to install Miniflux binary. The
# ``apt`` method will install Miniflux via the configured APT repository, if
# it's available. The ``url`` method will download the :command:`miniflux`
# compiled binary and install it directly after verification with the official
# GPG key. The ``git`` method will download Miniflux source code and compile it
# locally (this method doesn't work on Debian Bullseye due to missing "embed"
# Go library).
miniflux__upstream_type: 'apt'
# ]]]
# .. envvar:: miniflux__upstream_version [[[
#
# Version of the Miniflux upstream.
miniflux__upstream_version: '2.0.35'
# ]]]
# .. envvar:: miniflux__upstream_url_mirror [[[
#
# The base URL of the Miniflux download page, should end with the ``/``
# character.
miniflux__upstream_url_mirror: 'https://github.com/miniflux/v2/releases/'
# ]]]
# .. envvar:: miniflux__upstream_platform [[[
#
# Specify the OS type and platform architecture to use for installation.
# The list of supported architectures and OS types can be found on the
# https://github.com/miniflux/v2/releases/ page.
miniflux__upstream_platform: 'linux-amd64'
# ]]]
# .. envvar:: miniflux__upstream_git_repository [[[
#
# The URL of the upstream :command:`git` repository which contains
# Miniflux source code.
miniflux__upstream_git_repository: 'https://github.com/miniflux/miniflux'
# ]]]
# .. envvar:: miniflux__binary [[[
#
# Absolute path to the :command:`miniflux` Go binary installed on the
# host. See the :ref:`debops.golang` role for more details.
miniflux__binary: '{{ ansible_local.golang.binaries["miniflux"]
if (ansible_local.golang.binaries | d() and
ansible_local.golang.binaries.miniflux | d())
else "" }}'
# ]]]
# ]]]
# Miniflux configuration [[[
# --------------------------
# The variables below define the contents of the :file:`/etc/miniflux.conf`
# configuration file. See :ref:`miniflux__ref_configuration` for more details.
# .. envvar:: miniflux__default_configuration [[[
#
# Miniflux configuration options defined by the role by default.
miniflux__default_configuration:
- name: 'run_migrations'
value: True
- name: 'database_url'
value: '{{ "postgres://" + miniflux__database_user
+ ":" + miniflux__database_password
+ "@" + miniflux__database_host
+ ":" + miniflux__database_port
+ "/" + miniflux__database_name }}'
- name: 'listen_addr'
value: '{{ miniflux__bind + ":" + miniflux__port }}'
- name: 'base_url'
value: '{{ "https://" + miniflux__fqdn }}'
# ]]]
# .. envvar:: miniflux__configuration [[[
#
# Miniflux configuration options defined on all hosts in the Ansible inventory.
miniflux__configuration: []
# ]]]
# .. envvar:: miniflux__group_configuration [[[
#
# Miniflux configuration options defined on hosts in a specific Ansible
# inventory group.
miniflux__group_configuration: []
# ]]]
# .. envvar:: miniflux__host_configuration [[[
#
# Miniflux configuration options defined on specific hosts in the Ansible
# inventory.
miniflux__host_configuration: []
# ]]]
# .. envvar:: miniflux__combined_configuration [[[
#
# Variable which combines all Miniflux configuration lists and is used in role
# tasks and templates.
miniflux__combined_configuration: '{{ miniflux__default_configuration
+ miniflux__configuration
+ miniflux__group_configuration
+ miniflux__host_configuration }}'
# ]]]
# ]]]
# Configuration variables for other Ansible roles [[[
# ---------------------------------------------------
miniflux__keyring__dependent_apt_keys:
- id: '{{ miniflux__upstream_gpg_key }}'
url: 'https://apt.miniflux.app/KEY.gpg'
repo: 'deb https://apt.miniflux.app/ /'
state: '{{ "present"
if (miniflux__upstream_type == "apt")
else "absent" }}'
# ]]]
# .. envvar:: miniflux__postgresql__dependent_roles [[[
#
# Role configuration for the :ref:`debops.postgresql` Ansible role.
miniflux__postgresql__dependent_roles:
- name: '{{ miniflux__database_user }}'
- name: '{{ miniflux__database_name }}'
flags: [ 'NOLOGIN' ]
# ]]]
# .. envvar:: miniflux__postgresql__dependent_groups [[[
#
# Group configuration for the :ref:`debops.postgresql` Ansible role.
miniflux__postgresql__dependent_groups:
- roles: [ '{{ miniflux__database_user }}' ]
groups: [ '{{ miniflux__database_name }}' ]
database: '{{ miniflux__database_name }}'
# ]]]
# .. envvar:: miniflux__postgresql__dependent_databases [[[
#
# Database configuration for the :ref:`debops.postgresql` Ansible role.
miniflux__postgresql__dependent_databases:
- name: '{{ miniflux__database_name }}'
owner: '{{ miniflux__database_name }}'
# ]]]
# .. envvar:: miniflux__postgresql__dependent_pgpass [[[
#
# ``~/.pgpass`` configuration for the :ref:`debops.postgresql` Ansible
# role.
miniflux__postgresql__dependent_pgpass:
- owner: '{{ miniflux__user }}'
group: '{{ miniflux__group }}'
home: '{{ miniflux__home }}'
system: True
# ]]]
# .. envvar:: miniflux__postgresql__dependent_extensions [[[
#
# Configuration of PostgreSQL extensions for the
# :ref:`debops.postgresql` Ansible role.
miniflux__postgresql__dependent_extensions:
- database: '{{ miniflux__database_name }}'
extension: 'hstore'
# ]]]
# .. envvar:: miniflux__golang__dependent_packages [[[
#
# Configuration for the :ref:`debops.golang` Ansible role.
miniflux__golang__dependent_packages:
- name: 'miniflux'
upstream_type: '{{ miniflux__upstream_type }}'
apt_packages: [ 'miniflux' ]
gpg:
- id: '{{ miniflux__upstream_gpg_key }}'
url: 'https://apt.miniflux.app/KEY.gpg'
url:
- src: '{{ miniflux__upstream_url_mirror + "download/" + miniflux__upstream_version + "/miniflux-" + miniflux__upstream_platform }}'
dest: 'releases/{{ miniflux__upstream_platform }}/miniflux/miniflux/" + miniflux__upstream_version + "/miniflux_" + miniflux__upstream_version + "_linux_amd64'
url_binaries:
- src: 'releases/{{ miniflux__upstream_platform }}/miniflux/miniflux/" + miniflux__upstream_version + "/miniflux_" + miniflux__upstream_version + "_linux_amd64'
dest: 'miniflux'
notify: [ 'Restart miniflux' ]
git:
- repo: '{{ miniflux__upstream_git_repository }}'
version: '{{ miniflux__upstream_version }}'
build_script: |
make clean linux-amd64
git_binaries:
- src: 'github.com/miniflux/v2/bin/miniflux.app'
dest: 'miniflux'
notify: [ 'Restart miniflux' ]
# ]]]
# .. envvar:: miniflux__nginx__dependent_upstreams [[[
#
# Upstream configuration for the :ref:`debops.nginx` Ansible role.
miniflux__nginx__dependent_upstreams:
- name: 'miniflux-upstream'
server: '{{ miniflux__bind }}:{{ miniflux__port }}'
# ]]]
# .. envvar:: miniflux__nginx__dependent_servers [[[
#
# Server configuration for the :ref:`debops.nginx` Ansible role.
miniflux__nginx__dependent_servers:
- name: '{{ miniflux__fqdn }}'
by_role: 'debops.miniflux'
filename: 'debops.miniflux'
type: 'proxy'
proxy_location: '/'
proxy_headers: True
proxy_options: |
proxy_redirect off;
proxy_pass: 'http://miniflux-upstream'
# ]]]
# .. envvar:: miniflux__etc_services__dependent_list [[[
#
# Configuration for the :ref:`debops.etc_services` Ansible role.
miniflux__etc_services__dependent_list:
- name: 'miniflux'
port: '{{ miniflux__port }}'
# ]]]
# ]]]

View file

@ -0,0 +1,31 @@
---
# Copyright (C) 2021-2022 Berkhan Berkdemir <berkhan@tekdanisman.com>
# Copyright (C) 2015-2022 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# Ensure that custom Ansible plugins and modules included in the main DebOps
# collection are available to roles in other collections.
collections: [ 'debops.debops' ]
dependencies: []
galaxy_info:
author: 'Berkhan Berkdemir'
description: 'Install and manage a Miniflux instance'
company: 'DebOps'
license: 'GPL-3.0-only'
min_ansible_version: '1.8.0'
platforms:
- name: 'Ubuntu'
versions: [ 'all' ]
- name: 'Debian'
versions: [ 'all' ]
galaxy_tags:
- cloud
- private
- privacy

View file

@ -0,0 +1,12 @@
# Copyright (C) 2021-2022 Berkhan Berkdemir <berkhan@tekdanisman.com>
# Copyright (C) 2015-2022 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# Role: miniflux
# Package: miniflux
# Version: 2.0.35
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%" \
https://github.com/miniflux/v2/tags \
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate

View file

@ -0,0 +1,72 @@
---
# Copyright (C) 2021-2022 Berkhan Berkdemir <berkhan@tekdanisman.com>
# Copyright (C) 2015-2022 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Import custom Ansible plugins
ansible.builtin.import_role:
name: 'ansible_plugins'
- name: Import DebOps global handlers
ansible.builtin.import_role:
name: 'global_handlers'
- name: Import DebOps secret role
ansible.builtin.import_role:
name: 'secret'
- name: Create required UNIX system group
ansible.builtin.group:
name: '{{ miniflux__group }}'
state: 'present'
system: True
- name: Create required UNIX system account
ansible.builtin.user:
name: '{{ miniflux__user }}'
group: '{{ miniflux__group }}'
home: '{{ miniflux__home }}'
comment: '{{ miniflux__gecos }}'
shell: '{{ miniflux__shell }}'
skeleton: '/dev/null'
state: 'present'
system: True
- name: Generate Miniflux configuration
ansible.builtin.template:
src: 'etc/miniflux.conf.j2'
dest: '/etc/miniflux.conf'
mode: '0640'
notify: [ 'Restart miniflux' ]
- name: Install systemd configuration files
ansible.builtin.template:
src: 'etc/systemd/system/miniflux.service.j2'
dest: '/etc/systemd/system/miniflux.service'
mode: '0644'
notify: [ 'Reload service manager' ]
when: miniflux__upstream_type != 'apt'
- name: Flush handlers if needed
ansible.builtin.meta: 'flush_handlers'
- name: Start and enable Miniflux service
ansible.builtin.service:
name: 'miniflux'
state: 'started'
enabled: True
when: miniflux__upstream_type != 'apt'
- name: Make sure that Ansible local facts directory exists
ansible.builtin.file:
path: '/etc/ansible/facts.d'
state: 'directory'
mode: '0755'
- name: Save Minflux local facts
ansible.builtin.template:
src: 'etc/ansible/facts.d/miniflux.fact.j2'
dest: '/etc/ansible/facts.d/miniflux.fact'
mode: '0755'
notify: [ 'Refresh host facts' ]
tags: [ 'meta::facts' ]

View file

@ -0,0 +1,34 @@
#!{{ ansible_python['executable'] }}
# -*- coding: utf-8 -*-
# Copyright (C) 2022 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2022 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# {{ ansible_managed }}
from __future__ import print_function
from json import loads, dumps
import subprocess
import os
def cmd_exists(cmd):
return any(
os.access(os.path.join(path, cmd), os.X_OK)
for path in os.environ["PATH"].split(os.pathsep)
)
output = {'installed': cmd_exists('miniflux')}
try:
miniflux_version_stdout = subprocess.check_output(
["miniflux", "--version"]
).decode('utf-8').strip()
if miniflux_version_stdout:
output['version'] = miniflux_version_stdout
except Exception:
pass
print(dumps(output, sort_keys=True, indent=4))

View file

@ -0,0 +1,54 @@
{# Copyright (C) 2021-2022 Berkhan Berkdemir <berkhan@tekdanisman.com>
# Copyright (C) 2022 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2022 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
#}
# {{ ansible_managed }}
{% for item in miniflux__combined_configuration | debops.debops.parse_kv_config %}
{% if item.state not in [ 'absent', 'ignore', 'init' ] %}
{% if item.separator | d() %}
{{ '' }}
{% endif %}
{% if (item.comment | d()) and not loop.first %}
{{ '' }}
{% endif %}
{% if item.comment | d() %}
{{ item.comment | regex_replace('\n$','') | comment(prefix='', postfix='') -}}
{% endif %}
{% set item_comment = '' %}
{% set item_name = item.name | upper %}
{% if item.state == 'comment' %}
{% set item_comment = '#' %}
{% endif %}
{% if item.raw | d() %}
{% if item.state == 'comment' %}
{{ item.raw | regex_replace('\n$','') | comment(prefix='', postfix='', decoration='#') -}}
{% else %}
{{ item.raw | regex_replace('\n$','') }}
{% endif %}
{% elif item.value is defined %}
{% if item.value | bool and item.value is not iterable %}
{% if item.value | string == '1' %}
{{ "{}{}={}".format(item_comment, item_name, item.value) }}
{% else %}
{{ "{}{}={}".format(item_comment, item_name, '1') }}
{% endif %}
{% elif not item.value | bool and item.value is not iterable %}
{% if item.value is not none %}
{% if item.value | int or item.value | string == '0' %}
{{ "{}{}={}".format(item_comment, item_name, item.value) }}
{% else %}
{{ "{}{}={}".format(item_comment, item_name, '0') }}
{% endif %}
{% endif %}
{% elif item.value is string %}
{{ '{}{}="{}"'.format(item_comment, item_name, item.value) }}
{% elif item.value is number %}
{{ "{}{}={}".format(item_comment, item_name, item.value) }}
{% elif item.value is not string and item.value is not mapping %}
{{ "{}{}={}".format(item_comment, item_name, item.value | join(" ")) }}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}

View file

@ -0,0 +1,41 @@
{# Copyright (C) 2021-2022 Berkhan Berkdemir <berkhan@tekdanisman.com>
# Copyright (C) 2022 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2022 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
#}
{{ ansible_managed | comment(prefix='', postfix='') }}
[Unit]
Description=Miniflux
Documentation=man:miniflux(1) https://miniflux.app/docs/index.html
After=network.target network-online.target postgresql.service
[Service]
ExecStart={{ miniflux__binary }}
User={{ miniflux__user }}
EnvironmentFile=/etc/miniflux.conf
Type=notify
WatchdogSec=60s
WatchdogSignal=SIGKILL
Restart=always
RestartSec=5
RuntimeDirectory=miniflux
AmbientCapabilities=CAP_NET_BIND_SERVICE
ProtectSystem=strict
PrivateTmp=yes
NoNewPrivileges=yes
RestrictNamespaces=yes
ProtectHome=yes
PrivateDevices=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectHostname=yes
RestrictRealtime=yes
ProtectKernelLogs=yes
ProtectClock=yes
SystemCallArchitectures=native
LockPersonality=yes
MemoryDenyWriteExecute=yes
[Install]
WantedBy=multi-user.target