ansible/roles/vm/templates/script_network.j2

59 lines
1001 B
Plaintext
Raw Normal View History

2023-09-25 08:40:20 +00:00
#!/bin/bash
2023-12-05 17:12:35 +00:00
{# Updated: 2023-12-05 #}
# master: {{ common_mastering }}
2023-09-25 08:40:20 +00:00
# updated: {{ ansible_date_time.date }}
doBuildSystem() {
echo "v{{ vm_mastering }}"
}
# Display introduction
doIntro() {
2023-12-05 17:12:35 +00:00
echo
echo "Docker Networks Managment: $HOSTNAME"
doBuildSystem
echo
2023-09-25 08:40:20 +00:00
}
# Show date/time header
doHeader() {
2023-12-05 17:12:35 +00:00
NOW=`date +"%Y/%m/%d %H:%M:%S"`
echo "- $NOW"
echo ""
2023-09-25 08:40:20 +00:00
}
if [ "$(id -u)" != "0" ]; then
2023-12-05 17:12:35 +00:00
doIntro
doHeader
echo
echo "This script must be run as root" 1>&2
echo
exit 1
2023-09-25 08:40:20 +00:00
fi
SELF=$(realpath $0)
SCRIPT=$(basename $SELF)
CWD=$(realpath $(pwd))
STACKS=$CWD
HOSTNAME=$(hostname)
cd $STACKS
doIntro
doHeader
2023-12-05 17:12:35 +00:00
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
2023-09-25 08:40:20 +00:00
else
2023-12-05 17:12:35 +00:00
echo " - Only for use on raijin !!!"
2023-09-25 08:40:20 +00:00
fi
exit 0