40 lines
1.2 KiB
Plaintext
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 }}"
|