forked from karmab/kcli-ztp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
00_virtual.sh.redfish
executable file
·26 lines (24 loc) · 1.07 KB
/
00_virtual.sh.redfish
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
#!/usr/bin/env bash
# set -euo pipefail
{% if not 'rhel' in image %}
dnf clean all
sleep 30
{% endif %}
dnf -y install pkgconf-pkg-config libvirt-devel gcc python3-libvirt python3 git
pip3 install sushy-tools
IP=$(ip -o addr show eth0 | head -1 | awk '{print $4}' | cut -d "/" -f 1 | head -1)
sed -i "s/127.0.0.1/$IP/" /etc/sushy.conf
# cp /root/bin/sushy.service /usr/lib/systemd/system
# restorecon -Frv /usr/lib/systemd/system/sushy.service
systemctl enable --now sushy
sleep 20
ssh-keyscan -H {{ config_host }} >> /root/.ssh/known_hosts
echo -e "Host=*\nStrictHostKeyChecking=no\n" > /root/.ssh/config
python3 /root/bin/sushy.py
api_vip=$(grep apiVIP /root/install-config.yaml | awk -F: '{print $2}' | xargs)
cluster=$(grep -m 1 name /root/install-config.yaml | awk -F: '{print $2}' | xargs)
domain=$(grep baseDomain /root/install-config.yaml | awk -F: '{print $2}' | xargs)
#sed -i '/DONTCHANGEME/{n;N;d;}' /root/install-config.yaml
sed -i "s/DONTCHANGEME/$IP/" /root/install-config.yaml
sed -i "s/DONTCHANGEME/$IP/" /root/extra_worker.yml
echo $api_vip api.$cluster.$domain >> /etc/hosts