Compare commits

..

No commits in common. "788bf25eddf847b459cbf98dfe0716233b0bad45" and "b186b43e3e15109439cfbef3dd34968486c4eca7" have entirely different histories.

23 changed files with 82 additions and 68 deletions

View file

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

View file

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

View file

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

View file

@ -9,5 +9,4 @@
- { 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
*/10 * * * * {{ 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
0 * * * * {{ bank_user }} (cd /home/{{ bank_user }}/data.git && git pull -r && git push && git gc --auto && cp revbank.products ../revbank.products)

View file

@ -4,8 +4,17 @@
ansible.builtin.apt:
state: present
pkg:
- gpg
- apt-transport-https
- build-essential
- nodejs
- 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: Ensure directories are present
ansible.builtin.file:
@ -21,15 +30,26 @@
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
- ansible.builtin.stat:
path: /opt/thelounge
- stat: path=/opt/thelounge
register: src_path
- name: Retreive thelounge source
@ -68,14 +88,14 @@
state: present
- name: Ensure JS and JSON syntax checking packages are installed
community.general.yarn:
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,8 +3,7 @@
module.exports = {
public: false,
port: 9000,
bind: "0.0.0.0",
host: "127.0.0.1",
bind: "127.0.0.1",
reverseProxy: true,
lockNetwork: true,
maxHistory: 10000,

View file

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

View file

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

View file

@ -1,3 +1,4 @@
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,10 +3,43 @@
- name: Install dependencies
ansible.builtin.apt:
state: present
pkg:
- nodejs
pkg:
- gpg
- 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,3 +1,3 @@
# {{ ansible_managed }}
deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ nodesource_version }} nodistro main
deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ nodejs_version }} nodistro main

View file

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

View file

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

View file

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

View file

@ -1,33 +0,0 @@
---
- 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

@ -21,7 +21,7 @@
- name: Clone source
ansible.builtin.git:
repo: https://git.bitlair.nl/bitlair/discord-bot.git
repo: https://github.com/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://git.bitlair.nl/bitlair/mastodon-spacestate.git
repo: https://github.com/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://git.bitlair.nl/bitlair/spacestated.git
repo: https://github.com/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://git.bitlair.nl/bitlair/wifi-mqtt.git
repo: https://github.com/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://git.bitlair.nl/bitlair/wiki-calendar-exporter.git
repo: https://github.com/bitlair/calendar-parser.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://git.bitlair.nl/bitlair/spaceapi.git
repo: https://github.com/bitlair/spaceapi.git
version: main
dest: /opt/spaceapi
accept_hostkey: true