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
+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