updated dkron and misc on states/modules

This commit is contained in:
Paul 2020-11-30 22:29:10 +01:00
parent b2ec2328a8
commit 696aed5ea2
6 changed files with 6 additions and 9 deletions

0
states/_modules/custom.py Executable file → Normal file
View File

0
states/_states/custom.py Executable file → Normal file
View File

View 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

View File

@ -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
@ -12,4 +12,4 @@ dkron-config:
- user: {{ dkron.runuser }}
- template: jinja
- watch_in:
- service: dkron-service
- service: dkron-service

View File

@ -17,4 +17,4 @@ dkron:
server: true
http-addr: "127.0.0.1:8898"
data-dir: "/var/lib/dkron"
jobs: []
jobs_list: []

View File

@ -5,4 +5,4 @@ dkron-jobs:
- name: dkron-jobs
- url: {{ dkron.url }}
- verify: {{ dkron.verify }}
- job_list: {{ dkron.jobs }}
- jobs_list: {{ dkron.jobs_list }}