1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic_archiver.git synced 2024-08-16 10:09:49 +02:00

Simplify restic archive

This commit is contained in:
L3D 2020-12-07 17:47:00 +01:00 committed by Lilian Roller
parent 04b8fa7994
commit acbd9f0a70
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
7 changed files with 4 additions and 181 deletions

View file

@ -1,59 +0,0 @@
{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]
{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}
{{- if .MergeCommits -}}
### Pull Requests
{{ range .MergeCommits -}}
- {{ .Header }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
## History
For versions before 0.2.9, see [HISTORY.md](HISTORY.md)
{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}

View file

@ -1,31 +0,0 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/syntro-opensource/ansible.silverstripe
options:
commits:
filters:
Type:
- add
- fix
- change
- remove
- deprecate
- Bump
commit_groups:
title_maps:
add: 🍰 Added
fix: 🐞 Fixed
change: 🔧 Changed
deprecate: 💀 Deprecated
remove: 🗑 Removed
Bump: 🧬 Dependencies
header:
pattern: "^(\\w*)\\:?\\s(.*)$"
pattern_maps:
- Type
- Subject
notes:
keywords:
- BREAKING CHANGE

View file

@ -1,8 +1,5 @@
---
# defaults file for skeleton
restic_url: '{{ restic_url_default }}'
restic_version: '0.11.0'
restic_download_path: '/opt/restic'
restic_install_path: '/usr/bin'
restic_script_dir: '~/restic'
restic_repos: {}

View file

@ -1,33 +1,19 @@
---
galaxy_info:
role_name: restic
author: Matthias Leutenegger
author: L3D
description: Role to deploy restic and setup backups.
# company:
license: MIT
min_ansible_version: 2.8
platforms:
- name: EL
versions:
- 6
- 7
- name: Fedora
versions:
- 29
- name: Ubuntu
versions:
- bionic
- cosmic
- name: Debian
versions:
- jessie
- stretch
- buster
# - name: Windows
# versions:
# - all
galaxy_tags:
- backup
- archive
- delete
- restic
dependencies: []

View file

@ -31,42 +31,3 @@
owner: '{{ restic_dir_owner }}'
group: '{{ restic_dir_group }}'
with_items: '{{ restic_create_paths }}'
- name: Check if downloaded binary is present
stat:
path: '{{ restic_download_path }}/bin/restic-{{ restic_version }}'
register: restic_executable
- name: Check if installed binary is present
stat:
path: '{{ restic_install_path }}/restic'
register: restic_installed
- name: Install restic
include: 'install.yml'
when: not restic_executable.stat.exists or not restic_installed.stat.exists
- name: Configure restic
include: 'configure.yml'
- name: include distribution tasks
include_tasks: '{{ loop_distribution }}'
with_first_found:
- files:
- '{{ distribution }}-{{ distribution_version }}.yml'
- '{{ distribution }}-{{ distribution_major_version }}.yml'
- '{{ distribution }}.yml'
- '{{ ansible_os_family }}.yml'
- '{{ ansible_system }}.yml'
- 'defaults.yml'
paths:
- 'distribution'
loop_control:
loop_var: loop_distribution
vars:
distribution: '{{ ansible_distribution }}'
distribution_version: '{{ ansible_distribution_version }}'
distribution_major_version: '{{ ansible_distribution_major_version }}'
tags:
- configuration
- packages

View file

@ -89,25 +89,4 @@ set -euxo pipefail
{#
Define backup commands
#}
if [[ -z ${CRON+x} ]]; then
MODE_TAG="--tag manual"
else
MODE_TAG="--tag cron"
fi
{% if item.stdin is defined and item.stdin == true %}
# {{ item.stdin_cmd }} | {{ restic_install_path }}/restic backup \
# --stdin $MODE_TAG \
# {{ tags(item.tags) }} \
# {{ stdin_filename(item.stdin_filename) }} \
# {% if item.exclude is defined %}{{ exclude(item.exclude) }}{% endif %} \
# $@
{% else %}
# {{ restic_install_path }}/restic backup $BACKUP_SOURCE $MODE_TAG \
# {{ tags(item.tags) }} \
# {% if item.exclude is defined %}{{ exclude(item.exclude) }}{% endif %} \
# $@
{% endif %}
{#
Define stdin forget commands
#}
{{ restic_install_path }}/restic forget {{ retention_pattern(item) }} {% if item.prune is defined and item.prune == true %}--prune{% endif %}

View file

@ -10,13 +10,3 @@ _platform_map:
restic_create_paths:
- '{{ restic_download_path }}/bin'
- '{{ restic_script_dir }}'
restic_bin_bath: '{{ restic_download_path }}/bin/restic-{{ restic_version }}'
restic_url_r: 'https://github.com/restic/restic/releases/download/'
arch: '{{ ansible_architecture }}'
restic_platform: '{{ _platform_map[arch] | default(arch) }}'
restic_system: '{{ ansible_system | lower }}'
restic_url_v: 'v{{ restic_version }}/restic_{{ restic_version }}_'
restic_file: '{{ restic_system }}_{{ restic_platform }}.bz2'
restic_url_default: '{{ restic_url_r }}{{ restic_url_v }}{{ restic_file }}'