diff --git a/tasks.py b/tasks.py index 6cb9218..c71b980 100644 --- a/tasks.py +++ b/tasks.py @@ -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=""): """