todo resolved

This commit is contained in:
2026-04-03 22:07:27 +01:00
parent bc6b27bb2c
commit 168027d893
3 changed files with 27 additions and 9 deletions

4
TODO
View File

@@ -1,4 +0,0 @@
screenrc
apt remove triggerhappy
restic pulls x86 on the pi
install python3-dev for manual pip setup

View File

@@ -1,10 +1,19 @@
#!/bin/bash
{% set arch = 'arm' if salt.grains.get('cpuarch').startswith('arm') else 'amd64' %}
{% if salt.grains.get('cpuarch').startswith('arm') %}
{% set arch = 'arm' %}
{% elif salt.grains.get('cpuarch') == 'aarch64' %}
{% set arch = 'arm64' %}
{% else %}
{% set arch = 'amd64' %}
{% endif %}
{% set restic_version = salt.pillar.get("restic:version") %}
URL="https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_linux_{{ arch }}.bz2"
wget --quiet "${URL}" -O - | bzip2 -cd > /bin/restic.tmp
echo "$URL"
wget --quiet "$URL" -O - | bzip2 -cd > /bin/restic.tmp
if [ $? -eq 0 ]; then
chmod +x /bin/restic.tmp
mv /bin/restic.tmp /bin/restic

View File

@@ -1,21 +1,34 @@
{{ salt.pillar.get("restic:server:mount:path") }}:
mount.mounted:
- device: {{ salt.pillar.get("restic:server:mount:device") | yaml_encode }}
- fstype: {{ salt.pillar.get("restic:server:mount:fstype") | yaml_encode }}
- mkmnt: {{ salt.pillar.get("restic:server:mount:mkmnt", True) | yaml_encode }}
- persist: {{ salt.pillar.get("restic:server:mount:persist", True) | yaml_encode }}
{% for name, minion_id in salt.pillar.get("restic:server:clients", {}).items() %}
restic-{{ name }}:
user.present:
- home: {{ salt.pillar.get("restic:server:mount") }}/{{ name }}
- home: {{ salt.pillar.get("restic:server:mount:path") }}/{{ name }}
- createhome: true
- system: true
- require:
- mount: {{ salt.pillar.get("restic:server:mount:path") }}
{{ salt.pillar.get("restic:server:mount") }}/{{ name }}/.ssh:
{{ salt.pillar.get("restic:server:mount:path") }}/{{ name }}/.ssh:
file.directory:
- user: restic-{{ name }}
- group: restic-{{ name }}
- mode: 700
{{ salt.pillar.get("restic:server:mount") }}/{{ name }}/.ssh/authorized_keys:
- require:
- user: restic-{{ name }}
{{ salt.pillar.get("restic:server:mount:path") }}/{{ name }}/.ssh/authorized_keys:
file.managed:
- user: restic-{{ name }}
- group: restic-{{ name }}
- mode: 400
- contents: {{ salt.mine.get(minion_id, 'root_id_rsa_pub').get(minion_id, "") | yaml_encode }}
- require:
- file: {{ salt.pillar.get("restic:server:mount:path") }}/{{ name }}/.ssh
{% endfor %}
bzip2: