-
Notifications
You must be signed in to change notification settings - Fork 200
Add ability to inject static ips into install-config #1297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)}" | ||
|
|
@@ -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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,8 @@ provisioning_network: | |
| bridge: "{{ provisioning_network_name }}" | ||
| forward_mode: bridge | ||
|
|
||
| virsh_dhcp_enabled: "{{ lookup('env', 'DHCP_ENABLED')|default('', true) }}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 }}" | ||
|
|
@@ -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 }}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another option is we conditionally define There was a problem hiding this comment. Choose a reason for hiding this commentThe 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_v4: | ||
| - "{{ baremetal_network_cidr_v4|nthhost(20) }}" | ||
| - "{{ baremetal_network_cidr_v4|nthhost(60) }}" | ||
|
|
||
There was a problem hiding this comment.
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_ENVto reference a local source checkout for testing with latest metal3-dev-env :)