lvm_self_backup: Option to configure user/group for status dir

This allows to give the telegraf container access to the backup status flags
This commit is contained in:
Saibotk 2021-10-29 23:46:10 +02:00
parent a178af1735
commit f67be989cc
Signed by: saibotk
GPG key ID: 67585F0065E261D5
3 changed files with 9 additions and 2 deletions

View file

@ -21,6 +21,11 @@
# The directory to put the status flag in
backup_status_directory: "/monitoring"
# Status directory user & group id
# This can be used for example to give telegraf access to the status files.
backup_status_directory_uid: 100
backup_status_directory_gid: 101
# The LVM volumes to backup
# Available fields:
# vg_name - The volume group that the volume resides in

View file

@ -34,8 +34,8 @@
path: "{{ item }}"
state: directory
mode: '0700'
owner: 'root'
group: 'root'
owner: "{{ backup_status_directory_uid }}"
group: "{{ backup_status_directory_gid }}"
recurse: true
with_items:
- "{{ backup_status_directory }}"

View file

@ -84,4 +84,6 @@ fi
echo $success > {{ backup_status_directory }}/backup.status
chown {{ backup_status_directory_uid }}:{{ backup_status_directory_gid }} {{ backup_status_directory }}/backup.status
exit $success