Allow setting of timezone #26

Closed
opened 2016-06-27 08:41:44 +02:00 by alanorth · 4 comments
alanorth commented 2016-06-27 08:41:44 +02:00 (Migrated from github.com)

If I provision a server and I know it's in the Europe/Berlin timezone, it would be nice to be able to set a variable for that and have ansible set that timezone. On Ubuntu 16.04 and other systems that use systemd, this should use probably use timedatectl. Example:

# timedatectl set-timezone `Europe/Berlin`
If I provision a server and I know it's in the `Europe/Berlin` timezone, it would be nice to be able to set a variable for that and have ansible set that timezone. On Ubuntu 16.04 and other systems that use systemd, this should use probably use `timedatectl`. Example: ``` # timedatectl set-timezone `Europe/Berlin` ```
alanorth commented 2016-06-27 08:43:36 +02:00 (Migrated from github.com)

See someone's ansible command that probably works:

- name: Set TimeZone in /etc/localtime
  command: /usr/bin/timedatectl set-timezone America/Chicago
See someone's [ansible command that probably works](https://github.com/maxamillion/ansible-maxamillion.sh/blob/master/roles/common/tasks/timedatectl.yml): ``` - name: Set TimeZone in /etc/localtime command: /usr/bin/timedatectl set-timezone America/Chicago ```
alanorth commented 2016-06-27 10:53:30 +02:00 (Migrated from github.com)

Might want to look into this for Ubuntu 16.04, @oguya.

Might want to look into this for Ubuntu 16.04, @oguya.
Brainiarc7 commented 2016-06-27 12:29:21 +02:00 (Migrated from github.com)

Nice, quite useful.

Nice, quite useful.
alanorth commented 2016-06-27 13:34:16 +02:00 (Migrated from github.com)

Actually, I'm not sure if "regular" Ubuntu 16.04 server installs start systemd's NTP client service by default, but Linode and Digital Ocean instances do. Maybe starting the service isn't necessary actually.

Actually, I'm not sure if "regular" Ubuntu 16.04 server installs start systemd's NTP client service by default, but Linode and Digital Ocean instances do. Maybe starting the service isn't necessary actually.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: alanorth/ansible-personal#26
No description provided.