pennestraat-domotica
8 months agoqemu: use empty PLC_IP so we get the stub
Kristof Provost [Sat, 8 Mar 2025 18:09:29 +0000 (19:09 +0100)]
qemu: use empty PLC_IP so we get the stub

8 months agoset per-house passwords for the domotica app
Kristof Provost [Sat, 8 Mar 2025 18:06:58 +0000 (19:06 +0100)]
set per-house passwords for the domotica app

8 months agoqemu config: set merker variables
Kristof Provost [Sat, 8 Mar 2025 17:40:36 +0000 (18:40 +0100)]
qemu config: set merker variables

We don't have a PLC/Logo to talk to, but setting the variables lets the code
run, especially now that 'domotica' creates a stub S7 object to talk to.

8 months ago22a: fix all on/off merker id
Kristof Provost [Sat, 8 Mar 2025 15:33:09 +0000 (16:33 +0100)]
22a: fix all on/off merker id

8 months agoansible: update pennestraat22a settings file
Kristof Provost [Tue, 4 Mar 2025 21:36:19 +0000 (22:36 +0100)]
ansible: update pennestraat22a settings file

This isn't going to be final yet, but this configures the alarm Merkers.
And sets the API token for SMS.

8 months agoansible: disable dnssec validation
Kristof Provost [Sun, 2 Mar 2025 19:10:58 +0000 (20:10 +0100)]
ansible: disable dnssec validation

On at least one internet connection (Proximus DSL) we've seen failures to
resolve kosmos.sigsegv.be. Disabling DNSSec makes it work again (despite dnssec
being correct on the domain).

8 months agoimage: enable keepalives on the reverse ssh tunnel
Kristof Provost [Wed, 26 Feb 2025 20:37:31 +0000 (21:37 +0100)]
image: enable keepalives on the reverse ssh tunnel

We've seen the reverse ssh connection become unusable after some time.
It's assumed this happens because NAT and/or firewall states along the path
time out as there's no traffic. Explicitly enable both SSH and TCP keepalive
mechanisms to avoid this.

8 months agoimage: switch to ZFS
Kristof Provost [Wed, 26 Feb 2025 20:14:23 +0000 (21:14 +0100)]
image: switch to ZFS

Both because ZFS, but also because of worries over file system checks on unclean
shutdown.

8 months agodomotica: disable CSRF checking
Kristof Provost [Mon, 24 Feb 2025 21:49:23 +0000 (22:49 +0100)]
domotica: disable CSRF checking

It didn't work for reasons I've not bothered to debug.

8 months agodomotica: minor progress on configuring the domotica webapp
Kristof Provost [Mon, 24 Feb 2025 21:30:07 +0000 (22:30 +0100)]
domotica: minor progress on configuring the domotica webapp

8 months agoansible: list mac addres for pennestraat20
Kristof Provost [Sat, 22 Feb 2025 12:54:29 +0000 (13:54 +0100)]
ansible: list mac addres for pennestraat20

8 months agoansible: add pennestraat 22
Kristof Provost [Sat, 15 Feb 2025 15:46:44 +0000 (16:46 +0100)]
ansible: add pennestraat 22

8 months agoansible: domotica settings file for 22A
Kristof Provost [Thu, 13 Feb 2025 22:37:24 +0000 (23:37 +0100)]
ansible: domotica settings file for 22A

8 months agoimage: avoid generating mails for the presence script
Kristof Provost [Thu, 13 Feb 2025 20:37:35 +0000 (21:37 +0100)]
image: avoid generating mails for the presence script

None of the output is relevant. Just /dev/null it.

8 months agoimage: improve the autossh behaviour
Kristof Provost [Thu, 13 Feb 2025 20:36:14 +0000 (21:36 +0100)]
image: improve the autossh behaviour

Poll regularly and occasionally automatically reconnect.
We've seen at least some instances of ssh remaining up but the reverse tunnel
becoming unusable. Hopefully this will improve things.
This can be recovered by terminating the ssh process on kosmos, but reconnection
takes a while.

8 months agoansible: fix previous
Kristof Provost [Wed, 12 Feb 2025 08:41:29 +0000 (09:41 +0100)]
ansible: fix previous

User.get() throws an exception if it can't find the user (rather than the much
more sensible option of returning None). Fix the script to account for that.

8 months agoansible: make domotica create user task idempotent
Kristof Provost [Tue, 11 Feb 2025 21:02:26 +0000 (22:02 +0100)]
ansible: make domotica create user task idempotent

Only create the user if it doesn't already exist. We can now re-execute the
playbook.

8 months agoansible: set safe directory on domotica checkout
Kristof Provost [Tue, 11 Feb 2025 09:29:33 +0000 (10:29 +0100)]
ansible: set safe directory on domotica checkout

Otherwise git complains about file ownership (after the www user creates a DB, I
believe) and we can't re-apply the playbook.

8 months agoansible: configure DHCPd for domotica (pennestaat) devices
Kristof Provost [Mon, 10 Feb 2025 22:00:03 +0000 (23:00 +0100)]
ansible: configure DHCPd for domotica (pennestaat) devices

8 months agoansible: improve homeassistant startup script
Kristof Provost [Mon, 10 Feb 2025 21:48:45 +0000 (22:48 +0100)]
ansible: improve homeassistant startup script

Ensure that 'status' and 'stop' actually work.
This is still imperfect because we trust that the existence of the pidfile
matches the existence of the process and that's only usually true.

8 months agofix typos in previous commit
Kristof Provost [Sat, 8 Feb 2025 14:13:42 +0000 (15:13 +0100)]
fix typos in previous commit

8 months agoAdd mac address for pennestraat 22A
Kristof Provost [Sat, 8 Feb 2025 12:16:57 +0000 (13:16 +0100)]
Add mac address for pennestraat 22A

10 months agoimage: update to FreeBSD 14.2
Kristof Provost [Mon, 6 Jan 2025 21:56:36 +0000 (22:56 +0100)]
image: update to FreeBSD 14.2

10 months agoansible: install domotica foo
Kristof Provost [Mon, 6 Jan 2025 21:56:20 +0000 (22:56 +0100)]
ansible: install domotica foo

10 months agoREADME: document how to install routers
Kristof Provost [Mon, 6 Jan 2025 21:55:43 +0000 (22:55 +0100)]
README: document how to install routers

12 months agoAdd domotica main task
Kristof Provost [Mon, 28 Oct 2024 23:04:22 +0000 (00:04 +0100)]
Add domotica main task

12 months agoenable domotica task for phobos
Kristof Provost [Mon, 28 Oct 2024 21:59:52 +0000 (22:59 +0100)]
enable domotica task for phobos

12 months agoFix natalie's domotica settings file name
Kristof Provost [Mon, 28 Oct 2024 21:44:15 +0000 (22:44 +0100)]
Fix natalie's domotica settings file name

12 months agoansible: fix bacula-fd service name
Kristof Provost [Mon, 28 Oct 2024 21:24:37 +0000 (22:24 +0100)]
ansible: fix bacula-fd service name

13 months agoUpdate settings
Kristof Provost [Tue, 1 Oct 2024 21:23:34 +0000 (23:23 +0200)]
Update settings

Rename alarmd for thuis & change natalie's secret.

14 months agoansible: domotica settings files
Kristof Provost [Tue, 3 Sep 2024 20:51:45 +0000 (22:51 +0200)]
ansible: domotica settings files

15 months agoansible: fix more paths in the bacula config (phobos)
Kristof Provost [Mon, 15 Jul 2024 21:40:22 +0000 (23:40 +0200)]
ansible: fix more paths in the bacula config (phobos)

15 months agoansible: fix bacula path (phobos)
Kristof Provost [Mon, 15 Jul 2024 21:31:17 +0000 (23:31 +0200)]
ansible: fix bacula path (phobos)

15 months agoansible: add device-specific pf files
Kristof Provost [Sun, 14 Jul 2024 21:03:48 +0000 (23:03 +0200)]
ansible: add device-specific pf files

We're going to need slightly different rules for different machines, if only for
port forwardings, so split out the pf.conf file.

Just phobos for now, we'll add the iapetus file later.

