ansible/roles/vm/templates/script_network.j2
2023-12-05 18:12:35 +01:00

59 lines
1001 B
Django/Jinja

#!/bin/bash
{# Updated: 2023-12-05 #}
# master: {{ common_mastering }}
# updated: {{ ansible_date_time.date }}
doBuildSystem() {
echo "v{{ vm_mastering }}"
}
# Display introduction
doIntro() {
echo
echo "Docker Networks Managment: $HOSTNAME"
doBuildSystem
echo
}
# Show date/time header
doHeader() {
NOW=`date +"%Y/%m/%d %H:%M:%S"`
echo "- $NOW"
echo ""
}
if [ "$(id -u)" != "0" ]; then
doIntro
doHeader
echo
echo "This script must be run as root" 1>&2
echo
exit 1
fi
SELF=$(realpath $0)
SCRIPT=$(basename $SELF)
CWD=$(realpath $(pwd))
STACKS=$CWD
HOSTNAME=$(hostname)
cd $STACKS
doIntro
doHeader
if [ "$HOSTNAME" == "raijin" ]; then
echo " - Create Traefik Network"
### --opt "com.docker.network.driver.mtu=1500" \
docker network create \
--attachable \
--driver bridge \
--ipv6 \
--opt "com.docker.network.bridge.name=traefik" \
--opt "com.docker.network.driver.mtu=9000" \
traefik
else
echo " - Only for use on raijin !!!"
fi
exit 0