updated dkron and misc on states/modules
This commit is contained in:
parent
b2ec2328a8
commit
696aed5ea2
0
states/_modules/custom.py
Executable file → Normal file
0
states/_modules/custom.py
Executable file → Normal file
0
states/_states/custom.py
Executable file → Normal file
0
states/_states/custom.py
Executable file → Normal file
@ -4,16 +4,13 @@ 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=[]):
|
||||
def jobs(name, url="http://localhost:8080", verify=False, jobs_list=[]):
|
||||
ret = {'name': name,
|
||||
'changes': {},
|
||||
'result': True,
|
||||
'comment': 'Config is up to date'}
|
||||
|
||||
#dk_jobs = []
|
||||
#dk_jobs = __salt__['dkron.get_jobs'](url, verify)
|
||||
|
||||
for job in jobs:
|
||||
for job in jobs_list:
|
||||
res = __salt__['dkron.set_jobs'](url, verify, job)
|
||||
if res is not None:
|
||||
ret['changes'][job['name']] = res
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
{%- from "dkron/map.jinja" import dkron with context -%}
|
||||
{%- from "dkron/map.jinja" import dkron with context %}
|
||||
dkron-config-dir:
|
||||
file.directory:
|
||||
- name: /etc/dkron
|
||||
|
@ -17,4 +17,4 @@ dkron:
|
||||
server: true
|
||||
http-addr: "127.0.0.1:8898"
|
||||
data-dir: "/var/lib/dkron"
|
||||
jobs: []
|
||||
jobs_list: []
|
||||
|
@ -5,4 +5,4 @@ dkron-jobs:
|
||||
- name: dkron-jobs
|
||||
- url: {{ dkron.url }}
|
||||
- verify: {{ dkron.verify }}
|
||||
- job_list: {{ dkron.jobs }}
|
||||
- jobs_list: {{ dkron.jobs_list }}
|
||||
|
Loading…
Reference in New Issue
Block a user