Compare commits

..

4 commits

16 changed files with 188 additions and 38 deletions

View file

@ -1,13 +1,11 @@
#!/bin/sh #!/bin/sh
PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games' PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games'
echo 'set PCM volume'
sudo amixer set "PCM" "70%"
echo 'start i2c-foo' echo 'start i2c-foo'
sudo modprobe i2c_dev sudo modprobe i2c_dev
sudo modprobe i2c_bcm2708 sudo modprobe i2c_bcm2708
echo 'starting log' echo 'starting log'
tmux new-session -s status -d 'sudo less /var/log/shuttercontrol.log' tmux new-session -s status -d 'sudo less /var/log/shuttercontrol.log'
cd /home/pi/netz39_rollladensteuerung/raspberry/shuttercontrol cd /home/pi/netz39_rollladensteuerung/raspberry/shuttercontrol
echo 'switch-on.sh' echo 'switch-on.sh'
../switch-on.sh ../switch-on.sh
cd /home/pi cd /home/pi

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

@ -61,16 +61,6 @@ users:
ssh_pub: ssh_pub:
- !unsafe > - !unsafe >
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILKhKHCPibswu2p6UQHKsBSqGaXzMFM+oMX0XEWsxCIc timo@Space-Lap ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILKhKHCPibswu2p6UQHKsBSqGaXzMFM+oMX0XEWsxCIc timo@Space-Lap
- !unsafe >
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMJoS7nsLLzSAsZA4us2/7JaQhgRjj/BY+LOpDQnfy8u timo@mac
sudo: yes
docker: yes
- logname: "JensWH"
viewname: "Jens Winter-Hübenthal"
email: "jens.winter@gmail.com"
ssh_pub:
- !unsafe >
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIII4FS2sROKs2nIW8uzDuWmj8q127UoljtkVMthY8g// jens@work-lenovo
sudo: yes sudo: yes
docker: yes docker: yes

View file

@ -116,7 +116,7 @@
- name: Ensure container for entities validation service is running - name: Ensure container for entities validation service is running
docker_container: docker_container:
name: entities_validation_svc name: entities_validation_svc
image: netz39/entities_validation_svc:v1.0.1 image: netz39/entities_validation_svc:v1.0.0
pull: true pull: true
state: started state: started
detach: yes detach: yes

View file

@ -117,7 +117,7 @@
- name: Ensure shlink database container is running - name: Ensure shlink database container is running
docker_container: docker_container:
name: shlinkdb name: shlinkdb
image: postgres:16.3-alpine image: postgres:16.2-alpine
pull: true pull: true
state: started state: started
restart_policy: unless-stopped restart_policy: unless-stopped
@ -269,8 +269,6 @@
- "127.0.0.1:{{ jabber_host_port }}:80" - "127.0.0.1:{{ jabber_host_port }}:80"
volumes: volumes:
- "{{ prosody_data_dir }}/var/www:/public:ro" - "{{ prosody_data_dir }}/var/www:/public:ro"
tags:
- prosody-web
- name: Setup proxy site {{ prosody_domain_name }} - name: Setup proxy site {{ prosody_domain_name }}
# point to static website for now # point to static website for now
@ -279,8 +277,6 @@
vars: vars:
site_name: "{{ prosody_domain_name }}" site_name: "{{ prosody_domain_name }}"
proxy_port: "{{ jabber_host_port }}" proxy_port: "{{ jabber_host_port }}"
tags:
- prosody-web
- name: Check if hedgedoc data dir exists - name: Check if hedgedoc data dir exists
ansible.builtin.stat: ansible.builtin.stat:
@ -454,7 +450,6 @@
MYSQL_DATABASE: "{{ redmine_database }}" MYSQL_DATABASE: "{{ redmine_database }}"
volumes: volumes:
- "{{ data_dir }}/redmine/mysql:/var/lib/mysql" - "{{ data_dir }}/redmine/mysql:/var/lib/mysql"
- "{{ data_dir }}/redmine/mysql-config:/etc/mysql/conf.d"
networks: networks:
- name: redminenet - name: redminenet
tags: tags:

View file

@ -13,7 +13,7 @@
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.13.6 rabbitmq_image: bitnami/rabbitmq:3.12.13
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
@ -187,7 +187,7 @@
- name: Setup docker container for BrotherQL Web UI printer - name: Setup docker container for BrotherQL Web UI printer
docker_container: docker_container:
name: brotherql-web name: brotherql-web
image: dersimn/brother_ql_web:2.1.9-alpine image: dersimn/brother_ql_web:2.1.7-alpine
pull: true pull: true
restart_policy: unless-stopped restart_policy: unless-stopped
state: started state: started

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:20240206.1.0 dokuwiki_image: bitnami/dokuwiki:20230404@sha256:91dbc4ab1759305309e23e60fe704faf7b980a3ec659e552b4cb9ce4393bcd75
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:v8.1.113 image: jacobalberty/unifi:v8.0.28
state: started state: started
restart_policy: unless-stopped restart_policy: unless-stopped
container_default_behavior: no_defaults container_default_behavior: no_defaults

