Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ fi

cd "$configuration_directory"

SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
ROUTE_TABLE=1${SUFFIX}
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
ROUTE_TABLE="$(( $SUFFIX + 10 ))"
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be good to have a comment in the code to describe why this is required.


ln -s /usr/lib/systemd/network/80-ec2.network ${file_name} # Use default EC2 configuration. This include MTU, etc.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ then
exit 1
fi

SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)

ROUTE_TABLE="1${SUFFIX}"
ROUTE_TABLE="$(( $SUFFIX + 10 ))"

echo "Configuring device name: ${DEVICE_NAME} with IP:${DEVICE_IP_ADDRESS} CIDR_PREFIX:${CIDR_PREFIX_LENGTH} NETMASK:${NETMASK} GW:${GW_IP_ADDRESS} ROUTING_TABLE:${ROUTE_TABLE}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ then
fi

con_name="System ${DEVICE_NAME}"
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
route_table="1${SUFFIX}"
priority="1${SUFFIX}"
metric="1${SUFFIX}"
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
route_table="$(( $SUFFIX + 10 ))"
priority="${route_table}"
metric="${route_table}"

# Rename connection
original_con_name=`nmcli -t -f GENERAL.CONNECTION device show ${DEVICE_NAME} | cut -f2 -d':'`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ then
fi

con_name="System ${DEVICE_NAME}"
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
route_table="1${SUFFIX}"
priority="1${SUFFIX}"
metric="1${SUFFIX}"
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
route_table="$(( $SUFFIX + 10 ))"
priority="${route_table}"
metric="${route_table}"

# Rename connection
original_con_name=`nmcli -t -f GENERAL.CONNECTION device show ${DEVICE_NAME} | cut -f2 -d':'`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ if [ "${STATIC_IP_CONFIG}" = "" ]
fi

FILE="/etc/netplan/${DEVICE_NAME}.yaml"
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
ROUTE_TABLE="1${SUFFIX}"
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
ROUTE_TABLE="$(( $SUFFIX + 10 ))"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have expected a change in the kitchen tests after this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please execute kitchen tests, verify if they are still correct and eventually improve coverage ? Thanks!


echo "Configuring ${DEVICE_NAME} with IP:${DEVICE_IP_ADDRESS} CIDR_PREFIX:${CIDR_PREFIX_LENGTH} NETMASK:${NETMASK} GW:${GW_IP_ADDRESS} ROUTING_TABLE:${ROUTE_TABLE}"

Expand Down
Loading