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:

Get Salt Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.