133
host-wittgenstein.yml Normal file
View file

@ -0,0 +1,133 @@
---
- 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: Copy wiringPi library deb
# WiringPi needs to be installed, but that library seems to be
# obsolete. Download seems to be obsolete, too, so we keep it in
# the Ansible repo for now.
ansible.builtin.copy:
src: files/wiringpi-latest.deb
dest: "/home/{{ gatekeeper_user }}/wiringpi-latest.deb"
owner: "{{ gatekeeper_user }}"
group: "{{ gatekeeper_user }}"
mode: "0644"
register: wiringPi_copy
- name: Install wiringPi library # noqa 503
ansible.builtin.apt:
state: present
deb: "/home/{{ gatekeeper_user }}/wiringpi-latest.deb"
when: wiringPi_copy.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

@ -12,24 +12,24 @@ cleanuri_amqp_vhost: "/cleanuri"
forgejo_host_port: 9091 forgejo_host_port: 9091
forgejo_ssh_port: 2222 forgejo_ssh_port: 2222
forgejo_domain_name: git.n39.eu forgejo_domain_name: git.n39.eu
forgejo_image: codeberg.org/forgejo/forgejo:1.21.11-0 forgejo_image: codeberg.org/forgejo/forgejo:1.21.6-0
shlink_host_port: 8083 shlink_host_port: 8083
shlink_domain_name: sl.n39.eu shlink_domain_name: sl.n39.eu
shlink_image: shlinkio/shlink:4.1.1 shlink_image: shlinkio/shlink:3.7.3
shlink_initial_api_key: "{{ vault_shlink_initial_api_key }}" shlink_initial_api_key: "{{ vault_shlink_initial_api_key }}"
shlink_postgres_password: "{{ vault_shlink_postgres_password }}" shlink_postgres_password: "{{ vault_shlink_postgres_password }}"
hedgedoc_host_port: 8084 hedgedoc_host_port: 8084
hedgedoc_domain_name: pad.n39.eu hedgedoc_domain_name: pad.n39.eu
hedgedoc_image: quay.io/hedgedoc/hedgedoc:1.9.9 hedgedoc_image: quay.io/hedgedoc/hedgedoc:1.9.9
hedgedoc_db_image: postgres:16.3-alpine hedgedoc_db_image: postgres:16.2-alpine
hedgedoc_postgres_password: "{{ vault_hedgedoc_postgres_password }}" 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.1.3 redmine_image: redmine:5.1.1
redmine_mysql_image: mysql:8.4 redmine_mysql_image: mysql:8.3
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.32 prosody_web_image: joseluisq/static-web-server:2.27
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.13 uptimekuma_image: louislam/uptime-kuma:1.23.11
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.4.5 grafana_image: grafana/grafana:10.3.3
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.3 homebox_image: ghcr.io/hay-kot/homebox:v0.10.3
renovate_image: renovate/renovate:38.17.1 renovate_image: renovate/renovate:37.198.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

@ -12,6 +12,7 @@ all:
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:

View file

@ -37,6 +37,9 @@
- name: Holmium specific setup - name: Holmium specific setup
import_playbook: host-holmium.yml import_playbook: host-holmium.yml
- name: Wittgenstein specific setup
import_playbook: host-wittgenstein.yml
- name: Hobbes specific setup - name: Hobbes specific setup
import_playbook: host-hobbes.yml import_playbook: host-hobbes.yml

View file

@ -15,4 +15,4 @@ roles:
collections: collections:
- name: community.grafana - name: community.grafana
version: 1.9.1 version: 1.8.0

View file

@ -19,7 +19,7 @@ cleanuri_amqp_canonizer: "canonizer"
cleanuri_amqp_retrieval: "extractor" cleanuri_amqp_retrieval: "extractor"
# Docker images # Docker images
cleanuri_image_webui: mrtux/cleanuri-webui:0.2.1 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.1
cleanuri_image_canonizer: mrtux/cleanuri-canonizer:0.5.0 cleanuri_image_canonizer: mrtux/cleanuri-canonizer:0.4.0
cleanuri_image_extractor: mrtux/cleanuri-extractor:0.5.0 cleanuri_image_extractor: mrtux/cleanuri-extractor:0.4.0