Finish dm-edworth bootstrap: fix Tailscale install, add system-layout meshcore_capture support

- base: Tailscale's per-codename .nosetup.sh install scripts are gone
  (404); switch to the universal tailscale.com/install.sh, and split
  install/enable (always) from auth (only when a key is given) so a
  node without an authkey still gets Tailscale installed, just not
  authenticated.
- meshcore_capture: the current upstream installer (v2.0.0+, what a
  fresh install now produces) uses a completely different layout than
  dm-baldock/dm-ashwell's older flat ~/.meshcore-packet-capture setup —
  dedicated system user, /opt + /etc/meshcore-packet-capture,
  config.d/*.toml, meshcore-packet-capture.service. Added
  meshcore_capture_layout (system/legacy) so the role targets the right
  paths/service name per host without touching the two working legacy
  nodes. New 99-user.toml.j2 replicates the old MQTT broker coverage
  (letsmesh us/eu, meshrank, ukmesh, meshmapper) in the new config.d
  override format.
- dm-edworth: fill in serial_port now that the MeshCore device is
  connected; confirmed running and publishing to all 5 brokers.
- README: fix broken list formatting, document the installer's
  required manual step and why.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-07-06 22:39:08 +01:00
co-authored by Claude Sonnet 5
parent 77562b1591
commit 1121835678
9 changed files with 176 additions and 22 deletions
+4 -7
View File
@@ -26,19 +26,17 @@
mode: "0644"
become: true
- name: Add Tailscale apt signing key
- name: Download Tailscale install script
get_url:
url: https://pkgs.tailscale.com/stable/debian/bookworm.nosetup.sh
dest: /tmp/tailscale-setup.sh
url: https://tailscale.com/install.sh
dest: /tmp/tailscale-install.sh
mode: "0755"
when: tailscale_auth_key != ""
- name: Run Tailscale install script
shell: sh /tmp/tailscale-setup.sh
shell: sh /tmp/tailscale-install.sh
args:
creates: /usr/bin/tailscale
become: true
when: tailscale_auth_key != ""
- name: Enable and start tailscaled
systemd:
@@ -46,7 +44,6 @@
enabled: true
state: started
become: true
when: tailscale_auth_key != ""
- name: Authenticate Tailscale
shell: tailscale up --authkey {{ tailscale_auth_key }}
@@ -1,6 +1,6 @@
---
- name: restart meshcore-capture
systemd:
name: meshcore-capture
name: "{{ 'meshcore-capture' if meshcore_capture_layout == 'legacy' else 'meshcore-packet-capture' }}"
state: restarted
become: true
+42 -6
View File
@@ -1,23 +1,54 @@
---
# This is a genuine first-run interactive installer (asks for service
# account, install method, IATA/broker config) with no real non-interactive
# path for a fresh install — its own --update flag only changes behavior
# when an install already exists. So: run it manually once per node,
# answering its ~3 prompts (see README), then ansible's `creates:` guard
# skips it forever after. Do NOT try to script answers into it — it insists
# on a real controlling tty and hangs waiting for one over plain SSH/ansible.
#
# meshcore_capture_layout distinguishes two generations of this upstream
# installer:
# system (default) — install method 1, current (v2.0.0+) upstream default.
# Dedicated meshcore-capture system user, /opt + /etc/meshcore-packet-capture,
# config.d/*.toml, service meshcore-packet-capture.service.
# legacy — what dm-baldock/dm-ashwell were set up with (older installer):
# flat ~/.meshcore-packet-capture, .env.local, service meshcore-capture.service.
# Kept only so this role stays a no-op/safe on those two nodes; new nodes
# should use "system".
- name: Run meshcore-packet-capture install script
shell: |
bash <(curl -fsSL https://raw.githubusercontent.com/agessaman/meshcore-packet-capture/main/install.sh)
args:
executable: /bin/bash
creates: /etc/systemd/system/meshcore-capture.service
become: false
creates: >-
{{ '/etc/systemd/system/meshcore-capture.service' if meshcore_capture_layout == 'legacy'
else '/etc/systemd/system/meshcore-packet-capture.service' }}
become: true
- name: Write .env.local config
- name: Write .env.local config (legacy layout)
template:
src: env.local.j2
dest: "{{ ansible_env.HOME }}/.meshcore-packet-capture/.env.local"
mode: "0640"
become: false
when: meshcore_capture_layout == 'legacy'
notify: restart meshcore-capture
- name: Write user config overrides (system layout)
template:
src: 99-user.toml.j2
dest: /etc/meshcore-packet-capture/config.d/99-user.toml
owner: root
group: meshcore-capture
mode: "0640"
become: true
when: meshcore_capture_layout != 'legacy'
notify: restart meshcore-capture
- name: Enable and start meshcore-capture service
systemd:
name: meshcore-capture
name: "{{ 'meshcore-capture' if meshcore_capture_layout == 'legacy' else 'meshcore-packet-capture' }}"
enabled: true
state: started
daemon_reload: true
@@ -25,14 +56,19 @@
- name: Deploy meshcore-capture-update script
copy:
content: "#!/usr/bin/env bash\nbash <(curl -fsSL https://raw.githubusercontent.com/agessaman/meshcore-packet-capture/main/install.sh)\n"
content: >-
#!/usr/bin/env bash
bash <(curl -fsSL https://raw.githubusercontent.com/agessaman/meshcore-packet-capture/main/install.sh){{ ' --update' if meshcore_capture_layout != 'legacy' else '' }}
dest: "{{ ansible_env.HOME }}/meshcore-capture-update.sh"
mode: "0755"
become: false
- name: Deploy meshcore-capture-logs script
copy:
content: "#!/usr/bin/env bash\nsudo journalctl -u meshcore-capture -f\n"
content: |
#!/usr/bin/env bash
sudo journalctl -u {{ 'meshcore-capture' if meshcore_capture_layout == 'legacy' else 'meshcore-packet-capture' }} -f
dest: "{{ ansible_env.HOME }}/meshcore-capture-logs.sh"
mode: "0755"
become: false
@@ -0,0 +1,97 @@
# MeshCore Packet Capture - user overrides
# Managed by Ansible - local changes will be overwritten on next playbook run
#
# [[broker]] tables merge by name across config.d/*.toml, so the letsmesh-us
# and letsmesh-eu entries below only add owner identity to the connection
# details already installed as config.d/10-letsmesh.toml.
[general]
iata = "{{ packetcapture_iata }}"
log_level = "{{ packetcapture_log_level }}"
[update]
repo = "{{ packetcapture_update_repo }}"
branch = "{{ packetcapture_update_branch }}"
[serial]
ports = ["{{ serial_port }}"]
[capture]
connection_type = "serial"
advert_interval_hours = {{ packetcapture_advert_interval_hours }}
owner_public_key = "{{ packetcapture_owner_public_key }}"
owner_email = "{{ packetcapture_owner_email }}"
[[broker]]
name = "letsmesh-us"
[broker.auth]
owner = "{{ packetcapture_owner_public_key }}"
email = "{{ packetcapture_owner_email }}"
[[broker]]
name = "letsmesh-eu"
[broker.auth]
owner = "{{ packetcapture_owner_public_key }}"
email = "{{ packetcapture_owner_email }}"
# MeshRank
[[broker]]
name = "meshrank"
enabled = true
server = "meshrank.net"
port = 8883
transport = "tcp"
qos = 0
retain = false
[broker.tls]
enabled = true
verify = true
[broker.auth]
method = "none"
topic_token = "{{ mqtt_meshrank_token }}"
[broker.topics]
packets = "meshrank/uplink/{TOKEN}/{PUBLIC_KEY}/packets"
status = "meshrank/uplink/{TOKEN}/{PUBLIC_KEY}/status"
# UKMesh (custom broker, no upstream preset)
[[broker]]
name = "ukmesh"
enabled = true
server = "mqtt.ukmesh.com"
port = 443
transport = "websockets"
qos = 0
retain = false
[broker.tls]
enabled = true
verify = true
[broker.auth]
method = "password"
username = "{{ mqtt_ukmesh_username }}"
password = "{{ mqtt_ukmesh_password }}"
# MeshMapper
[[broker]]
name = "meshmapper"
enabled = true
server = "mqtt.meshmapper.net"
port = 443
transport = "websockets"
keepalive = 55
qos = 0
retain = true
[broker.tls]
enabled = true
verify = true
[broker.auth]
method = "token"
audience = "mqtt.meshmapper.net"