forked from urosorozel/docker-cobbler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working in container with data in volume: /data
- Loading branch information
brendan
committed
Jul 12, 2020
1 parent
c0fa228
commit cd3c58e
Showing
9 changed files
with
137 additions
and
98 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,48 @@ | ||
#!/bin/bash | ||
echo "Updating configuration files from environment variables" | ||
mkdir -p /data/var/lib | ||
mkdir -p /data/etc/cobbler | ||
mkdir -p /data/srv | ||
mkdir -p /data/iso | ||
j2 --undefined /etc/cobbler/settings.j2 -o /etc/cobbler/settings | ||
j2 --undefined /etc/cobbler/dhcp.template.j2 -o /etc/cobbler/dhcp.template | ||
j2 --undefined /etc/apache2/conf-available/cobbler_web.conf.j2 -o /etc/apache2/conf-available/cobbler_web.conf | ||
j2 --undefined /var/lib/cobbler/snippets/preseed_bionic_post_deploy.j2 -o /var/lib/cobbler/snippets/preseed_bionic_post_deploy | ||
j2 --undefined /var/lib/cobbler/snippets/preseed_xenial_post_deploy.j2 -o /var/lib/cobbler/snippets/preseed_xenial_post_deploy | ||
if [[ -L /var/www ]]; then | ||
echo "is a symlink"; else | ||
cp --recursive --no-clobber -d /var/www /data/srv/ | ||
rm -rf --verbose /var/www | ||
ln --symbolic --verbose /data/srv/www /var/www | ||
fi | ||
if [[ -L /etc/cobbler ]]; then | ||
echo "is a symlink"; else | ||
cp --recursive --no-clobber -d /etc/cobbler /data/etc/ | ||
rm -rf --verbose /etc/cobbler | ||
ln --symbolic --verbose /data/etc/cobbler /etc/cobbler | ||
fi | ||
if [[ -L /var/lib/cobbler ]]; then | ||
echo "is a symlink"; else | ||
cp --recursive --no-clobber -d /var/lib/cobbler /data/var/lib/ | ||
rm -rf --verbose /var/lib/cobbler/ | ||
ln --symbolic --verbose /data/var/lib/cobbler /var/lib/cobbler | ||
fi | ||
if [[ -L /var/lib/dhcp ]]; then | ||
echo "is a symlink"; else | ||
cp --recursive --no-clobber -d /var/lib/dhcp /data/var/lib/ | ||
rm -rf --verbose /var/lib/dhcp | ||
ln --symbolic --verbose /data/var/lib/dhcp /var/lib/dhcp | ||
fi | ||
chown -R 33:0 /data/var/lib/cobbler/webui_sessions | ||
chown -R 33:0 /data/var/lib/cobbler/web.ss | ||
if [[ -L /srv ]]; then | ||
echo "is a symlink"; else | ||
cp --recursive --no-clobber -d /srv /data/ | ||
rm -rf --verbose /srv | ||
ln --symbolic --verbose /data/srv /srv | ||
fi | ||
unlink /var/lib/tftpboot/tftp | ||
ln --symbolic --verbose /srv/tftpboot /var/lib/tftpboot/tftp | ||
mkdir -p /data/srv/www/cobbler/links | ||
sleep 30 | ||
pkill -f tftpd | ||
supervisorctl start atftpd |
Empty file modified
0
cobbler/tree/var/lib/cobbler/triggers/sync/post/restart-dhcp.sh
100755 → 100644
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
#!/bin/bash | ||
URL_BIONIC="http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.3-server-amd64.iso" | ||
FILENAME_BIONIC=$(basename $URL_BIONIC) | ||
echo "Downloading $FILENAME_BIONIC" | ||
test -f ~/$FILENAME_BIONIC || curl $URL_BIONIC -o ~/$FILENAME_BIONIC | ||
test -d /mnt/bionic || sudo mkdir /mnt/bionic | ||
sudo mount -o loop ~/$FILENAME_BIONIC /mnt/bionic | ||
|
||
URL_XENIAL="http://releases.ubuntu.com/16.04/ubuntu-16.04.6-server-amd64.iso" | ||
FILENAME_XENIAL=$(basename $URL_XENIAL) | ||
echo "Downloading $FILENAME_XENIAL" | ||
test -f ~/$FILENAME_XENIAL || curl $URL_XENIAL -o ~/$FILENAME_XENIAL | ||
test -d /mnt/xenial ||sudo mkdir /mnt/xenial | ||
sudo mount -o loop ~/$FILENAME_XENIAL /mnt/xenial | ||
URL="http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.4-server-amd64.iso" | ||
COBBLER_SHARE_PATH="/mnt2/pool/cobbler" | ||
DISTRO_NAME="ubuntu-18.04.4-server" | ||
FILENAME=$(basename $URL) | ||
echo "Downloading $FILENAME" | ||
test -f ~/$FILENAME || curl $URL -o ~/$FILENAME | ||
test -d ${COBBLER_SHARE_PATH}/iso/${DIR} || mkdir ${COBBLER_SHARE_PATH}/iso/${DISTRO_NAME} | ||
mount -o loop ~/$FILENAME ${COBBLER_SHARE_PATH}/iso/${DIR} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.