\subsection{Installation Template}  \label{appendix:template_script}

This appendix highlights the availability of a companion installation script
that is included with \OHPC{} documentation. This script, when combined with
local site inputs, can be used to implement a starting recipe for
bare-metal system installation and configuration. This template script is used
during validation efforts to test cluster installations and is provided as a
convenience for administrators as a starting point for potential site
customization.

\vspace*{0.1cm}

\begin{center}
\begin{tcolorbox}[]
\small Note that the template script provided is intended for use during
initial installation and is not designed for repeated execution.  If
modifications are required after using the script initially, we recommend
running the relevant subset of commands interactively.
\end{tcolorbox}
\end{center}

The template script relies on the use of a simple text file to define local
site variables that were outlined in \S\ref{sec:inputs}. By default, the
template installation script attempts to use local variable settings sourced from
the \path{/opt/ohpc/pub/doc/recipes/vanilla/input.local} file, however, this
choice can be overridden by the use of the \texttt{\$\{OHPC\_INPUT\_LOCAL\}}
environment variable. The template install script is intended for execution on
the SMS {\em master} host and is installed as part of the \texttt{docs-ohpc}
package into \path{/opt/ohpc/pub/doc/recipes/vanilla/recipe.sh}. After
enabling the \OHPC{} repository and reviewing the guide for additional
information on the intent of the commands, the general starting approach for
using this template is as follows:

\begin{enumerate}
\item Install the \texttt{docs-ohpc} package

\begin{lstlisting}[language=bash,keywords={}]
[sms](*\#*) (*\install*) docs-ohpc
\end{lstlisting}

\item Copy the provided template input file to use as a starting point to
  define local site settings:
\begin{lstlisting}[language=bash,keywords={},literate={OSVER}{\baseosshort{}}1]
[sms](*\#*) cp /opt/ohpc/pub/doc/recipes/OSVER/input.local input.local
\end{lstlisting}

\item Update \path{input.local} with desired settings

\item Copy the template installation script which contains command-line
  instructions culled from this guide.

\begin{lstlisting}[language=bash,keywords={},basicstyle=\fontencoding{T1}\footnotesize\ttfamily,literate={OSVER}{\baseosshort{}}1
    {ARCH}{\arch{}}1 {PROV}{\MakeLowercase{\provisioner{}}}1
    {RMS}{\rmsshort{}}1 {-}{-}1]
[sms](*\#*) cp -p /opt/ohpc/pub/doc/recipes/OSVER/ARCH/PROV/RMS/recipe.sh .
\end{lstlisting}

\item Review and edit \path{recipe.sh} to suite.

\item Use environment variable to define local input file and execute
  \path{recipe.sh} to perform a local installation.

\begin{lstlisting}[language=bash,keywords={}]
[sms](*\#*) export OHPC_INPUT_LOCAL=./input.local
[sms](*\#*) ./recipe.sh
\end{lstlisting}
\end{enumerate}
