From bcbcc6ae59438c3fd70f0e805bbefc415a3c9537 Mon Sep 17 00:00:00 2001 From: camille Date: Wed, 4 Jan 2023 11:34:47 +0100 Subject: [PATCH] add duplicityls alias --- tasks/main.yml | 5 +++++ tasks/tools.yml | 8 ++++++++ templates/profile-backup.sh.j2 | 3 +++ 3 files changed, 16 insertions(+) create mode 100644 tasks/tools.yml create mode 100644 templates/profile-backup.sh.j2 diff --git a/tasks/main.yml b/tasks/main.yml index fa8fc50..d53bc5c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -10,3 +10,8 @@ - backup_duplicity with_items: - "{{ backup_services }}" + +- name: tools + include_tasks: "tools.yml" + tags: + - backup_duplicity diff --git a/tasks/tools.yml b/tasks/tools.yml new file mode 100644 index 0000000..0274705 --- /dev/null +++ b/tasks/tools.yml @@ -0,0 +1,8 @@ +--- +- name: backup | add command aliases + template: + src: profile-backup.sh.j2 + dest: /etc/profile.d/backup.sh + owner: root + group: root + mode: 0640 diff --git a/templates/profile-backup.sh.j2 b/templates/profile-backup.sh.j2 new file mode 100644 index 0000000..0d1a69a --- /dev/null +++ b/templates/profile-backup.sh.j2 @@ -0,0 +1,3 @@ +{% if 'duplicity' in backup_services %} +alias duplicityls='source /etc/duplicity/duplicity.cnf && duplicity collection-status "{{ duplicity_s3_path }}"' +{% endif %}