Skip to content

Commit 6decb2c

Browse files
committed
Persist admin IP in CI
1 parent 6f2c13f commit 6decb2c

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

etc/kayobe/environments/ci-tenks/automated-deployment.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# Script for a full deployment.
99

10-
set -eu
10+
set -eux
1111

1212
BASE_PATH=~
1313
KAYOBE_BRANCH=stackhpc/2025.1
@@ -80,6 +80,18 @@ sudo $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/configure-local-networ
8080
# Bootstrap the Ansible control host.
8181
kayobe control host bootstrap
8282

83+
# Write interface details to Kayobe configuration. These are required for host configure.
84+
export ADMIN_IFACE=$(ip -4 route show default | awk '{for(i=1;i<NF;i++) if($i=="dev") {print $(i+1); exit}}')
85+
cat << EOF >> $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/inventory/group_vars/seed-hypervisor/network-interfaces
86+
admin_interface: $ADMIN_IFACE
87+
EOF
88+
89+
export ADMIN_IP=$(ip -4 addr show dev "$ADMIN_IFACE" | awk '$1 == "inet" {split($2, a, "/"); print a[1]; exit}')
90+
cat << EOF >> $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/network-allocation.yml
91+
admin_ips:
92+
seed-hypervisor: $ADMIN_IP
93+
EOF
94+
8395
# Configure the seed hypervisor host.
8496
kayobe seed hypervisor host configure
8597

etc/kayobe/environments/ci-tenks/networks.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
###############################################################################
55
# Network role to network mappings.
66

7+
# Network used to reach host instance
8+
admin_net_name: admin
9+
710
# Name of the network used by the seed to manage the bare metal overcloud
811
# hosts via their out-of-band management controllers.
912
oob_oc_net_name: mgmt
@@ -54,6 +57,10 @@ cleaning_net_name: provision_wl
5457
###############################################################################
5558
# Network definitions.
5659

60+
admin_cidr: 192.168.49.0/24
61+
admin_mtu: 1500
62+
admin_gateway: 192.168.49.1
63+
5764
mgmt_cidr: 192.168.35.0/24
5865
mgmt_mtu: 1442
5966
# Native VLAN

etc/kayobe/environments/ci-tenks/seed-hypervisor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# List of extra networks to which seed hypervisor nodes are attached.
77
seed_hypervisor_extra_network_interfaces:
8+
- "{{ admin_net_name }}"
89
- "{{ provision_wl_net_name }}"
910
- "{{ internal_net_name }}"
1011
- "{{ public_net_name }}"

0 commit comments

Comments
 (0)