-
Notifications
You must be signed in to change notification settings - Fork 2
/
import-iso.sh
executable file
·30 lines (29 loc) · 1.36 KB
/
import-iso.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
28
29
30
if [ ! -f "/usr/local/bin/cobbler" ]; then
echo "This script should only be run in container, execute:"
echo "\$ docker exec -it cobbler /bin/bash -c \"\$(<import-iso.sh)\""
exit 1
fi
PROFILE_NAME="ubuntu-18.04.2-server"
echo "Importing ${PROFILE_NAME}"
cobbler import --name="$PROFILE_NAME" --path /mnt/bionic --arch=x86_64 --breed ubuntu --autoinstall ubuntu-server-bionic-unattended-cobbler-rpc.seed
if [[ $? -eq 0 ]]; then
for PROFILE in $(cobbler profile list | grep ${PROFILE_NAME});do
echo "Updating profile $PROFILE"
cobbler profile edit \
--name ${PROFILE} \
--kernel-options="ksdevice=bootif lang priority=critical locale=en_US text netcfg/dhcp_timeout=60 netcfg/choose_interface=auto console=tty0"
done
fi
PROFILE_NAME="ubuntu-16.04.6-server"
echo "Importing ${PROFILE_NAME}"
cobbler import --name="$PROFILE_NAME" --path /mnt/xenial --arch=x86_64 --breed ubuntu --autoinstall ubuntu-server-xenial-unattended-cobbler-rpc.seed
if [[ $? -eq 0 ]]; then
for PROFILE in $(cobbler profile list | grep ${PROFILE_NAME});do
echo "Updating profile $PROFILE"
cobbler profile edit \
--name ${PROFILE} \
--kernel-options="ksdevice=bootif lang priority=critical locale=en_US text netcfg/dhcp_timeout=60 netcfg/choose_interface=auto console=tty0"
done
fi
echo "Running cobbler sync"
cobbler sync