Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F8322033
cron.sls
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
935 B
Referenced Files
None
Subscribers
None
cron.sls
View Options
#!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)
}
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Tue, May 13, 16:58 (4 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573890
Default Alt Text
cron.sls (935 B)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment