Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 01_install_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ -z "${METAL3_DEV_ENV}" ]; then
# TODO -- come up with a plan for continuously updating this
# Note we only do this in the case where METAL3_DEV_ENV is
# unset, to enable developer testing of local checkouts
git reset ee1b2fec44e22700c8d250d5e0e371e3fd0aba17 --hard
#git reset 67afcb3315b44e2c68121493a819819966e588a2 --hard
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be removed - note you can use METAL3_DEV_ENV to reference a local source checkout for testing with latest metal3-dev-env :)

popd
fi

Expand Down
1 change: 1 addition & 0 deletions 02_configure_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ ansible-playbook \
-e "virtualbmc_base_port=$VBMC_BASE_PORT" \
-e "master_hostname_format=$MASTER_HOSTNAME_FORMAT" \
-e "worker_hostname_format=$WORKER_HOSTNAME_FORMAT" \
-e "virsh_dhcp_enabled=$DHCP_ENABLED" \
-i ${VM_SETUP_PATH}/inventory.ini \
-b -vvv ${VM_SETUP_PATH}/setup-playbook.yml

Expand Down
13 changes: 12 additions & 1 deletion common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,23 @@ export CLUSTER_NAME=${CLUSTER_NAME:-ostest}

export PROVISIONING_NETWORK_PROFILE=${PROVISIONING_NETWORK_PROFILE:-"Managed"}

# Set to 1 if you want dev scripts to configure static IPs for your deployment.
export STATIC_IPS=${STATIC_IPS:-""}
# Set to false to disable DHCP on all networks.
export DHCP_ENABLED=${DHCP_ENABLED:-"true"}

# Network interface names can only be 15 characters long, so
# abbreviate provisioning and baremetal and add them as suffixes to
# the cluster name.
export PROVISIONING_NETWORK_NAME=${PROVISIONING_NETWORK_NAME:-${CLUSTER_NAME}pr}
export BAREMETAL_NETWORK_NAME=${BAREMETAL_NETWORK_NAME:-${CLUSTER_NAME}bm}

if [[ "$PROVISIONING_NETWORK_PROFILE" == "Disabled" ]]; then
export PROVISIONING_NETWORK_INTERFACE="enp2s1"
else
export PROVISIONING_NETWORK_INTERFACE="enp2s0"
fi

export BASE_DOMAIN=${BASE_DOMAIN:-test.metalkube.org}
export CLUSTER_DOMAIN="${CLUSTER_NAME}.${BASE_DOMAIN}"
export SSH_PUB_KEY="${SSH_PUB_KEY:-$(cat $HOME/.ssh/id_rsa.pub)}"
Expand Down Expand Up @@ -157,7 +168,7 @@ else
export BMC_DRIVER=${BMC_DRIVER:-mixed}
fi

if [[ "$PROVISIONING_NETWORK_PROFILE" == "Disabled" ]]; then
if [[ "$PROVISIONING_NETWORK_PROFILE" == "Disabled" || -n "$STATIC_IPS" ]]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should support both virtualmedia and PXE paths now?

export BMC_DRIVER="redfish-virtualmedia"
fi

Expand Down
34 changes: 34 additions & 0 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,41 @@ function node_map_to_install_config_hosts() {
disableCertificateVerification: ${disable_certificate_verification}
bootMACAddress: ${mac}
bootMode: ${boot_mode}
networkConfig:
routes:
config:
- destination: 0.0.0.0/0
next-hop-address: ${PROVISIONING_HOST_EXTERNAL_IP}
next-hop-interface: ${PROVISIONING_NETWORK_INTERFACE}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We normally would have the default route on the External network, is the change to the provisioning network intentional?

dns-resolver:
config:
search:
- ostest.test.metalkube.org
server:
- ${PROVISIONING_HOST_EXTERNAL_IP}
interfaces:
- name: ${PROVISIONING_NETWORK_INTERFACE}
type: ethernet
state: up
EOF
if [[ "$IP_STACK" = "v4" || "$IP_STACK" = "v4v6" ]]; then
cat << EOF
ipv4:
address:
- ip: $(nth_ip $EXTERNAL_SUBNET_V4 $((idx + 10)))
prefix-length: $(ipcalc --prefix $EXTERNAL_SUBNET_V4 | cut -d= -f2)
enabled: true
EOF
fi
if [[ "$IP_STACK" = "v6" || "$IP_STACK" = "v4v6" ]]; then
cat << EOF
ipv6:
address:
- ip: $(nth_ip $EXTERNAL_SUBNET_V6 $((idx + 10)))
prefix-length: $(ipcalc --prefix $EXTERNAL_SUBNET_V6 | cut -d= -f2)
enabled: true
EOF
fi

# FIXME(stbenjam) Worker code in installer should accept
# "default" as well -- currently the mapping doesn't work,
Expand Down
3 changes: 3 additions & 0 deletions vm_setup_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ provisioning_network:
bridge: "{{ provisioning_network_name }}"
forward_mode: bridge

virsh_dhcp_enabled: "{{ lookup('env', 'DHCP_ENABLED')|default('', true) }}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this, since the environment variable is already respected in the defaults ref metal3-io/metal3-dev-env#879 ?


external_network:
- name: "{{ baremetal_network_name }}"
bridge: "{{ baremetal_network_name }}"
Expand All @@ -59,6 +61,7 @@ external_network:
netmask_v4: "{{ baremetal_network_cidr_v4|ipaddr('netmask') }}"
address_v6: "{{ baremetal_network_cidr_v6|nthhost(1)|default('', true) }}"
prefix_v6: "{{ baremetal_network_cidr_v6|ipaddr('prefix') }}"
dhcp_enabled: "{{ virsh_dhcp_enabled|bool }}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option is we conditionally define dhcp_range* - then we won't need the new metal3-dev-env flag since the <dhcp stanza is already skipped when the range is omitted

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed metal3-io/metal3-dev-env#902 which means we can just set the dhcp_range variables to an empty list, which avoids the need for a new variable

dhcp_range_v4:
- "{{ baremetal_network_cidr_v4|nthhost(20) }}"
- "{{ baremetal_network_cidr_v4|nthhost(60) }}"
Expand Down