updated config state

This commit is contained in:
Paul 2022-01-25 00:16:58 +01:00
parent 05bb86ec53
commit 7ca49ea62c
3 changed files with 16 additions and 5 deletions

View File

@ -0,0 +1,2 @@
{%- from "config/map.jinja" import config with context -%}
{{ config.config|json }}

View File

@ -2,5 +2,6 @@
config:
enabled: true
install_dir: "/usr/local/apps/config"
filename: "common.ini"
ini_filename: "common.ini"
json_filename: "common.json"
config: {}

View File

@ -6,14 +6,22 @@ config-dir:
- user: root
- mode: "0755"
config-file:
config-ini-create:
file.managed:
- name: {{ config.install_dir }}/{{ config.filename }}
- name: {{ config.install_dir }}/{{ config.ini_filename }}
- user: root
- mode: "0755"
config-file-config:
config-ini-content:
ini.options_present:
- name: {{ config.install_dir }}/{{ config.filename }}
- name: {{ config.install_dir }}/{{ config.ini_filename }}
- separator: '='
- sections: {{ config.config }}
config-json-content:
file.managed:
- name: {{ config.install_dir }}/{{ config.json_filename }}
- source: salt://config/config.json.j2
- user: root
- mode: "0755"
- template: jinja