The timezone apply-device-config script sets the device’s timezone using the value of the
timezone key from the Device Configuration.
|Configuration key(s) evaluated||timezone|
Please be aware that Mender apply-device-config scripts are meant to update and configure parts of the system and if not configured properly they could potentially delete parts or the complete system. Always inspect the code carefully and only test scripts on systems that you can recover easily.
This section describes how to setup your target device, i.e. the device to be configured. This will also be referred to as the device environment.
All commands outlined in this section should be run in the device environment.
This apply-device-config script has the following prerequisites for the device environment:
- Install the Mender client, version 2.6 or later
- Install the Mender Configure update module
- Availability of the
timezone apply-device-config script is available in the Mender APT repository. Follow instructions in Mender Docs to install the repository in your device. Then, install
sudo apt-get update sudo apt-get install mender-configure-timezone
Alternatively to all the above, it is possible to install from source. Follow these steps:
mkdir -p /usr/lib/mender-configure/apply-device-config.d && wget -P /usr/lib/mender-configure/apply-device-config.d https://raw.githubusercontent.com/mendersoftware/mender-configure-module/1.0.0/scripts/timezone && chmod +x /usr/lib/mender-configure/apply-device-config.d/timezone
You can now set the device’s timezone setting the
timezone configuration key in the Device Configuration.
While all values from
timedatectl list-timezones will work, to easily see the impact of the changed value you can use one of the following values:
Once the configuration has been applied you can see the effect by connecting to the Device’s terminal, either via SSH or using the Remote Terminal, and executing the