15 months agoansible: emulate phobos in qemu
Kristof Provost [Sun, 14 Jul 2024 13:21:25 +0000 (15:21 +0200)]
ansible: emulate phobos in qemu

We're working on bringing the mars network to full equivalence to what's now
deployed, so make the qemu host reflect that one for now.

15 months agoansible: add dhcp config for mars network
Kristof Provost [Sun, 14 Jul 2024 13:21:13 +0000 (15:21 +0200)]
ansible: add dhcp config for mars network

15 months agoansible: add dummy keys for qemu nslookup
Kristof Provost [Sun, 14 Jul 2024 12:56:51 +0000 (14:56 +0200)]
ansible: add dummy keys for qemu nslookup

These won't work, but at least the installation task will complete.

16 months agohomeassistant: let ha install pip requirements on startup
Kristof Provost [Tue, 25 Jun 2024 20:57:29 +0000 (22:57 +0200)]
homeassistant: let ha install pip requirements on startup

16 months agohomeassistant: install audio/py-webrtcvad too
Kristof Provost [Tue, 25 Jun 2024 20:57:09 +0000 (22:57 +0200)]
homeassistant: install audio/py-webrtcvad too

Some of our plugins rely on it.

16 months agoimage: include required packages for homeassistant
Kristof Provost [Sun, 16 Jun 2024 18:27:24 +0000 (20:27 +0200)]
image: include required packages for homeassistant

16 months agoimage: update to FreeBSD-14.1
Kristof Provost [Sun, 16 Jun 2024 18:26:56 +0000 (20:26 +0200)]
image: update to FreeBSD-14.1

Also we no longer need to set python to 3.11, that's now default.

16 months agohomassistant: use python virtualenv
Kristof Provost [Sun, 16 Jun 2024 18:26:36 +0000 (20:26 +0200)]
homassistant: use python virtualenv

16 months agohomeassistant: add basic configuration
Kristof Provost [Sun, 16 Jun 2024 18:25:35 +0000 (20:25 +0200)]
homeassistant: add basic configuration

This completes the onboarding process and creates an admin/admin account.

18 months agoautossh: forward the homeassistant port
Kristof Provost [Sun, 5 May 2024 15:57:02 +0000 (17:57 +0200)]
autossh: forward the homeassistant port

18 months agohomeassistant: fix startup script
Kristof Provost [Sun, 5 May 2024 15:56:33 +0000 (17:56 +0200)]
homeassistant: fix startup script

Set the correct moment to start, so we actually start.

18 months agohomeassistant: install dependencies
Kristof Provost [Sun, 5 May 2024 15:56:09 +0000 (17:56 +0200)]
homeassistant: install dependencies

Without these we fail to install a bunch of pip packages at first start.

18 months agoansible: add phobos
Kristof Provost [Thu, 2 May 2024 21:02:32 +0000 (23:02 +0200)]
ansible: add phobos

Add an explicit definition for iapetus (distinct from qemu) as well as the
configuration for phobos.

18 months agoset_hostname: add Johan's device
Kristof Provost [Wed, 1 May 2024 21:02:40 +0000 (23:02 +0200)]
set_hostname: add Johan's device

18 months agoansible: install & configure alarmd on iapetus
Kristof Provost [Tue, 30 Apr 2024 21:05:46 +0000 (23:05 +0200)]
ansible: install & configure alarmd on iapetus

18 months agoansible: fix interface names in pf.conf
Kristof Provost [Tue, 30 Apr 2024 21:05:26 +0000 (23:05 +0200)]
ansible: fix interface names in pf.conf

18 months agoansible: install libs7comm and libs7comm-python on routers too
Kristof Provost [Tue, 30 Apr 2024 21:04:07 +0000 (23:04 +0200)]
ansible: install libs7comm and libs7comm-python on routers too

We'll want it on both router devices, even if it's for slightly different
purposes.

18 months agoansible-pull: rename the task
Kristof Provost [Tue, 30 Apr 2024 21:03:11 +0000 (23:03 +0200)]
ansible-pull: rename the task

We're no longer testing. This task sets up autossh so we can push in everything
else.

