Infrastructures are often configured in a manner where multiple files providing the same binary exists, and we configure alternatives to set the correct file that should provide the required binary and they are known as alternatives. In this recipe, we will learn how to configure alternatives in Salt.
We will use the same minion as the previous recipe. We will assume that there is a local web server in our environment, which provides an archived file containing a hotspot version of Java from Oracle:
/opt/salt-cookbook/staging/alternatives/init.slsfile to have the following entries:
extract_jdk_archive: archive: - extracted - name: /opt/ - ...