pennestraat-domotica
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

2 years agoimage: rename usb to installer
Kristof Provost [Wed, 3 May 2023 20:36:39 +0000 (22:36 +0200)]
image: rename usb to installer

We create two images:
 - installer
   Intended to be flashed to a USB stick, to automagically image a
   domotica device
 - domotica
   The image to run on the alix boards

2 years agoansible: enable & start nginx
Kristof Provost [Wed, 3 May 2023 20:27:59 +0000 (22:27 +0200)]
ansible: enable & start nginx

2 years agoansible: first playbook
Kristof Provost [Wed, 3 May 2023 20:19:21 +0000 (22:19 +0200)]
ansible: first playbook

Install nginx, because we'll need something to serve web foo.

2 years agoansible: demo inventory
Kristof Provost [Wed, 3 May 2023 20:04:47 +0000 (22:04 +0200)]
ansible: demo inventory

2 years agoreadme: document how to get qemu to do networking
Kristof Provost [Wed, 3 May 2023 20:02:24 +0000 (22:02 +0200)]
readme: document how to get qemu to do networking

2 years agoInitial overlay for domotica machines
Kristof Provost [Wed, 3 May 2023 20:01:15 +0000 (22:01 +0200)]
Initial overlay for domotica machines

* Console over serial port
* set up 'kp' user & sudo
* crontab presence announcement to sigsegv.be with mac address
* ssh-able as kp

2 years agopackages: enough to install ansible
Kristof Provost [Wed, 3 May 2023 17:28:49 +0000 (19:28 +0200)]
packages: enough to install ansible

So we can play with ansible-pull

2 years agoUse the serial port for output
Kristof Provost [Wed, 3 May 2023 15:24:40 +0000 (17:24 +0200)]
Use the serial port for output

Also update the qemu hint to get the serial output on the console.

2 years agobuild: reduce USB image size
Kristof Provost [Tue, 2 May 2023 21:41:56 +0000 (23:41 +0200)]
build: reduce USB image size

There's no need for a lot of extra space. Enough to contain an extra
image, and that'll do it.

2 years agoInitial USB overlay
Kristof Provost [Tue, 2 May 2023 21:41:32 +0000 (23:41 +0200)]
Initial USB overlay

2 years agopackages: install bsddialog
Kristof Provost [Tue, 2 May 2023 21:33:55 +0000 (23:33 +0200)]
packages: install bsddialog

That's part of base in 14, but we're not going to arse around with
current for this. Just install the port.

2 years agoInitial commit
Kristof Provost [Tue, 2 May 2023 21:20:47 +0000 (23:20 +0200)]
Initial commit