Compare commits

..

4 commits

13 changed files with 178 additions and 25 deletions

19
files/wittgenstein/reboot.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games'
echo 'start i2c-foo'
sudo modprobe i2c_dev
sudo modprobe i2c_bcm2708
# wait for network devices
sleep 30
cd /home/pi
echo 'start ampel controller'
tmux new-session -s ampel 'cd /home/pi/netz39_space_notification/raspberry/ledcontrol && ./ledcontrol'
echo 'start lever controller'
tmux new-window -t ampel:1 'cd /home/pi/netz39_space_notification/raspberry/statusswitch && ./statusswitch'
#echo 'start spaceapi controller'
#tmux new-window -t ampel:2 '/home/pi/netz39_space_notification/SpaceAPI && ./update-json.py --server=platon'

7
files/wittgenstein/unstuck.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
logger -t unstuck "unstuck $(date)"
killall tmux
sleep 1
/home/pi/reboot.sh

View file

@ -544,8 +544,6 @@
mode: "0755" mode: "0755"
- path: "{{ data_dir }}/homebox/data" - path: "{{ data_dir }}/homebox/data"
mode: "0755" mode: "0755"
tags:
- homebox
- name: Ensure container for homebox is running - name: Ensure container for homebox is running
docker_container: docker_container:
@ -564,8 +562,6 @@
HBOX_LOG_LEVEL: "info" HBOX_LOG_LEVEL: "info"
HBOX_LOG_FORMAT: "text" HBOX_LOG_FORMAT: "text"
HBOX_WEB_MAX_UPLOAD_SIZE: "10" HBOX_WEB_MAX_UPLOAD_SIZE: "10"
tags:
- homebox
- name: Setup proxy site {{ homebox_domain_name }} - name: Setup proxy site {{ homebox_domain_name }}
include_role: include_role:
@ -574,8 +570,6 @@
site_name: "{{ homebox_domain_name }}" site_name: "{{ homebox_domain_name }}"
proxy_port: "{{ homebox_host_port }}" proxy_port: "{{ homebox_host_port }}"
proxy_preserve_host: "On" proxy_preserve_host: "On"
tags:
- homebox
- name: Setup proxy site spaceapi.n39.eu - name: Setup proxy site spaceapi.n39.eu
template: template:

View file

@ -13,13 +13,13 @@
nodered_image: nodered/node-red:3.0.1-1-18 nodered_image: nodered/node-red:3.0.1-1-18
nodered_data: "{{ data_dir }}/nodered" nodered_data: "{{ data_dir }}/nodered"
rabbitmq_image: bitnami/rabbitmq:3.12.7 rabbitmq_image: bitnami/rabbitmq:3.12.6
rabbitmq_data: "{{ data_dir }}/rabbitmq" rabbitmq_data: "{{ data_dir }}/rabbitmq"
pwr_meter_pulse_gw_image: netz39/power-meter-pulse-gateway:0.3.0 pwr_meter_pulse_gw_image: netz39/power-meter-pulse-gateway:0.3.0
brotherql_host_port: 9004 brotherql_host_port: 9004
brotherql_web_image: dersimn/brother_ql_web:2.1-alpine brotherql_web_image: pklaus/brother_ql_web:alpine_9e20b6d
roles: roles:
# role 'docker_setup' applied through group 'docker_host' # role 'docker_setup' applied through group 'docker_host'
@ -187,7 +187,7 @@
state: started state: started
ports: ports:
- "127.0.0.1:{{ brotherql_host_port }}:8013" - "127.0.0.1:{{ brotherql_host_port }}:8013"
command: "--default-label-size 62 --model QL-720NW tcp://{{ brotherql_printer_ip }}" command: " ./brother_ql_web.py --model QL-720NW tcp://{{ brotherql_printer_ip }}"
detach: yes detach: yes
env: env:
TZ: "{{ timezone }}" TZ: "{{ timezone }}"

View file

@ -14,7 +14,7 @@
dokuwiki_port: 9005 dokuwiki_port: 9005
# This container is pinned, because there are issues # This container is pinned, because there are issues
# with backwards compatibility within the same tag! # with backwards compatibility within the same tag!
dokuwiki_image: bitnami/dokuwiki:20230404@sha256:a13023559160cf6bd1f2b77b753b5335643d65c0347cad4898076efa9de78d14 dokuwiki_image: bitnami/dokuwiki:20230404@sha256:9350261bc0f5d5fdece01623b6e025242f3cf51415e67f20dbd6b3f5159431d2
discord_invite_domain: discord.netz39.de discord_invite_domain: discord.netz39.de

View file

@ -13,7 +13,7 @@
- name: Setup the docker container for unifi-controller - name: Setup the docker container for unifi-controller
docker_container: docker_container:
name: unifi-controller name: unifi-controller
image: jacobalberty/unifi:v7.5.176 image: jacobalberty/unifi:v7.5.174
state: started state: started
restart_policy: unless-stopped restart_policy: unless-stopped
container_default_behavior: no_defaults container_default_behavior: no_defaults

