-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcompat.sh
executable file
·27 lines (24 loc) · 1 KB
/
compat.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
echo "Reading Swarm secrets"
for f in ceph.mon.keyring ceph.client.admin.keyring; do
[ -e /run/secrets/$f ] && cp /run/secrets/$f /etc/ceph/$f
done
for d in osd mds rbd rgw; do
if [ -e /run/secrets/ceph.bootstrap-$d.keyring ]; then
mkdir -p /var/lib/ceph/bootstrap-$d
cp /run/secrets/ceph.bootstrap-$d.keyring /var/lib/ceph/bootstrap-$d/ceph.keyring
fi
done
if [ "$1" == "mon" ]; then
base="/var/lib/ceph/mon/ceph-`hostname`"
if [ ! -e "$base/keyring" -a -e /run/secrets/monmap ]; then
echo "Bootstrapping new mon from Swarm secrets"
mkdir -p $base && chown ceph:ceph $base
ceph-mon --setuser ceph --setgroup ceph --cluster ceph --mkfs -i `hostname` --monmap /run/secrets/monmap --keyring /etc/ceph/ceph.mon.keyring --mon-data $base
fi
elif [ "$1" == "mgr" -a "$ZABBIX" ]; then
echo "Adding zabbix_sender to mgr"
rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
yum install -y zabbix-sender
fi
exec /entrypoint.sh "$@"