18 months agoApply the igb1 address
Kristof Provost [Tue, 30 Apr 2024 08:28:59 +0000 (10:28 +0200)]
Apply the igb1 address

Use a notification handler to actually apply the address (and force it to run
immediately). This fixes the first startup of dhcpd, because dhcpd wants the
relevant IP on the relevant interface before it'll work.

18 months agopull: do not install nginx
Kristof Provost [Mon, 29 Apr 2024 21:50:40 +0000 (23:50 +0200)]
pull: do not install nginx

Don't install nginx from the pull playbook.
Not all systems need nginx, and anyway, the pull playbook really only needs to
ensure we can connect back to the systems.

18 months agoqemu: create igb interfaces
Kristof Provost [Mon, 29 Apr 2024 21:49:34 +0000 (23:49 +0200)]
qemu: create igb interfaces

Bring us a little closer to the real hardware, which makes the configuration for
qemu and apu boards basically identical.

18 months agoAdd dyndns public key too
Kristof Provost [Mon, 29 Apr 2024 21:40:20 +0000 (23:40 +0200)]
Add dyndns public key too

We need both.

18 months agorouter: install & enable isc-dhcpd
Kristof Provost [Mon, 29 Apr 2024 20:36:10 +0000 (22:36 +0200)]
router: install & enable isc-dhcpd

18 months agonsupdate is part of bind-tools
Kristof Provost [Mon, 29 Apr 2024 20:35:40 +0000 (22:35 +0200)]
nsupdate is part of bind-tools

Install the package

18 months agoansible: install bacula-fd
Kristof Provost [Sun, 28 Apr 2024 21:16:11 +0000 (23:16 +0200)]
ansible: install bacula-fd

18 months agoansible: Use a decrypted private key
Kristof Provost [Sun, 28 Apr 2024 21:15:45 +0000 (23:15 +0200)]
ansible: Use a decrypted private key

18 months agoansible: break out ipsec and ntp to separate files
Kristof Provost [Sun, 28 Apr 2024 20:40:53 +0000 (22:40 +0200)]
ansible: break out ipsec and ntp to separate files

18 months agoansible: set up dyndns hooks
Kristof Provost [Sun, 28 Apr 2024 19:45:45 +0000 (21:45 +0200)]
ansible: set up dyndns hooks

18 months agoUse a vault password file
Kristof Provost [Sun, 28 Apr 2024 19:29:07 +0000 (21:29 +0200)]
Use a vault password file

Avoid us having to type the password on every invocation.

While here ensure ipsec is running.

18 months agoIPSec private key
Kristof Provost [Sun, 28 Apr 2024 14:08:09 +0000 (16:08 +0200)]
IPSec private key

Introduce ansible vault encrypted private key, and update the readme file so we
remember to ask for the vault password.

18 months agoIPSec certificates
Kristof Provost [Sun, 28 Apr 2024 11:04:22 +0000 (13:04 +0200)]
IPSec certificates

Install ipsec.conf (iapetus only for now) and certificate files.

18 months agoAdd initial router role
Kristof Provost [Sun, 28 Apr 2024 09:47:59 +0000 (11:47 +0200)]
Add initial router role

Beginnings of ansible foo for iapetus and phobos, although just the qemu one for now.

18 months agoInstall homeassistant 2024.3.3
Kristof Provost [Wed, 17 Apr 2024 20:19:36 +0000 (22:19 +0200)]
Install homeassistant 2024.3.3

18 months agoInstall libs7comm
Kristof Provost [Wed, 17 Apr 2024 17:47:30 +0000 (19:47 +0200)]
Install libs7comm

Split up the tasks into separate yaml files, for easier testing of individual
tasks while we're here.

18 months agoimage: include pip virtualenv
Kristof Provost [Sun, 14 Apr 2024 14:32:59 +0000 (16:32 +0200)]
image: include pip virtualenv

Required to install homeassistant.

18 months agoREADME: document how to ignore ssh host key changes
Kristof Provost [Sun, 14 Apr 2024 14:32:15 +0000 (16:32 +0200)]
README: document how to ignore ssh host key changes

Especially the qemu test env keeps getting reinstalled and thus getting new keys.
There's no point in being bothered by warnings about that.

18 months agoSet HTTP forwarding ports
Kristof Provost [Sun, 14 Apr 2024 14:15:17 +0000 (16:15 +0200)]
Set HTTP forwarding ports

Open a port for HTTP forwarding, so kosmos can terminate https traffic and
forward things to the appropriate devices.

20 months agoimage: install custom make.conf
Kristof Provost [Tue, 5 Mar 2024 21:38:34 +0000 (22:38 +0100)]
image: install custom make.conf

We need to use python3.11, which isn't ports default so tweak the
poudriere ports build to default to the correct python version.

20 months agoansible: install & start homeassistant
Kristof Provost [Tue, 5 Mar 2024 21:38:13 +0000 (22:38 +0100)]
ansible: install & start homeassistant

20 months agopackages: add cmake & py-pip
Kristof Provost [Tue, 5 Mar 2024 19:55:32 +0000 (20:55 +0100)]
packages: add cmake & py-pip

Required to install homeassistant.

20 months agopackages: install rust
Kristof Provost [Mon, 19 Feb 2024 22:53:28 +0000 (23:53 +0100)]
packages: install rust

We need it to install homeassistant. We could also install via ansible,
but we have to build rust anyway as a prerequisite for .. something, so
install it immediately in the image.

20 months agocrontab: avoid generating output for routine checks
Kristof Provost [Mon, 19 Feb 2024 22:52:48 +0000 (23:52 +0100)]
crontab: avoid generating output for routine checks

If autossh is still running we shouldn't generate output, because
otherwise we'll end up creating a mail every 5 minutes.

20 months agoansible: connect via kosmos and the per-host ports there
Kristof Provost [Mon, 19 Feb 2024 21:16:52 +0000 (22:16 +0100)]
ansible: connect via kosmos and the per-host ports there

23 months agobuild: update to FreeBSD 14.0
Kristof Provost [Tue, 5 Dec 2023 20:29:54 +0000 (21:29 +0100)]
build: update to FreeBSD 14.0

23 months agopackages: add helix
Kristof Provost [Tue, 5 Dec 2023 20:29:32 +0000 (21:29 +0100)]
packages: add helix

We may as well include our new favourite editor of the day.

2 years agoautossh: run autossh with a reverse tunnel
Kristof Provost [Wed, 12 Jul 2023 11:08:31 +0000 (13:08 +0200)]
autossh: run autossh with a reverse tunnel

This will be the primary method of connecting to these devices, and will
be the method we use to push ansible configuration.

(We can't just rely on ansible-poll because we may want to include
secrets from ansible-vault)

2 years agoimage: improve ansibleprep run
Kristof Provost [Wed, 12 Jul 2023 11:06:24 +0000 (13:06 +0200)]
image: improve ansibleprep run

Make it more likely we'll call ansible-poll at first boot.
If there's no internet connectivity on first boot we woudln't ansible-
poll until the crontab called it.

Instead we now run ansibleprep every time and exit if our hostname
isn't poudriere-image (i.e. if we've actually run the first ansible-
poll call).

2 years agoansible: renumber & remove poudriere-image from domoticamachines
Kristof Provost [Mon, 10 Jul 2023 21:40:28 +0000 (23:40 +0200)]
ansible: renumber & remove poudriere-image from domoticamachines

Tidy up port numbers.
Also remove poudriere-image from the domoticamachines group. The intent is
to prevent ansible from running configuration we don't need before the
hostname is set.

2 years agoimage: bump image size
Kristof Provost [Mon, 10 Jul 2023 21:29:31 +0000 (23:29 +0200)]
image: bump image size

Increate the initial size of the image, so we can install packages when
running in qemu.

On alix boards we grow to whatever the physical size is, so it won't
affect things there.

2 years agoansible: Configure control ports
Kristof Provost [Mon, 10 Jul 2023 20:24:16 +0000 (22:24 +0200)]
ansible: Configure control ports

Each instance will have its own port to loop back on kosmos.codepro.be.
Assign a unique port to each, and save it in sysrc.

