From 22302117fa70d10ffe8b96beeee99cf55429e70a Mon Sep 17 00:00:00 2001 From: saibotk Date: Sat, 26 Sep 2020 21:35:58 +0200 Subject: [PATCH] lvm_self_backup: Adjust directory permissions This patch reduces the permissions on the install directory to just the root user and also fixes the ansible-lint issue by specifying the `mode`. --- roles/lvm_self_backup/tasks/main.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/roles/lvm_self_backup/tasks/main.yml b/roles/lvm_self_backup/tasks/main.yml index b400bcd..57bf276 100644 --- a/roles/lvm_self_backup/tasks/main.yml +++ b/roles/lvm_self_backup/tasks/main.yml @@ -21,6 +21,9 @@ file: path: "/backup_snapshots/{{ item.vg_name }}-{{ item.lv_name }}" state: directory + mode: '0700' + owner: 'root' + group: 'root' recurse: true with_items: - "{{ backup_vols }}" @@ -30,9 +33,9 @@ template: src: "{{ item.src }}" dest: "{{ item.dest }}" - mode: '1700' - owner: root - group: root + mode: '0700' + owner: 'root' + group: 'root' with_items: - src: "backup-lvm.sh" dest: "/usr/local/bin/backup-lvm" @@ -45,8 +48,8 @@ src: "{{ item }}" dest: /etc/systemd/system/ mode: '0755' - owner: root - group: root + owner: 'root' + group: 'root' with_items: - "backup-lvm.service" - "backup-lvm.timer"