Merge branch 'main' into ldap-van-revspace

This commit is contained in:
Mark Janssen 2025-04-30 21:44:04 +02:00
commit 788bf25edd
Signed by: foobar
GPG key ID: D8674D8FC4F69BD2
23 changed files with 68 additions and 82 deletions

View file

@ -71,3 +71,7 @@
- { role: "acme", tags: [ "acme" ] }
- { role: "nginx", tags: [ "nginx" ] }
- { role: "chat", tags: [ "chat" ] }
- hosts: ldap
roles:
- { role: "common", tags: [ "common" ] }

View file

@ -6,4 +6,5 @@
- { role: "nft", tags: [ "nft" ] }
- { role: "nginx", tags: [ "nginx" ] }
- { role: "acme", tags: [ "acme" ] }
- { role: "nodesource", tags: [ "nodesource" ] }
- { role: "chat", tags: [ "chat" ] }

View file

@ -50,6 +50,9 @@ homeassistant.bitlair.nl
[chat]
chat.bitlair.nl
[ldap]
ldap-new.bitlair.nl
[debian:children]
bank
fotos

View file

@ -9,4 +9,5 @@
- { role: "nft", tags: [ "nft" ] }
- { role: "acme", tags: [ "acme" ] }
- { role: "nginx", tags: [ "nginx" ] }
- { role: "nodesource", tags: [ "nodesource" ] }
- { role: "etherpad", tags: [ "etherpad" ] }

View file

@ -1,4 +1,4 @@
SHELL=/bin/bash
#m h dom mon dow user command
0 * * * * {{ bank_user }} (cd /home/{{ bank_user }}/data.git && git pull -r && git push && git gc --auto && cp revbank.products ../revbank.products)
#m h dom mon dow user command
*/10 * * * * {{ bank_user }} (cd /home/{{ bank_user }}/data.git && git pull -r && git push && git gc --auto && cp revbank.products ../revbank.products)

View file

@ -4,17 +4,8 @@
ansible.builtin.apt:
state: present
pkg:
- gpg
- apt-transport-https
- build-essential
- name: Import nodesource signing key
ansible.builtin.shell:
cmd: curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor
-o /usr/share/keyrings/nodesource.gpg
args:
creates: /usr/share/keyrings/nodesource.gpg
notify: Apt update
- nodejs
- name: Ensure directories are present
ansible.builtin.file:
@ -30,26 +21,15 @@
notify:
- Restart thelounge
- name: Configure templates
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ item.owner | default( chat_user ) }}"
group: "{{ item.group | default( chat_group ) }}"
mode: "{{ item.mode | default('0640') }}"
with_items:
- { src: "nodesource.list", dest: "/etc/apt/sources.list.d/nodesource.list", owner: root, group: root }
- { src: "nodejs-apt-pref", dest: "/etc/apt/preferences.d/nodejs", owner: root, group: root }
- name: Install nodejs
ansible.builtin.apt:
name: nodejs
- name: Install yarn
ansible.builtin.shell:
cmd: npm install --global yarn
- stat: path=/opt/thelounge
- ansible.builtin.stat:
path: /opt/thelounge
register: src_path
- name: Retreive thelounge source
@ -88,14 +68,14 @@
state: present
- name: Ensure JS and JSON syntax checking packages are installed
yarn:
community.general.yarn:
name: "{{ item }}"
global: yes
state: latest # FIXME: Remove when https://github.com/ansible/ansible/pull/39557 makes it in
# state: latest # FIXME: Remove when https://github.com/ansible/ansible/pull/39557 makes it in
with_items:
- esprima
- jsonlint
changed_when: no # FIXME: Remove when https://github.com/ansible/ansible/pull/39557 makes it in
# changed_when: no # FIXME: Remove when https://github.com/ansible/ansible/pull/39557 makes it in
- name: Configure templates
ansible.builtin.template:

View file

@ -3,7 +3,8 @@
module.exports = {
public: false,
port: 9000,
bind: "127.0.0.1",
bind: "0.0.0.0",
host: "127.0.0.1",
reverseProxy: true,
lockNetwork: true,
maxHistory: 10000,

View file

@ -1,5 +0,0 @@
# {{ ansible_managed }}
Package: nodejs
Pin: origin deb.nodesource.com
Pin-Priority: 1000

View file

@ -1,3 +0,0 @@
# {{ ansible_managed }}
deb [arch=amd64 signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ nodejs_version }} nodistro main

View file

