From 696aed5ea214f590796733dcd224d7818058ccda Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Mon, 30 Nov 2020 22:29:10 +0100 Subject: [PATCH] updated dkron and misc on states/modules --- states/_modules/custom.py | 0 states/_states/custom.py | 0 states/_states/dkron.py | 7 ++----- states/dkron/config.sls | 4 ++-- states/dkron/defaults.yaml | 2 +- states/dkron/jobs.sls | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) mode change 100755 => 100644 states/_modules/custom.py mode change 100755 => 100644 states/_states/custom.py diff --git a/states/_modules/custom.py b/states/_modules/custom.py old mode 100755 new mode 100644 diff --git a/states/_states/custom.py b/states/_states/custom.py old mode 100755 new mode 100644 diff --git a/states/_states/dkron.py b/states/_states/dkron.py index 6bc4555..31b0148 100644 --- a/states/_states/dkron.py +++ b/states/_states/dkron.py @@ -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 diff --git a/states/dkron/config.sls b/states/dkron/config.sls index b02c973..221231e 100644 --- a/states/dkron/config.sls +++ b/states/dkron/config.sls @@ -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 \ No newline at end of file + - service: dkron-service diff --git a/states/dkron/defaults.yaml b/states/dkron/defaults.yaml index e6b6969..aae740e 100644 --- a/states/dkron/defaults.yaml +++ b/states/dkron/defaults.yaml @@ -17,4 +17,4 @@ dkron: server: true http-addr: "127.0.0.1:8898" data-dir: "/var/lib/dkron" - jobs: [] + jobs_list: [] diff --git a/states/dkron/jobs.sls b/states/dkron/jobs.sls index 1240dbe..4758ac9 100644 --- a/states/dkron/jobs.sls +++ b/states/dkron/jobs.sls @@ -5,4 +5,4 @@ dkron-jobs: - name: dkron-jobs - url: {{ dkron.url }} - verify: {{ dkron.verify }} - - job_list: {{ dkron.jobs }} + - jobs_list: {{ dkron.jobs_list }}