add task to re-encrypt files

This commit is contained in:
Jörg Thalheim 2022-10-25 09:55:14 +02:00
parent cbbb8d5af3
commit 1b593f6e74

View file

@ -89,6 +89,26 @@ def _format_disks(host: DeployHost, devices: List[str]) -> None:
host.run(f"mount -t ext4 /dev/md127 /mnt/boot")
@task
def update_sops_files(c):
"""
Update all sops yaml and json files according to .sops.yaml rules
"""
c.run(
"""
find . \
-not -path "./.github/*" \
-not -path "./.mergify.yml" \
-not -path "./_config.yml" \
-type f \
\( -iname '*.enc.json' -o -iname '*.yaml' \) \
-print0 | \
xargs -0 -n1 sops updatekeys --yes
"""
)
@task
def format_disks(c, hosts="", disks=""):
"""