nested LXC need different IP ranges

This commit is contained in:
Earl Warren 2023-03-25 19:14:55 +01:00
parent 8b2ff23fc0
commit 9279b526cd
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 7 additions and 5 deletions

View file

@ -6,7 +6,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: | - run: |
set -x set -x
./dependencies.sh LXC_IP_RANGE=10.0.9 ./dependencies.sh
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19 ./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19
./forgejo-runner.sh setup ./forgejo-runner.sh setup
# testdata/run.sh workflow http://root:admin1234@$(cat forgejo-ip):3000 root demo # testdata/run.sh workflow http://root:admin1234@$(cat forgejo-ip):3000 root demo

View file

@ -2,6 +2,8 @@
set -x set -x
: ${LXC_IP_RANGE:=10.0.8}
function install_docker() { function install_docker() {
if ! systemctl is-active --quiet docker; then if ! systemctl is-active --quiet docker; then
echo deb http://deb.debian.org/debian bullseye-backports main | tee /etc/apt/sources.list.d/backports.list && apt-get update echo deb http://deb.debian.org/debian bullseye-backports main | tee /etc/apt/sources.list.d/backports.list && apt-get update
@ -16,11 +18,11 @@ function install_lxc() {
systemctl disable --now dnsmasq systemctl disable --now dnsmasq
apt-get install -y -qq lxc apt-get install -y -qq lxc
systemctl stop lxc-net systemctl stop lxc-net
cat >> /etc/default/lxc-net <<'EOF' cat >> /etc/default/lxc-net <<EOF
LXC_ADDR="10.0.8.1" LXC_ADDR="$LXC_IP_RANGE.1"
LXC_NETMASK="255.255.255.0" LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.8.0/24" LXC_NETWORK="$LXC_IP_RANGE.0/24"
LXC_DHCP_RANGE="10.0.8.2,10.0.8.254" LXC_DHCP_RANGE="$LXC_IP_RANGE.2,$LXC_IP_RANGE.254"
LXC_DHCP_MAX="253" LXC_DHCP_MAX="253"
EOF EOF
systemctl start lxc-net systemctl start lxc-net