paulbsd-salt/states/clickhouse-backup/install.sls
Paul Lecuq 046de339c8
All checks were successful
continuous-integration/drone/push Build is passing
added clickhouse-backup state
2024-02-07 22:02:04 +01:00

39 lines
1.4 KiB
Plaintext

---
{%- from "clickhouse-backup/map.jinja" import clickhousebackup with context %}
clickhouse-backup-archive-extract:
archive.extracted:
- name: {{ clickhousebackup.release_dir }}/clickhouse-backup-{{ clickhousebackup.version }}
- source: {{ clickhousebackup.mirror }}/v{{ clickhousebackup.version }}/clickhouse-backup-{{ clickhousebackup.os }}-{{ clickhousebackup.arch }}.tar.gz
- enforce_toplevel: false
- options: >
--strip 3
- skip_verify: true
- archive_format: tar
- if_missing: {{ clickhousebackup.release_dir }}/clickhouse-backup-{{ clickhousebackup.version }}/clickhouse-backup
clickhouse-backup-bin-perm:
file.managed:
- name: {{ clickhousebackup.release_dir }}/clickhouse-backup-{{ clickhousebackup.version }}/clickhouse-backup
- user: root
- group: root
- replace: False
- require:
- archive: clickhouse-backup-archive-extract
clickhouse-backup-bin-symlink:
file.symlink:
- name: /usr/local/sbin/clickhouse-backup
- target: {{ clickhousebackup.release_dir }}/clickhouse-backup-{{ clickhousebackup.version }}/clickhouse-backup
- user: root
- group: root
- mode: 0755
- force: true
- require:
- archive: clickhouse-backup-archive-extract
clickhouse-backup-cleanup:
software.cleanup:
- name: clickhouse-backup
- path: {{ clickhousebackup.release_dir }}
- version: "{{ clickhousebackup.version }}"