Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3767313
D3085.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D3085.diff
View Options
diff --git a/roles/devserver/userland-home/cron.sls b/roles/devserver/userland-home/cron.sls
new file mode 100644
--- /dev/null
+++ b/roles/devserver/userland-home/cron.sls
@@ -0,0 +1,36 @@
+#!py
+
+# -------------------------------------------------------------
+# Salt — Provision user content
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+
+def get_cron_path(user):
+ """Get source cron path in operations repository."""
+ return f"roles/devserver/userland-home/files/_crons/{user}"
+
+
+def has_crontab(user):
+ return salt["slsutil.file_exists"](get_cron_path(user))
+
+
+def build_cron_file(user):
+ cron_source_path = get_cron_path(user)
+
+ return {
+ "cron.file": [
+ {"name": f"salt://{cron_source_path}"},
+ {"user": user},
+ ]
+ }
+
+
+def run():
+ return {
+ f"devserver_crontab_{user}": build_cron_file(user)
+ for user in salt["forest.get_users"]()
+ if has_crontab(user)
+ }
diff --git a/roles/devserver/userland-home/files/_crons/dereckson b/roles/devserver/userland-home/files/_crons/dereckson
new file mode 100644
--- /dev/null
+++ b/roles/devserver/userland-home/files/_crons/dereckson
@@ -0,0 +1,25 @@
+
+# -------------------------------------------------------------
+# Cron :: dereckson
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/devserver/userland-home/files/_crons/dereckson
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+HOME=/home/dereckson
+PATH=/bin:/usr/bin:/usr/games:/usr/local/bin:$HOME/bin
+LANG=en_US.UTF-8
+
+# -------------------------------------------------------------
+# Events
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+@reboot ssh-agent -c | grep -v echo > $HOME/bin/ssh-agent-session
diff --git a/roles/devserver/userland-home/init.sls b/roles/devserver/userland-home/init.sls
--- a/roles/devserver/userland-home/init.sls
+++ b/roles/devserver/userland-home/init.sls
@@ -9,3 +9,4 @@
include:
- .homefiles
- .repos
+ - .cron
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 23:28 (19 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259172
Default Alt Text
D3085.diff (2 KB)
Attached To
Mode
D3085: Deploy crontabon devserver role
Attached
Detach File
Event Timeline
Log In to Comment