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.dictupdate
|
||||||
import salt.utils.dictdiffer
|
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,
|
ret = {'name': name,
|
||||||
'changes': {},
|
'changes': {},
|
||||||
'result': True,
|
'result': True,
|
||||||
'comment': 'Config is up to date'}
|
'comment': 'Config is up to date'}
|
||||||
|
|
||||||
#dk_jobs = []
|
for job in jobs_list:
|
||||||
#dk_jobs = __salt__['dkron.get_jobs'](url, verify)
|
|
||||||
|
|
||||||
for job in jobs:
|
|
||||||
res = __salt__['dkron.set_jobs'](url, verify, job)
|
res = __salt__['dkron.set_jobs'](url, verify, job)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
ret['changes'][job['name']] = res
|
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:
|
dkron-config-dir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /etc/dkron
|
- name: /etc/dkron
|
||||||
@ -12,4 +12,4 @@ dkron-config:
|
|||||||
- user: {{ dkron.runuser }}
|
- user: {{ dkron.runuser }}
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: dkron-service
|
- service: dkron-service
|
||||||
|
@ -17,4 +17,4 @@ dkron:
|
|||||||
server: true
|
server: true
|
||||||
http-addr: "127.0.0.1:8898"
|
http-addr: "127.0.0.1:8898"
|
||||||
data-dir: "/var/lib/dkron"
|
data-dir: "/var/lib/dkron"
|
||||||
jobs: []
|
jobs_list: []
|
||||||
|
@ -5,4 +5,4 @@ dkron-jobs:
|
|||||||
- name: dkron-jobs
|
- name: dkron-jobs
|
||||||
- url: {{ dkron.url }}
|
- url: {{ dkron.url }}
|
||||||
- verify: {{ dkron.verify }}
|
- verify: {{ dkron.verify }}
|
||||||
- job_list: {{ dkron.jobs }}
|
- jobs_list: {{ dkron.jobs_list }}
|
||||||
|
Loading…
Reference in New Issue
Block a user