130
host-wittgenstein.yml Normal file
View file

@ -0,0 +1,130 @@
---
- hosts: wittgenstein2.n39.eu
become: true
roles:
- role: docker_setup
vars:
docker_data_root: "/srv/docker"
- role: apache
- role: apache_letsencrypt # Uses configuration from dehydrated setup
- role: ansible-role-dehydrated
vars:
dehydrated_contact_email: "{{ server_admin }}"
- role: penguineer.dehydrated_cron
tasks:
- name: Install packages needed for the system
# This is a list of all packages,
# unless they are installed by a specific role
ansible.builtin.apt:
state: present
name:
# This is needed for the user-executed tasks
- acl
# Regular packages
- tmux
- git-core
- cmake
- build-essential
- libmosquitto-dev
- libconfig-dev
- mosquitto-clients
- i2c-tools
# - name: Set MAC address for proper DHCP recognition
# # Uses mac variable from inventory
# ansible.builtin.template:
# src: templates/network-interfaces-dhcp-mac.j2
# dest: /etc/network/interfaces.d/wittgenstein-mac
# owner: root
# group: root
# mode: '0644'
- name: Disable IPv6
# Because it is not working....
ansible.builtin.copy:
src: files/sysctl-no-ipv6.conf
dest: /etc/sysctl.d/99-systcl-no-ipv6.conf
owner: root
group: root
mode: '0644'
### Gatekeeper user (pi for now)
#
# All the gatekeeping / door control stuff is here!
- name: Ensure gatekeeper user is there
ansible.builtin.user:
name: "{{ gatekeeper_user }}"
groups: dialout,audio,plugdev,input,netdev,i2c,gpio
append: yes
- name: Copy management scripts
ansible.builtin.copy:
src: "files/wittgenstein/{{ item }}"
dest: "/home/{{ gatekeeper_user }}/{{ item }}"
owner: "{{ gatekeeper_user }}"
group: "{{ gatekeeper_user }}"
mode: "0755"
loop:
- reboot.sh
- unstuck.sh
- name: Install start-up cron
ansible.builtin.cron:
name: Start the gatekeeper services
job: "/home/{{ gatekeeper_user }}/reboot.sh"
user: "{{ gatekeeper_user }}"
special_time: reboot
- name: Download wiringPi library
# WiringPi needs to be installed, but that library seems to be
# obsolete. We download something and hope it works...
ansible.builtin.get_url:
url: https://project-downloads.drogon.net/wiringpi-latest.deb
dest: "/home/{{ gatekeeper_user }}/wiringpi-latest.deb"
mode: "0644"
force: no
register: wiringPi_download
- name: Install wiringPi library # noqa 503
ansible.builtin.apt:
state: present
deb: "/home/{{ gatekeeper_user }}/wiringpi-latest.deb"
when: wiringPi_download.changed
### Ampelsteuerung
- name: Clone netz39_space_notification initial checkout
# Do this as the gatekeeper user!
become: yes
become_user: "{{ gatekeeper_user }}"
ansible.builtin.git:
repo: https://github.com/netz39/space_notification.git
dest: "/home/{{ gatekeeper_user }}/netz39_space_notification"
clone: yes
update: no
- name: Compile ledcontrol agent
# Do this as the gatekeeper user!
become: yes
become_user: "{{ gatekeeper_user }}"
ansible.builtin.shell:
chdir: "/home/{{ gatekeeper_user }}/netz39_space_notification/raspberry/ledcontrol"
cmd: make
creates: "/home/{{ gatekeeper_user }}/netz39_space_notification/raspberry/ledcontrol/ledcontrol"
- name: Compile statusswitch agent
# Do this as the gatekeeper user!
become: yes
become_user: "{{ gatekeeper_user }}"
ansible.builtin.shell:
chdir: "/home/{{ gatekeeper_user }}/netz39_space_notification/raspberry/statusswitch"
cmd: make
creates: "/home/{{ gatekeeper_user }}/netz39_space_notification/raspberry/statusswitch/statusswitch"
handlers:

View file

@ -1,2 +0,0 @@
---
mac: "32:A3:94:A0:23:77"

View file

