22 lines
618 B
Python
22 lines
618 B
Python
#!/usr/bin/python3
|
|
|
|
from __future__ import absolute_import, print_function, unicode_literals
|
|
import salt.utils.dictupdate
|
|
import salt.utils.dictdiffer
|
|
|
|
def jobs(name, url="http://localhost:8080", verify=False, jobs_list=[]):
|
|
ret = {'name': name,
|
|
'changes': {},
|
|
'result': True,
|
|
'comment': 'Config is up to date'}
|
|
|
|
for job in jobs_list:
|
|
res = __salt__['dkron.set_jobs'](url, verify, job)
|
|
if res is not None:
|
|
ret['changes'][job['name']] = res
|
|
else:
|
|
ret['result'] = False
|
|
ret['comment'] = "Error occured"
|
|
|
|
return ret
|