infra/makemake.yml

229 lines
7.9 KiB
YAML

---
- hosts: makemake
vars:
makemake_secret: !vault |
$ANSIBLE_VAULT;1.1;AES256
37343337323036656636353033626634316239353366313330373938323031323430316463373566
6631376663363136306230336334653261386230333665630a623432643034366637626138303735
62313134653363386536633534656636643232613964666637323961353932306465623738323762
3930383063343266620a643736653063666532353334643937633566373735333166626537643638
39656363613936373436356431323234376432666365333236326634663337316566386338643831
3530303362316262303230653664636333636637383131653865
tasks:
- name: A user for makemake
user:
name: makemake
- name: Clone makemake
become: true
become_user: makemake
git:
repo: https://framagit.org/makemake/makemake
dest: /home/makemake/src/
- name: Clone makemake themes
become: true
become_user: makemake
git:
repo: https://framagit.org/makemake/makemake-themes
dest: /home/makemake/themes/
- name: Copy AFPy theme
command: cp -a /home/makemake/themes/afpy /home/makemake/src/themes/
- name: Setup or upgrade venv
become: true
become_user: makemake
command: python3 -m venv --upgrade-deps /home/makemake/venv/
changed_when: False
- name: install makemake requirements
become: true
become_user: makemake
pip:
requirements: /home/makemake/src/requirements.txt
virtualenv_command: /usr/bin/python3 -m venv
virtualenv: /home/makemake/venv/
- name: makemake nginx
include_role: name=nginx
vars:
nginx_owner: makemake
nginx_domain: planet.afpy.org
nginx_certificates: [planet.afpy.org]
nginx_conf: |
server
{
listen [::]:80; listen 80;
server_name planet.afpy.org;
return 301 https://$host$request_uri;
}
server
{
listen [::]:443 ssl http2; listen 443 ssl http2;
server_name planet.afpy.org;
include snippets/letsencrypt-planet.afpy.org.conf;
root /home/makemake/www/;
}
- name: Configure feeds
copy:
content: |
---
- name: "AFPy discuss"
url: https://discuss.afpy.org/latest.rss
link: https://discuss.afpy.org
avatar: https://www.afpy.org/static/images/logo.svg
- name: "AFPy - Mastodon"
url: "https://mamot.fr/@AFPy.rss"
link: "https://www.afpy.org/"
- name: "ascendances"
url: https://ascendances.wordpress.com/feed/
link: https://ascendances.wordpress.com/
- name: "Bearstech"
url: "https://bearstech.com/atom_feed.xml"
link: "https://bearstech.com/societe/blog/"
- name: "Human coders"
url: "https://news.humancoders.com/t/python/items/feed"
link: "https://news.humancoders.com/t/python"
- name: "Le blog de Dim'"
url: "https://dmerej.info/blog/fr/index.xml"
link: "https://dmerej.info/blog/fr"
- name: "Linuxfr.org"
url: "https://linuxfr.org/tags/python/public.atom"
link: "https://linuxfr.org/tags/python/public"
- name: "Olivier Pons"
url: "https://www.olivierpons.fr/feed"
link: "https://www.olivierpons.fr/"
- name: "Stella blog"
url: "https://ww.stella.coop/blog.rss"
link: "https://www.stella.coop/blog-articles"
- name: "Yaal"
url: https://www.yaal.fr/blog/feeds/all.atom.xml
link: https://www.yaal.fr/blog/index.html
- name: "Zeste de savoir - Articles"
url: "https://zestedesavoir.com/articles/flux/rss/?tag=python"
link: "https://zestedesavoir.com/bibliotheque/?tag=python"
- name: "Zeste de savoir - Billets"
url: "https://zestedesavoir.com/billets/flux/rss/?tag=python"
link: "https://zestedesavoir.com/bibliotheque/?tag=python"
- name: "Zeste de savoir - Tutoriels"
url: "https://zestedesavoir.com/tutoriels/flux/rss/?tag=python"
link: "https://zestedesavoir.com/bibliotheque/?tag=python"
dest: /home/makemake/src/datas/sources.yml
- name: Configure makemake
copy:
dest: /home/makemake/src/config-production.py
content: |
# encoding: utf-8
SECRET_KEY = "{{ makemake_secret }}"
JINJA_ENV = {
"TRIM_BLOCKS": True,
"LSTRIP_BLOCKS": True,
}
# Planet website configuration
# Title
MAKEMAKE_TITLE = "AFPy's Planet"
# Link to itself
MAKEMAKE_LINK = "https://planet.afpy.org/"
# Logo
MAKEMAKE_LOGO = "https://framagit.org/makemake/makemake/-/raw/main/makemake-logo.png"
# Favicon - if None, logo will be used in place
MAKEMAKE_FAVICON = None
# Description
MAKEMAKE_DESCRIPTION = "MakeMake The Dwarf Planet is a feed agregator."
# Themes
# Theme to use; should be present in themes/ folder
MAKEMAKE_THEME = "afpy"
# Not used for now, list all themes availables in themes/ folder
MAKEMAKE_DISCOVER_THEMES = False
# Not used for now, default list of themes
MAKEMAKE_THEMES = ["afpy"]
# Pagination
# Use pagination
MAKEMAKE_PAGINATION = False
# If pagination used, how many articles to display
MAKEMAKE_PAGINATION_SIZE = 10
# Boolean used in themes to display (or not) sources used
MAKEMAKE_DISPLAY_SOURCES = True
# Boolean used in themes to export subscriptions list (OPML format)
MAKEMAKE_EXPORT_SOURCES = True
# List of Planet feeds to generate (actualy, only RSS and ATOM are available)
MAKEMAKE_FEEDS = ["RSS", "ATOM"]
# Deleting old articles (in days)
MAKEMAKE_DELETE_OLDER = None
# Miscellaneous information that can be used by themes, you can specify whatever you
# want in there but it have to be used by the theme
MAKEMAKE_MISC = {
# Those values are specified only for testing purpose
"presentation": {
"title": "AFPy's MakeMake",
"text": """
<p>MakeMake is a <a href="https://en.wikipedia.org/wiki/Planet_(software)" alt="planet_software from wikipedia">planet software</a> making it simple to agregate multiple feeds.</p>
<p>You can contribute to MakeMake by opening issues on <a href="https://framagit.org/makemake/makemake/-/issues">our issue tracker</a> or contacting us via IRC.</p>""",
},
"related": [
{
"name": "MakeMake Source code",
"link": "https://framagit.org/makemake/makemake",
},
{
"name": "IRC Contact",
"link": "https://kiwiirc.com/nextclient/irc.geeknode.org/makemake",
},
],
}
- name: makemake output directory
file:
state: directory
path: /home/makemake/www/
owner: makemake
group: makemake
mode: 0755
- name: makemake cron errors to email
ansible.builtin.cron:
name: MAILTO
env: yes
user: makemake
job: admin@afpy.org
- name: makemake cron
ansible.builtin.cron:
name: makemake
minute: "40"
user: makemake
job: "cd /home/makemake/src/; /home/makemake/venv/bin/python /home/makemake/src/update.py --static /home/makemake/www/"
- name: run makemake once
become: true
become_user: makemake
shell: "cd /home/makemake/src/; /home/makemake/venv/bin/python /home/makemake/src/update.py --static /home/makemake/www/"