Page MenuHomeDevCentral

D3085.id7875.diff
No OneTemporary

D3085.id7875.diff

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,32 @@
+#!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,30 @@
+# -------------------------------------------------------------
+# 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
+
+# -------------------------------------------------------------
+# Often
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+*/5 * * * * true
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

Mime Type
text/plain
Expires
Sun, Nov 24, 03:26 (56 m, 57 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259442
Default Alt Text
D3085.id7875.diff (2 KB)

Event Timeline