Compare commits

..

29 Commits

Author SHA1 Message Date
d28e2ea89a docs: alphabetical order for variables 2025-11-17 07:38:13 +01:00
f79501e4c8 docs: fix readme according to repo name when it's cloned 2025-11-17 07:11:17 +01:00
a79f5c7ee6 docs: update readme 2025-11-16 18:53:02 +01:00
618d186ea2 feat: add default for refresh interval 2025-11-16 18:52:59 +01:00
6245e4a16a feat: add retry logic to the download task 2025-11-16 18:47:17 +01:00
988bc7a0f5 feat: create freshrss_root_dir if it doesn't exist 2025-11-16 18:45:47 +01:00
e41eb07485 feat: more descriptive task 2025-11-16 18:44:04 +01:00
1efa0c24e8 docs: update example with freshrss_checksum 2025-11-16 18:27:01 +01:00
5e4cd968ec feat: prefix checksum with sha256 if freshrss_checksum is defined 2025-11-16 18:26:52 +01:00
872a787989 docs: update readme 2025-11-16 17:46:48 +01:00
52ac5aec24 feat: enable user to choose ownership of application directory 2025-11-16 17:46:36 +01:00
1eccbe5405 feat: default user and group 2025-11-16 17:46:19 +01:00
580b243bbf fix: typo 2025-11-16 17:45:39 +01:00
de3996172a docs: update readme 2025-11-16 17:44:58 +01:00
8a08b6c760 feat: checksum verification for downloaded archive 2025-11-16 17:44:49 +01:00
7ac2ba401c feat: add checksum default "" 2025-11-16 17:44:11 +01:00
adacdda404 fix: clean archive only if it's there 2025-11-16 17:39:48 +01:00
5318fb2304 fix: requirements format 2025-11-16 17:07:24 +01:00
0dd3dd299c docs: switch Required and Default column for standard 2025-11-16 17:06:42 +01:00
987a3e81cc docs: add requirements/dependencies 2025-11-16 16:57:36 +01:00
d2e6f186cf docs: standardize readme for future roles 2025-11-16 16:53:20 +01:00
762246f879 docs: one uniq example and a table for variables 2025-11-16 16:17:17 +01:00
835a46ae27 docs: update readme with precision 2025-11-16 15:41:28 +01:00
02d3e02919 docs: update readme 2025-11-16 15:39:11 +01:00
4686d0d5f5 feat: add default for freshrss_path 2025-11-16 15:39:06 +01:00
b52faac854 docs: add readme 2025-11-16 15:32:23 +01:00
fb80445c83 feat: add preparation tasks 2025-11-16 15:32:20 +01:00
807c6e1c9b feat: add main task 2025-11-16 15:32:16 +01:00
9e70d15619 feat: add deploy.yml 2025-11-16 15:32:10 +01:00
5 changed files with 149 additions and 0 deletions

54
README.md Normal file
View File

@@ -0,0 +1,54 @@
# ansible-role-freshrss
This role deploys [FreshRSS](https://www.freshrss.org/) to your server(s).
It **does not** deploy php, nor a webserver or a database.
However, it does install the PHP dependencies for FreshRSS, including php-sqlite3 in case you want to use a simple SQLite database.
## Requirements
- Ansible 2.10
- Deb-based distribution (Debian, Ubuntu, etc.)
## Dependencies
This role doesn't have any dependencies to other roles.
## Playbook example
```yaml
---
- name: Deploy FreshRSS
hosts: freshrss_servers
become: true
vars:
freshrss_root_dir: "/var/www"
freshrss_version: "1.27.1"
freshrss_checksum: "99fd1d0e6f506832e6600c98e4c9369edad6bfec715df9b1b7c8c3eb6a455c22"
freshrss_refresh_interval: 10
roles:
- ansible-role-freshrss
```
## Variables
| Variable | Required | Default | Description |
| --------------------------- | -------- | ---------------------------------- | ---------------------------------------------------------------- |
| `freshrss_checksum` | No | `""` | SHA256 checksum to verify the archive if user sets it |
| `freshrss_group` | No | `www-data` | Group that will own FreshRSS files |
| `freshrss_path` | No | `{{ freshrss_root_dir }}/freshrss` | Web-accessible path where FreshRSS will be symlinked |
| `freshrss_refresh_interval` | No | `15` | Feed refresh interval in minutes (every X minutes) |
| `freshrss_root_dir` | **Yes** | - | Directory where FreshRSS archive is downloaded and extracted |
| `freshrss_user` | No | `www-data` | User that will own FreshRSS files and run the cron job |
| `freshrss_version` | **Yes** | - | FreshRSS version to deploy (e.g., `"1.27.1"`) |
## Additional information
FreshRSS configuration is to be done once deployed.
Navigate to the address you’ve installed your server to complete the installation from the GUI.
## License
This project is licensed under the GNU General Public License v3.0 or later (GPLv3+). See the [LICENSE](LICENSE) file for details.

6
defaults/main.yml Normal file
View File

@@ -0,0 +1,6 @@
---
freshrss_path: "{{ freshrss_root_dir }}/freshrss"
freshrss_checksum: ""
freshrss_user: www-data
freshrss_group: www-data
freshrss_refresh_interval: 15

57
tasks/deploy.yml Normal file
View File

@@ -0,0 +1,57 @@
---
- name: Check if this is the first run
ansible.builtin.stat:
path: "{{ freshrss_path }}"
register: freshrss_dir
- name: Download FreshRSS
ansible.builtin.get_url:
url: https://github.com/FreshRSS/FreshRSS/archive/refs/tags/{{ freshrss_version }}.tar.gz
dest: "{{ freshrss_root_dir }}/freshrss-{{ freshrss_version }}.tar.gz"
mode: "0644"
checksum: "{{ 'sha256:' ~ freshrss_checksum if (freshrss_checksum | length > 0) else omit }}"
when: not freshrss_dir.stat.exists
retries: 3
delay: 5
- name: Uncompress FreshRSS
ansible.builtin.unarchive:
src: "{{ freshrss_root_dir }}/freshrss-{{ freshrss_version }}.tar.gz"
dest: "{{ freshrss_root_dir }}"
remote_src: true
when: not freshrss_dir.stat.exists
- name: Clean archive
ansible.builtin.file:
name: "{{ freshrss_root_dir }}/freshrss-{{ freshrss_version }}.tar.gz"
state: absent
when: not freshrss_dir.stat.exists
- name: Give ownership to user {{ freshrss_user }} and group {{ freshrss_group }}
ansible.builtin.file:
path: "{{ freshrss_root_dir }}/FreshRSS-{{ freshrss_version }}"
owner: "{{ freshrss_user }}"
group: "{{ freshrss_group }}"
recurse: true
- name: Link the folder to web root on folder
ansible.builtin.file:
src: "{{ freshrss_root_dir }}/FreshRSS-{{ freshrss_version }}"
dest: "{{ freshrss_path }}"
state: link
follow: false
force: true
- name: Give ownership to {{ freshrss_user }} on link
ansible.builtin.file:
path: "{{ freshrss_path }}"
owner: "{{ freshrss_user }}"
group: "{{ freshrss_group }}"
follow: false
- name: Setup a cron to refresh feeds
ansible.builtin.cron:
name: update feeds
user: "{{ freshrss_user }}"
minute: "*/{{ freshrss_refresh_interval }}"
job: php -f {{ freshrss_path }}/app/actualize_script.php 1>/dev/null 2>&1

6
tasks/main.yml Normal file
View File

@@ -0,0 +1,6 @@
---
- name: Setup requirements
ansible.builtin.include_tasks: preparation.yml
- name: Deploy FreshRSS
ansible.builtin.include_tasks: deploy.yml

26
tasks/preparation.yml Normal file
View File

@@ -0,0 +1,26 @@
---
- name: Create freshrss_root_dir if it doesn't exist
ansible.builtin.file:
path: "{{ freshrss_root_dir }}"
state: directory
mode: "0755"
- name: Install cron for automatic feed refresh
ansible.builtin.apt:
name: cron
state: present
update_cache: true
- name: Install php dependencies
ansible.builtin.apt:
pkg:
- php
- php-curl
- php-gmp
- php-intl
- php-mbstring
- php-sqlite3
- php-xml
- php-zip
state: present
update_cache: true