diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md deleted file mode 100644 index fe46f5f..0000000 --- a/.chglog/CHANGELOG.tpl.md +++ /dev/null @@ -1,59 +0,0 @@ -{{ if .Versions -}} - -## [Unreleased] - -{{ if .Unreleased.CommitGroups -}} -{{ range .Unreleased.CommitGroups -}} -### {{ .Title }} -{{ range .Commits -}} -- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} -{{ end }} -{{ end -}} -{{ end -}} -{{ end -}} - -{{ range .Versions }} - -## {{ 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 -}} diff --git a/.chglog/config.yml b/.chglog/config.yml deleted file mode 100644 index 6b97559..0000000 --- a/.chglog/config.yml +++ /dev/null @@ -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 diff --git a/defaults/main.yml b/defaults/main.yml index afd7d5b..04e7f83 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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: {} diff --git a/meta/main.yml b/meta/main.yml index bd8915d..1b45739 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -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: [] diff --git a/tasks/main.yml b/tasks/main.yml index 685812e..86f732b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/templates/restic_script_Linux.j2 b/templates/restic_script_Linux.j2 index 20dda88..e890522 100644 --- a/templates/restic_script_Linux.j2 +++ b/templates/restic_script_Linux.j2 @@ -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 %} diff --git a/vars/defaults.yml b/vars/defaults.yml index 67989fe..4c28354 100644 --- a/vars/defaults.yml +++ b/vars/defaults.yml @@ -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 }}'