O'Reilly logo

Salt Cookbook by Anirban Saha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring alternatives

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.

How to do it...

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:

  1. Create a new state directory called alternatives.
  2. Create and edit the /opt/salt-cookbook/staging/alternatives/init.sls file to have the following entries:
    extract_jdk_archive: archive: - extracted - name: /opt/ - ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required