Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12297922
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
View Options
diff --git a/roles/core/timezone/init.sls b/roles/core/timezone/init.sls
new file mode 100644
index 0000000..77a205a
--- /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/x-diff
Expires
Wed, Oct 22, 13:42 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3092268
Default Alt Text
(1 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment