paulbsd-salt/states/_states/dkron.py
Paul Lecuq 3da7d4e3d7
All checks were successful
continuous-integration/drone/push Build is passing
updated _states state
2023-03-10 00:09:10 +01:00

23 lines
569 B
Python

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