paulbsd-salt/states/kopia/install.sls
Paul Lecuq 74584c5a2b
All checks were successful
continuous-integration/drone/push Build is passing
updated kopia state
2023-12-04 22:33:51 +01:00

40 lines
1.2 KiB
Plaintext

---
{%- from "kopia/map.jinja" import kopia with context %}
{% set archive_exclude_dir = './kopia-' + kopia.version + '-' + kopia.os + '-' + kopia.arch %}
kopia-archive-extract:
archive.extracted:
- name: {{ kopia.release_dir }}/kopia-{{ kopia.version }}
- source: {{ kopia.mirror }}/v{{ kopia.version }}/kopia-{{ kopia.version }}-{{ kopia.os }}-{{ kopia.arch }}.tar.gz
- enforce_toplevel: false
- options: >
--transform 's|^\{{ archive_exclude_dir }}|/|g'
--transform 's|LICENSE||g'
--transform 's|README.md||g'
--strip 1
- skip_verify: true
- archive_format: tar
- if_missing: {{ kopia.release_dir }}/kopia-{{ kopia.version }}/kopia
kopia-bin-perm:
file.managed:
- name: {{ kopia.release_dir }}/kopia-{{ kopia.version }}/kopia
- user: root
- group: root
- replace: False
- require:
- archive: kopia-archive-extract
kopia-bin-symlink:
file.symlink:
- name: /usr/local/bin/kopia
- target: {{ kopia.release_dir }}/kopia-{{ kopia.version }}/kopia
- force: true
- require:
- archive: kopia-archive-extract
kopia-cleanup:
software.cleanup:
- name: kopia
- path: {{ kopia.release_dir }}
- version: "{{ kopia.version }}"