add rss2email role
All checks were successful
Ansible Lint / build (push) Successful in 1m14s
Ansible Deploy / deploy (Ansible/playbooks/debian.yml) (push) Successful in 1m38s
Ansible Deploy / deploy (Ansible/playbooks/proxmox.yml) (push) Successful in 1m8s

This commit is contained in:
Benjamin Hays 2024-11-09 15:13:57 -05:00
parent 940707b01f
commit f70a826a91
4 changed files with 155 additions and 3 deletions

View File

@ -24,6 +24,11 @@ jobs:
with:
submodules: recursive
- name: Install Pip
run: |
apt update -y
apt install python3-pip -y
- name: "Cache python packages"
uses: actions/cache@v3
with:
@ -32,8 +37,6 @@ jobs:
- name: Install Ansible
run: |
apt update -y
apt install python3-pip -y
python3 -m pip install ansible==${{ env.ANSIBLE_VERSION }}
- name: Install Ansible Galaxy requirements

@ -1 +1 @@
Subproject commit fd37b52a9e6025dbad72e63820cb03d3008da17d
Subproject commit c32f82f99d6b33febc8cdf8bfb3c0381fbd37ecb

View File

@ -0,0 +1,52 @@
---
- name: RSS2Email
hosts: devops.benhays.cloud
remote_user: bhays
become: true
become_user: root
vars_files:
- ../homelab-vault/secrets.yml
vars:
smtp_server: "smtp.mailbox.org"
smtp_port: 465 # for SSL/TLS
# smtp_port: 587 # for STARTTLS
smtp_username: "ben@benhays.org"
smtp_password: "{{ SMTP_PASSWORD }}"
to_email: "ben@benhays.org"
from_email: "ben@benhays.org"
pre_tasks:
- name: Update apt cache if needed.
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
tasks:
- name: Update/install RSS2Email
ansible.builtin.apt:
name:
- rss2email
state: latest
- name: Create XDG_CONFIG folder
ansible.builtin.file:
path: /home/bhays/.config/
state: directory
owner: bhays
group: bhays
mode: "0770"
- name: Upload Config Template
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: bhays
group: bhays
mode: "0600"
with_items:
- { src: '../templates/rss2email.cfg.j2', dest: '/home/bhays/.config/rss2email.cfg' }
- name: Run r2e for the first time to cache articles
ansible.builtin.command: r2e run --no-send
changed_when: true
- name: Add Cronjob
ansible.builtin.cron:
name: "RSS2Email"
job: "r2e run"
special_time: hourly
user: bhays

View File

@ -0,0 +1,97 @@
[DEFAULT]
from = {{ from_email }}
user-agent = rss2email/__VERSION__ (__URL__)
use-8bit = False
force-from = False
use-publisher-email = False
name-format = {feed-title}: {author}
to = {{ to_email }}
proxy =
feed-timeout = 60
same-server-fetch-interval = 0
active = True
digest = False
date-header = False
date-header-order = modified, issued, created, expired
bonus-header =
trust-guid = True
trust-link = False
reply-changes = False
encodings = US-ASCII, ISO-8859-1, UTF-8, BIG5, ISO-2022-JP
post-process = rss2email.post_process.prettify process
digest-post-process =
html-mail = False
multipart-html = False
use-css = False
css = h1 {
font: 18pt Georgia, "Times New Roman";
}
body {
font: 12pt Arial;
}
a:link {
font: 12pt Arial;
font-weight: bold;
color: #0000cc;
}
blockquote {
font-family: monospace;
}
.header {
background: #e0ecff;
border-bottom: solid 4px #c3d9ff;
padding: 5px;
margin-top: 0px;
color: red;
}
.header a {
font-size: 20px;
text-decoration: none;
}
.footer {
background: #c3d9ff;
border-top: solid 4px #c3d9ff;
padding: 5px;
margin-bottom: 0px;
}
#entry {
border: solid 4px #c3d9ff;
}
#body {
margin-left: 5px;
margin-right: 5px;
}
unicode-snob = False
links-after-each-paragraph = False
inline-links = True
wrap-links = True
body-width = 0
email-protocol = smtp
sendmail = /usr/sbin/sendmail
sendmail_config =
smtp-auth = True
smtp-username = {{ smtp_username }}
smtp-password = {{ smtp_password }}
smtp-server = {{ smtp_server }}
smtp-port = {{ smtp_port }}
smtp-ssl = True
imap-auth = False
imap-username = username
imap-password = password
imap-server = imap.example.net
imap-port = 143
imap-ssl = False
imap-mailbox = INBOX
maildir-path = ~/Maildir
maildir-mailbox = INBOX
verbose = info
[feed.eff]
url = https://www.eff.org/rss/updates.xml
[feed.lwn-features]
url = https://benhays.org/lwn-features.xml
[feed.lwn-all]
url = https://benhays.org/lwn-all.xml