File: oci-glance-image-rsync

package info (click to toggle)
openstack-cluster-installer 21
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,212 kB
  • sloc: php: 9,235; sh: 2,936; makefile: 14
file content (15 lines) | stat: -rwxr-xr-x 444 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

set -e

ME=$(hostname)
HOSTLIST=$(cat /etc/hosts | grep controller | awk '{print $2}')

RANDOM_TIME=$(($(dd if=/dev/urandom bs=512 count=1 2>&1 | cksum | cut -d' ' -f1) % 300))
sleep ${RANDOM_TIME}

for i in ${HOSTLIST} ; do
	if ! [ "${i}" = "${ME}" ] ; then
		rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' -avz --delete /var/lib/glance/images/ root@${i}:/var/lib/glance/images/ >/dev/null 2>&1
	fi
done