Skip to content

Commit

Permalink
Add default networking to node profiles
Browse files Browse the repository at this point in the history
* Add netmask, gateway, and dns at the node profile level
* Add internal_network, ipv4_gateway, dns_servers across
  input.local.template and inputs.tex

Signed-off-by: Timothy Middelkoop <[email protected]>
  • Loading branch information
MiddelkoopT committed Nov 1, 2024
1 parent 1203424 commit 234dbbd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/recipes/install/common/add_ww4_hosts_intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
\begin{lstlisting}[language=bash,keywords={},upquote=true,basicstyle=\footnotesize\ttfamily,literate={BOSVER}{\baseos{}}1]
[sms](*\#*) for ((i=0; i<$num_computes; i++)) ; do
wwctl node add --container=rocky-9.4 \
--ipaddr=${c_ip[$i]} --hwaddr=${c_mac[$i]} --netmask=${internal_netmask} ${c_name[i]}
--ipaddr=${c_ip[$i]} --hwaddr=${c_mac[$i]} ${c_name[i]}
done
\end{lstlisting}
% end_ohpc_run
4 changes: 4 additions & 0 deletions docs/recipes/install/common/inputs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ \subsection{Inputs} \label{sec:inputs}
\fi
& \texttt{\$\{internal\_network\}} & {\small \# Subnet network address for internal network} \\
& \texttt{\$\{internal\_netmask\}} & {\small \# Subnet netmask for internal network} \\
\iftoggleverb{isWarewulf4}
& \texttt{\$\{ipv4\_gateway\}} & {\small \# Default gateway for the internal network} \\
& \texttt{\$\{dns\_servers\}} & {\small \# DNS resolver for the internal network} \\
\fi
& \texttt{\$\{ntp\_server\}} & {\small \# Local ntp server for time synchronization} \\
& \texttt{\$\{bmc\_username\}} & {\small \# BMC username for use by IPMI} \\
& \texttt{\$\{bmc\_password\}} & {\small \# BMC password for use by IPMI} \\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
% ohpc_comment_header Add baseline OpenHPC and provisioning services \ref{sec:add_provisioning}
\begin{lstlisting}[language=bash,keywords={}]
# Install base packages
[sms](*\#*) (*\install*) ohpc-base warewulf-ohpc hwloc-ohpc netmask
[sms](*\#*) (*\install*) ohpc-base warewulf-ohpc hwloc-ohpc
\end{lstlisting}
% end_ohpc_run

Expand Down
9 changes: 5 additions & 4 deletions docs/recipes/install/common/warewulf4_setup_centos.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
[sms](*\#*) ip link set dev ${sms_eth_internal} up
[sms](*\#*) ip address add ${sms_ip}/${internal_netmask} broadcast + dev ${sms_eth_internal}

# Compute the network address for the internal network
[sms](*\#*) internal_cidr=$(netmask ${sms_ip}/${internal_netmask})
[sms](*\#*) internal_network=${internal_cidr%/*}

# Edit the warewulf.conf file to use appropriate interface and settings
[sms](*\#*) perl -pi -e "s/ipaddr:.*/ipaddr: ${sms_ip}/" /etc/warewulf/warewulf.conf
[sms](*\#*) perl -pi -e "s/netmask:.*/netmask: ${internal_netmask}/" /etc/warewulf/warewulf.conf
Expand All @@ -18,6 +14,11 @@
[sms](*\#*) perl -pi -e "s/range end:.*/range end: ${c_ip[$((num_computes-1))]}/" /etc/warewulf/warewulf.conf
[sms](*\#*) perl -pi -e "s/mount: false/mount: true/" /etc/warewulf/warewulf.conf

# Set default network configuration
[sms](*\#*) wwctl profile set -y default --netmask=${internal_netmask}
[sms](*\#*) wwctl profile set -y default --gateway=${ipv4_gateway}
[sms](*\#*) wwctl profile set -y default --netdev=default --nettagadd=DNS=${dns_servers}

# Configure /etc/hostname on master and compute nodes
[sms](*\#*) perl -pi -e "s/warewulf/${sms_name}/" /srv/warewulf/overlays/host/rootfs/etc/hosts.ww
[sms](*\#*) perl -pi -e "s/warewulf/${sms_name}/" /srv/warewulf/overlays/generic/rootfs/etc/hosts.ww
Expand Down
3 changes: 3 additions & 0 deletions docs/recipes/install/rocky9/input.local.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ sms_eth_internal="${sms_eth_internal:-eth1}"
# Subnet netmask for internal cluster network
internal_netmask="${internal_netmask:-255.255.0.0}"

# Subnet network for internal cluster network
internal_network="${internal_network:-172.16.0.0}"

# ipv4 gateway
ipv4_gateway="${ipv4_gateway:-172.16.0.2}"

Expand Down

0 comments on commit 234dbbd

Please sign in to comment.