Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3751384
D1101.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D1101.diff
View Options
diff --git a/roles/core/timezone/init.sls b/roles/core/timezone/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/timezone/init.sls
@@ -0,0 +1,54 @@
+# -------------------------------------------------------------
+# Salt — Time zone
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-10-23
+# License: Trivial work, not eligible to copyright
+#
+# Dance, dance, to set timezone across OSes
+#
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Just write the timezone somewhere style
+# Well no, dpkg-reconfigure after
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains['os_family'] == 'Debian' %}
+/etc/timezone:
+ file.managed:
+ - contents: Etc/UTC
+
+update_timezone:
+ cmd.run:
+ - name: dpkg-reconfigure -f noninteractive tzdata
+ - onchanges:
+ - file: /etc/timezone
+{% endif %}
+
+# -------------------------------------------------------------
+# Symbolic link style
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains['os_family'] == 'RedHat' %}
+/etc/localtime:
+ file.symlink:
+ - target: /usr/share/zoneinfo/Etc/UTC
+{% endif %}
+
+# -------------------------------------------------------------
+# Just let the OS set the files with a command style
+# Okay, but WE need to know WHEN start this
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains['os'] == 'FreeBSD' %}
+/var/db/zoneinfo:
+ file.managed:
+ - contents: Etc/UTC
+
+update_timezone:
+ cmd.run:
+ - name: tzsetup Etc/UTC
+ - onchanges:
+ - file: /var/db/zoneinfo
+{% endif %}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 08:01 (20 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2250467
Default Alt Text
D1101.diff (1 KB)
Attached To
Mode
D1101: Set timezone
Attached
Detach File
Event Timeline
Log In to Comment