move to push backups
This commit is contained in:
parent
514dd7d096
commit
d49257dabd
14 changed files with 326 additions and 63 deletions
15
ansible/roles/backup/backup_control.sh
Normal file
15
ansible/roles/backup/backup_control.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
VIRSH="virsh --connect qemu:///system"
|
||||
read -p "" option
|
||||
case "$option" in
|
||||
up)
|
||||
for i in $($VIRSH list --all --name --autostart); do $VIRSH start "$i"; done
|
||||
;;
|
||||
down)
|
||||
for i in $($VIRSH list --state-running --name --autostart); do
|
||||
$VIRSH shutdown "$i"
|
||||
until $VIRSH domstate "$i" | grep shut; do
|
||||
sleep 0.5
|
||||
done
|
||||
done
|
||||
;;
|
||||
esac
|
14
ansible/roles/backup/sshd.conf.j2
Normal file
14
ansible/roles/backup/sshd.conf.j2
Normal file
|
@ -0,0 +1,14 @@
|
|||
TrustedUserCAKeys /etc/ssh/user_ca_key.pub
|
||||
|
||||
Match User {{ backup_share_user }}
|
||||
AuthorizedPrincipalsFile /etc/ssh/backup_principals
|
||||
ChrootDirectory /kvm/data
|
||||
ForceCommand internal-sftp
|
||||
AllowTcpForwarding no
|
||||
X11Forwarding no
|
||||
|
||||
Match User {{ backup_control_user }}
|
||||
AuthorizedPrincipalsFile /etc/ssh/backup_principals
|
||||
ForceCommand /home/{{ backup_control_user }}/control.sh
|
||||
AllowTcpForwarding no
|
||||
X11Forwarding no
|
Reference in a new issue