From 5f5f3945cd42cf98b098a906252a951268b1f175 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Mon, 16 Jan 2023 12:01:49 +0100 Subject: [PATCH] updated provision state --- states/provision/defaults.yaml | 11 ++++++++--- states/provision/init.sls | 5 +++-- states/provision/map.jinja | 6 ++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/states/provision/defaults.yaml b/states/provision/defaults.yaml index e69109a..bee7eff 100644 --- a/states/provision/defaults.yaml +++ b/states/provision/defaults.yaml @@ -2,9 +2,14 @@ specs: enabled: true type: none - entity: none - country: none - location: none + org: none + country: None + location: None cloud: false container: false sudo: true + lb: false + +provision: + highstate_interval: 30 + clear_cache_interval: 7 diff --git a/states/provision/init.sls b/states/provision/init.sls index 2d9c7d8..f6248ed 100644 --- a/states/provision/init.sls +++ b/states/provision/init.sls @@ -1,17 +1,18 @@ --- +{%- from "provision/map.jinja" import provision with context %} {%- from "provision/map.jinja" import specs with context %} schedule_highstate: schedule.present: - name: schedule_highstate - function: state.highstate - - minutes: 30 + - minutes: {{ provision.highstate_interval }} - run_on_start: false schedule_saltutil_clear_cache: schedule.present: - name: schedule_saltutil_clear_cache - function: saltutil.clear_cache - - days: 7 + - days: {{ provision.clear_cache_interval }} - run_on_start: false {% for key, value in specs.items() %} diff --git a/states/provision/map.jinja b/states/provision/map.jinja index e1b5fc6..2095fe1 100644 --- a/states/provision/map.jinja +++ b/states/provision/map.jinja @@ -1,5 +1,7 @@ {%- import_yaml "provision/defaults.yaml" as default_settings -%} -{%- set defaults = salt['grains.filter_by'](default_settings, default='specs') -%} +{%- set defaults_specs = salt['grains.filter_by'](default_settings, default='specs') -%} +{%- set defaults_provision = salt['grains.filter_by'](default_settings, default='provision') -%} -{%- set specs = salt['pillar.get']('specs', default=defaults, merge=True) -%} \ No newline at end of file +{%- set specs = salt['pillar.get']('specs', default=defaults_specs, merge=True) -%} +{%- set provision = salt['pillar.get']('provision', default=defaults_provision, merge=True) -%}