Archived
1

first commit

This commit is contained in:
2024-12-23 01:55:48 +03:00
commit b514cc36fb
33 changed files with 1969 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#!/bin/bash
# vi: set tabstop=4 shiftwidth=4 noexpandtab :
#------------------------------------------------#
# Модуль получения даты последнего бэкапа, если
# в качесте даты указано "latest". Иначе,
# возвращает переданный параметр.
#
# . . . . . . . . . . . . . . . . . . . . . . . .
# - dd.restore:
# role_path: "{{ role_path }}"
# inventory: name_of_inventory
# datetime: 20240412_231753
# register: res_dd_restore
#------------------------------------------------#
source $1
set -euo pipefail
L_CHANGED=false
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
if [[ "$datetime" == "latest" ]]; then
cd "$role_path/backups/$inventory"
datetime=$(ls -1t | head -1)
fi
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
echo "{ \"changed\": $L_CHANGED, \"inventory\": \"$inventory\", \"datetime\": \"$datetime\" }"