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:
parent
a178af1735
commit
f67be989cc
3 changed files with 9 additions and 2 deletions
|
@ -21,6 +21,11 @@
|
||||||
# The directory to put the status flag in
|
# The directory to put the status flag in
|
||||||
backup_status_directory: "/monitoring"
|
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
|
# The LVM volumes to backup
|
||||||
# Available fields:
|
# Available fields:
|
||||||
# vg_name - The volume group that the volume resides in
|
# vg_name - The volume group that the volume resides in
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0700'
|
mode: '0700'
|
||||||
owner: 'root'
|
owner: "{{ backup_status_directory_uid }}"
|
||||||
group: 'root'
|
group: "{{ backup_status_directory_gid }}"
|
||||||
recurse: true
|
recurse: true
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ backup_status_directory }}"
|
- "{{ backup_status_directory }}"
|
||||||
|
|
|
@ -84,4 +84,6 @@ fi
|
||||||
|
|
||||||
echo $success > {{ backup_status_directory }}/backup.status
|
echo $success > {{ backup_status_directory }}/backup.status
|
||||||
|
|
||||||
|
chown {{ backup_status_directory_uid }}:{{ backup_status_directory_gid }} {{ backup_status_directory }}/backup.status
|
||||||
|
|
||||||
exit $success
|
exit $success
|
||||||
|
|
Loading…
Add table
Reference in a new issue