We'll have to script something around autossh, but this is the main new
ansible feature to test.

2 years agopackages: add autossh
Kristof Provost [Sun, 14 May 2023 10:11:44 +0000 (12:11 +0200)]
packages: add autossh

Install autossh so we can set up a reliable reverse tunnel for
management.

2 years agoRename playbook to playbook-pull
Kristof Provost [Sat, 13 May 2023 09:22:19 +0000 (11:22 +0200)]
Rename playbook to playbook-pull

We'll have to push a lot of our configuration, because it's the only way
we'll be able to use ansible-vault (and thus keep secrets secret).

We still want the pull functionality, so we can use that to bootstrap a
way for ansible to connect to the devices. Likely autossh to a known
server with a reverse tunnel, but that'll come in future commits.

2 years agoannounce_presence: look at the correct interface for the host_id
Kristof Provost [Fri, 5 May 2023 12:04:01 +0000 (14:04 +0200)]
announce_presence: look at the correct interface for the host_id

2 years agodomotica: grow the filesystem on first boot
Kristof Provost [Fri, 5 May 2023 12:03:43 +0000 (14:03 +0200)]
domotica: grow the filesystem on first boot

2 years agobuild.sh: multithread compression
Kristof Provost [Fri, 5 May 2023 09:54:33 +0000 (11:54 +0200)]
build.sh: multithread compression

Use xz's multithreaded compression for a significant speedup in build
time.

2 years agoansible: add real names to the inventory
Kristof Provost [Fri, 5 May 2023 09:37:50 +0000 (11:37 +0200)]
ansible: add real names to the inventory

2 years agobuild.sh: Include the domotoca image in the installer so it can be installed
Kristof Provost [Fri, 5 May 2023 09:30:36 +0000 (11:30 +0200)]
build.sh: Include the domotoca image in the installer so it can be installed

2 years agoinstaller: operation installation script
Kristof Provost [Fri, 5 May 2023 09:29:41 +0000 (11:29 +0200)]
installer: operation installation script

Check if the device is the expected PC Engines CPU model, to reduce the
odds that we'll clobber something else.
If everything matches expectations copy the image to the device.

2 years agoansible: Add the mac for the first machine
Kristof Provost [Fri, 5 May 2023 09:29:14 +0000 (11:29 +0200)]
ansible: Add the mac for the first machine

2 years agobuild.sh: exit on error
Kristof Provost [Fri, 5 May 2023 07:55:44 +0000 (09:55 +0200)]
build.sh: exit on error

2 years agoimage: run ansible-poll at first startup
Kristof Provost [Fri, 5 May 2023 07:49:52 +0000 (09:49 +0200)]
image: run ansible-poll at first startup

Ensure we don't have to wait an hour for cron to trigger the first pull.
Immediately start configuring the system at first boot.

We run twice, to make sure we've set the hostname and then applied the
per-host configuration.

2 years agoansible: remove hello world tasks
Kristof Provost [Fri, 5 May 2023 07:49:12 +0000 (09:49 +0200)]
ansible: remove hello world tasks

Those don't do anything, and we already do some vaguely useful things in
the playbook, so there's no need for them any more.

2 years agoansible: add poudriere-image to the inventory list
Kristof Provost [Fri, 5 May 2023 07:38:49 +0000 (09:38 +0200)]
ansible: add poudriere-image to the inventory list

This should cause us to exectute on the intiall install image, setting
the hostname.
Also configure the playbook to only run the change of hostname on the
initiall installation image, so we can skip running that script on
subsequent ansible runs.

2 years agoimage: ansible-pull new configuration once an hour
Kristof Provost [Thu, 4 May 2023 21:39:57 +0000 (23:39 +0200)]
image: ansible-pull new configuration once an hour

2 years agoansible: add the qemu test host to the inventory
Kristof Provost [Thu, 4 May 2023 21:32:53 +0000 (23:32 +0200)]
ansible: add the qemu test host to the inventory

2 years agoansible: set up hostnames based on mac address
Kristof Provost [Thu, 4 May 2023 20:55:49 +0000 (22:55 +0200)]
ansible: set up hostnames based on mac address