@ -1,4 +1,3 @@
nodejs_version: 22.x
etherpad_db_user: etherpad
etherpad_db_password: "{{ lookup('password', '/tmp/etherpad_db_password length=32') }}"
etherpad_db_name: etherpad

View file

@ -3,43 +3,10 @@
- name: Install dependencies
ansible.builtin.apt:
state: present
pkg:
- gpg
pkg:
- nodejs
- postgresql
- python3-psycopg2
- apt-transport-https
- name: Import nodesource signing key
ansible.builtin.shell:
cmd: curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor
-o /usr/share/keyrings/nodesource.gpg
args:
creates: /usr/share/keyrings/nodesource.gpg
notify: apt update
- name: Install nodesource source list
ansible.builtin.template:
src: nodesource.list
dest: /etc/apt/sources.list.d/nodesource.list
owner: root
group: root
mode: 0644
notify: apt update
- name: Install nodejs apt preference
ansible.builtin.template:
src: nodejs-apt-pref
dest: /etc/apt/preferences.d/nodejs
owner: root
group: root
mode: 0644
notify: apt update
- ansible.builtin.meta: flush_handlers
- name: Install nodejs
ansible.builtin.apt:
name: nodejs
- name: Add database user
become: true

View file

@ -1,4 +1,4 @@
# {{ ansible_managed }}
#m h dom mon dow user command
0 2 * * 1 {{ git_server_user }} {{ git_server_working_dir }}/update.sh
#m h dom mon dow user command
0 2 * * 1 root {{ git_server_working_dir }}/update.sh

View file

@ -0,0 +1,2 @@
---
nodesource_version: 22.x

View file

@ -0,0 +1,3 @@
---
- ansible.builtin.import_tasks:
file: ../../common/handlers/main.yaml

View file

@ -0,0 +1,33 @@
---
- name: Install dependencies
ansible.builtin.apt:
state: present
pkg:
- apt-transport-https
- gpg
- name: Import nodesource signing key
ansible.builtin.shell:
cmd: |
set -o pipefail
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg
executable: /bin/bash
args:
creates: /usr/share/keyrings/nodesource.gpg
notify: apt update
- name: Install nodesource apt files
ansible.builtin.template:
src: nodesource.list
dest: /etc/apt/sources.list.d/nodesource.list
owner: root
group: root
mode: 0644
notify: apt update
with_items:
- src: nodesource.list
dest: /etc/apt/sources.list.d/nodesource.list
- src: nodejs-apt-pref
dest: /etc/apt/preferences.d/nodejs
- ansible.builtin.meta: flush_handlers

View file

@ -1,3 +1,3 @@
# {{ ansible_managed }}
deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ nodejs_version }} nodistro main
deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ nodesource_version }} nodistro main

View file

@ -21,7 +21,7 @@
- name: Clone source
ansible.builtin.git:
repo: https://github.com/bitlair/discord-bot.git
repo: https://git.bitlair.nl/bitlair/discord-bot.git
version: main
dest: /var/lib/discord-bot
accept_hostkey: yes

View file

@ -7,7 +7,7 @@
- name: Clone source
ansible.builtin.git:
repo: https://github.com/bitlair/mastodon-spacestate.git
repo: https://git.bitlair.nl/bitlair/mastodon-spacestate.git
version: main
dest: /var/lib/mastodon-spacestate
accept_hostkey: yes

View file

@ -21,7 +21,7 @@
- name: Clone source
ansible.builtin.git:
repo: https://github.com/bitlair/spacestated.git
repo: https://git.bitlair.nl/bitlair/spacestated.git
version: main
dest: /var/lib/spacestated/spacestated
accept_hostkey: yes

View file

@ -8,7 +8,7 @@
- name: Clone source
ansible.builtin.git:
repo: https://github.com/bitlair/wifi-mqtt.git
repo: https://git.bitlair.nl/bitlair/wifi-mqtt.git
version: main
dest: /var/lib/wifi-mqtt
accept_hostkey: yes

View file

@ -5,7 +5,7 @@
- name: Clone source
ansible.builtin.git:
repo: https://github.com/bitlair/calendar-parser.git
repo: https://git.bitlair.nl/bitlair/wiki-calendar-exporter.git
version: main
dest: /usr/local/src/bitlair-calendar
accept_hostkey: yes

View file

@ -1,7 +1,7 @@
---
- name: Clone spaceapi source
ansible.builtin.git:
repo: https://github.com/bitlair/spaceapi.git
repo: https://git.bitlair.nl/bitlair/spaceapi.git
version: main
dest: /opt/spaceapi
accept_hostkey: true