@ -28,8 +28,8 @@ hedgedoc_postgres_password: "{{ vault_hedgedoc_postgres_password }}"
redmine_host_port: 8087 redmine_host_port: 8087
redmine_domain_name: redmine.n39.eu redmine_domain_name: redmine.n39.eu
redmine_image: redmine:5.0.6 redmine_image: redmine:5.0.5
redmine_mysql_image: mysql:8.2 redmine_mysql_image: mysql:8.1
redmine_database: redmine redmine_database: redmine
redmine_database_password: "{{ vault_redmine_database_password }}" redmine_database_password: "{{ vault_redmine_database_password }}"
@ -42,24 +42,24 @@ influxdb_init_password: "{{ vault_influxdb_init_password }}"
jabber_host_port: 8086 jabber_host_port: 8086
prosody_domain_name: jabber.n39.eu prosody_domain_name: jabber.n39.eu
prosody_image: netz39/prosody:0.11 prosody_image: netz39/prosody:0.11
prosody_web_image: joseluisq/static-web-server:2.23 prosody_web_image: joseluisq/static-web-server:2.22
prosody_config_dir: "/etc/prosody" prosody_config_dir: "/etc/prosody"
prosody_data_dir: "{{ data_dir }}/prosody" prosody_data_dir: "{{ data_dir }}/prosody"
uptimekuma_host_port: 8085 uptimekuma_host_port: 8085
uptimekuma_domain_name: uptime.n39.eu uptimekuma_domain_name: uptime.n39.eu
uptimekuma_image: louislam/uptime-kuma:1.23.3 uptimekuma_image: louislam/uptime-kuma:1.23.2
grafana_host_port: 8089 grafana_host_port: 8089
grafana_domain_name: grafana.n39.eu grafana_domain_name: grafana.n39.eu
grafana_image: grafana/grafana:10.2.0 grafana_image: grafana/grafana:10.1.2
grafana_admin_password: "{{ vault_grafana_admin_password }}" grafana_admin_password: "{{ vault_grafana_admin_password }}"
homebox_host_port: 8092 homebox_host_port: 8092
homebox_domain_name: inventory.n39.eu homebox_domain_name: inventory.n39.eu
homebox_image: ghcr.io/hay-kot/homebox:v0.10.1 homebox_image: ghcr.io/hay-kot/homebox:v0.9.2
renovate_image: renovate/renovate:37.36.2 renovate_image: renovate/renovate:36.103.0
renovate_forgejo_pat: "{{ vault_renovate_forgejo_pat }}" renovate_forgejo_pat: "{{ vault_renovate_forgejo_pat }}"
renovate_github_pat: "{{ vault_renovate_github_pat }}" renovate_github_pat: "{{ vault_renovate_github_pat }}"
renovate_git_user: "Renovate Bot <accounts+renovatebot@netz39.de>" renovate_git_user: "Renovate Bot <accounts+renovatebot@netz39.de>"

View file

@ -0,0 +1,4 @@
server_admin: "admin+wittgenstein@netz39.de"
ansible_python_interpreter: /usr/bin/python3
gatekeeper_user: pi
data_dir: "/srv/data"

View file

@ -8,10 +8,10 @@ all:
krypton.n39.eu: krypton.n39.eu:
oganesson.n39.eu: oganesson.n39.eu:
platon.n39.eu: platon.n39.eu:
plumbum.n39.eu:
pottwal.n39.eu: pottwal.n39.eu:
radon.n39.eu: radon.n39.eu:
unicorn.n39.eu: unicorn.n39.eu:
wittgenstein2.n39.eu:
k3s-c1.n39.eu: k3s-c1.n39.eu:
k3s-c2.n39.eu: k3s-c2.n39.eu:
k3s-c3.n39.eu: k3s-c3.n39.eu:
@ -32,7 +32,6 @@ all:
holmium.n39.eu: holmium.n39.eu:
krypton.n39.eu: krypton.n39.eu:
oganesson.n39.eu: oganesson.n39.eu:
plumbum.n39.eu:
pottwal.n39.eu: pottwal.n39.eu:
radon.n39.eu: radon.n39.eu:
unicorn.n39.eu: unicorn.n39.eu:
@ -50,7 +49,6 @@ all:
krypton.n39.eu: krypton.n39.eu:
oganesson.n39.eu: oganesson.n39.eu:
platon.n39.eu: platon.n39.eu:
plumbum.n39.eu:
pottwal.n39.eu: pottwal.n39.eu:
radon.n39.eu: radon.n39.eu:
wittgenstein.n39.eu: wittgenstein.n39.eu:

View file

@ -39,3 +39,6 @@
- name: Hobbes specific setup - name: Hobbes specific setup
import_playbook: host-hobbes.yml import_playbook: host-hobbes.yml
- name: Wittgenstein specific setup
import_playbook: host-wittgenstein.yml

View file

@ -20,6 +20,6 @@ cleanuri_amqp_retrieval: "extractor"
# Docker images # Docker images
cleanuri_image_webui: mrtux/cleanuri-webui:0.2.0 cleanuri_image_webui: mrtux/cleanuri-webui:0.2.0
cleanuri_image_apigateway: mrtux/cleanuri-apigateway:0.3.1 cleanuri_image_apigateway: mrtux/cleanuri-apigateway:0.3.0
cleanuri_image_canonizer: mrtux/cleanuri-canonizer:0.3.1 cleanuri_image_canonizer: mrtux/cleanuri-canonizer:0.3.0
cleanuri_image_extractor: mrtux/cleanuri-extractor:0.3.0 cleanuri_image_extractor: mrtux/cleanuri-extractor:0.3.0