Compare commits
4 commits
master
...
wittgenste
Author | SHA1 | Date | |
---|---|---|---|
5601bd3d06 | |||
0f44eec076 | |||
9aa0e6a871 | |||
6c5260e5c1 |
16 changed files with 188 additions and 38 deletions
|
@ -1,7 +1,5 @@
|
|||
#!/bin/sh
|
||||
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'
|
||||
sudo modprobe i2c_dev
|
||||
sudo modprobe i2c_bcm2708
|
||||
|
|
19
files/wittgenstein/reboot.sh
Executable file
19
files/wittgenstein/reboot.sh
Executable 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
7
files/wittgenstein/unstuck.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
logger -t unstuck "unstuck $(date)"
|
||||
|
||||
killall tmux
|
||||
|
||||
sleep 1
|
||||
/home/pi/reboot.sh
|
|
@ -61,16 +61,6 @@ users:
|
|||
ssh_pub:
|
||||
- !unsafe >
|
||||
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
|
||||
docker: yes
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
- name: Ensure container for entities validation service is running
|
||||
docker_container:
|
||||
name: entities_validation_svc
|
||||
image: netz39/entities_validation_svc:v1.0.1
|
||||
image: netz39/entities_validation_svc:v1.0.0
|
||||
pull: true
|
||||
state: started
|
||||
detach: yes
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
- name: Ensure shlink database container is running
|
||||
docker_container:
|
||||
name: shlinkdb
|
||||
image: postgres:16.3-alpine
|
||||
image: postgres:16.2-alpine
|
||||
pull: true
|
||||
state: started
|
||||
restart_policy: unless-stopped
|
||||
|
@ -269,8 +269,6 @@
|
|||
- "127.0.0.1:{{ jabber_host_port }}:80"
|
||||
volumes:
|
||||
- "{{ prosody_data_dir }}/var/www:/public:ro"
|
||||
tags:
|
||||
- prosody-web
|
||||
|
||||
- name: Setup proxy site {{ prosody_domain_name }}
|
||||
# point to static website for now
|
||||
|
@ -279,8 +277,6 @@
|
|||
vars:
|
||||
site_name: "{{ prosody_domain_name }}"
|
||||
proxy_port: "{{ jabber_host_port }}"
|
||||
tags:
|
||||
- prosody-web
|
||||
|
||||
- name: Check if hedgedoc data dir exists
|
||||
ansible.builtin.stat:
|
||||
|
@ -454,7 +450,6 @@
|
|||
MYSQL_DATABASE: "{{ redmine_database }}"
|
||||
volumes:
|
||||
- "{{ data_dir }}/redmine/mysql:/var/lib/mysql"
|
||||
- "{{ data_dir }}/redmine/mysql-config:/etc/mysql/conf.d"
|
||||
networks:
|
||||
- name: redminenet
|
||||
tags:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
nodered_image: nodered/node-red:3.0.1-1-18
|
||||
nodered_data: "{{ data_dir }}/nodered"
|
||||
|
||||
rabbitmq_image: bitnami/rabbitmq:3.13.6
|
||||
rabbitmq_image: bitnami/rabbitmq:3.12.13
|
||||
rabbitmq_data: "{{ data_dir }}/rabbitmq"
|
||||
|
||||
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
|
||||
docker_container:
|
||||
name: brotherql-web
|
||||
image: dersimn/brother_ql_web:2.1.9-alpine
|
||||
image: dersimn/brother_ql_web:2.1.7-alpine
|
||||
pull: true
|
||||
restart_policy: unless-stopped
|
||||
state: started
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
dokuwiki_port: 9005
|
||||
# This container is pinned, because there are issues
|
||||
# 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
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
- name: Setup the docker container for unifi-controller
|
||||
docker_container:
|
||||
name: unifi-controller
|
||||
image: jacobalberty/unifi:v8.1.113
|
||||
image: jacobalberty/unifi:v8.0.28
|
||||
state: started
|
||||
restart_policy: unless-stopped
|
||||
container_default_behavior: no_defaults
|
||||
|
|
133
host-wittgenstein.yml
Normal file
133
host-wittgenstein.yml
Normal 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:
|
|
@ -12,24 +12,24 @@ cleanuri_amqp_vhost: "/cleanuri"
|
|||
forgejo_host_port: 9091
|
||||
forgejo_ssh_port: 2222
|
||||
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_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_postgres_password: "{{ vault_shlink_postgres_password }}"
|
||||
|
||||
hedgedoc_host_port: 8084
|
||||
hedgedoc_domain_name: pad.n39.eu
|
||||
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 }}"
|
||||
|
||||
redmine_host_port: 8087
|
||||
redmine_domain_name: redmine.n39.eu
|
||||
redmine_image: redmine:5.1.3
|
||||
redmine_mysql_image: mysql:8.4
|
||||
redmine_image: redmine:5.1.1
|
||||
redmine_mysql_image: mysql:8.3
|
||||
redmine_database: redmine
|
||||
redmine_database_password: "{{ vault_redmine_database_password }}"
|
||||
|
||||
|
@ -42,24 +42,24 @@ influxdb_init_password: "{{ vault_influxdb_init_password }}"
|
|||
jabber_host_port: 8086
|
||||
prosody_domain_name: jabber.n39.eu
|
||||
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_data_dir: "{{ data_dir }}/prosody"
|
||||
|
||||
uptimekuma_host_port: 8085
|
||||
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_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 }}"
|
||||
|
||||
homebox_host_port: 8092
|
||||
homebox_domain_name: inventory.n39.eu
|
||||
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_github_pat: "{{ vault_renovate_github_pat }}"
|
||||
renovate_git_user: "Renovate Bot <accounts+renovatebot@netz39.de>"
|
4
host_vars/wittgenstein2.n39.eu/vars.yml
Normal file
4
host_vars/wittgenstein2.n39.eu/vars.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
server_admin: "admin+wittgenstein@netz39.de"
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
gatekeeper_user: pi
|
||||
data_dir: "/srv/data"
|
|
@ -12,6 +12,7 @@ all:
|
|||
pottwal.n39.eu:
|
||||
radon.n39.eu:
|
||||
unicorn.n39.eu:
|
||||
wittgenstein2.n39.eu:
|
||||
k3s-c1.n39.eu:
|
||||
k3s-c2.n39.eu:
|
||||
k3s-c3.n39.eu:
|
||||
|
|
3
main.yml
3
main.yml
|
@ -37,6 +37,9 @@
|
|||
- name: Holmium specific setup
|
||||
import_playbook: host-holmium.yml
|
||||
|
||||
- name: Wittgenstein specific setup
|
||||
import_playbook: host-wittgenstein.yml
|
||||
|
||||
- name: Hobbes specific setup
|
||||
import_playbook: host-hobbes.yml
|
||||
|
||||
|
|
|
@ -15,4 +15,4 @@ roles:
|
|||
|
||||
collections:
|
||||
- name: community.grafana
|
||||
version: 1.9.1
|
||||
version: 1.8.0
|
||||
|
|
|
@ -19,7 +19,7 @@ cleanuri_amqp_canonizer: "canonizer"
|
|||
cleanuri_amqp_retrieval: "extractor"
|
||||
|
||||
# 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_canonizer: mrtux/cleanuri-canonizer:0.5.0
|
||||
cleanuri_image_extractor: mrtux/cleanuri-extractor:0.5.0
|
||||
cleanuri_image_canonizer: mrtux/cleanuri-canonizer:0.4.0
|
||||
cleanuri_image_extractor: mrtux/cleanuri-extractor:0.4.0
|
||||
|
|
Loading…
Reference in a new issue