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

Setting time zone, locale, and kernel configurations

In this recipe, we will see some simple yet important system configurations, with the help of respective Salt modules. We will learn how to set time zones, locales, and manage kernel parameter configurations.

How to do it...

We will use the same minion as the previous recipe. We will also use the same state hostconfig, and new configurations will be added in new files.

  1. Create and edit /opt/salt-cookbook/staging/hostconfig/timezone.sls to have the following entries:
    {% if grains['location'] == "dc1" %}
    Asia/Singapore:
    {% elif grains['location'] == "dc2" %}
    Europe/Amsterdam:
    {% endif %}
      timezone.system
  2. Create and edit /opt/salt-cookbook/staging/hostconfig/locale.sls to have the following entries:

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