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.
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
Create and edit
/opt/salt-cookbook/staging/hostconfig/locale.sls
to have the following entries:en_US.UTF-8: locale.system
Create and edit
/opt/salt-cookbook/staging/hostconfig/sysctl.sls
to have the following entries:net.ipv4.conf.default.rp_filter: sysctl.present: - value: 1 net.ipv4.tcp_syncookies: sysctl.present: - value: 1
Edit...