From 565047baa92d8a59860da40a7d0916b511929273 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sat, 24 Feb 2024 15:23:11 +0100 Subject: [PATCH] updated repo state --- README.md | 2 +- states/repo/defaults.yaml | 2 ++ states/{repos => repo}/init.sls | 0 states/{repos => repo}/install.sls | 4 ++-- states/repo/map.jinja | 5 +++++ states/{repos => repo}/prereqs.sls | 0 states/repos/defaults.yaml | 2 -- states/repos/map.jinja | 5 ----- 8 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 states/repo/defaults.yaml rename states/{repos => repo}/init.sls (100%) rename states/{repos => repo}/install.sls (92%) create mode 100644 states/repo/map.jinja rename states/{repos => repo}/prereqs.sls (100%) delete mode 100644 states/repos/defaults.yaml delete mode 100644 states/repos/map.jinja diff --git a/README.md b/README.md index 14e04fb..90dab84 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ states ├── rclone ├── reactor ├── redis -├── repos +├── repo ├── rspamd ├── rsync ├── rsyslog diff --git a/states/repo/defaults.yaml b/states/repo/defaults.yaml new file mode 100644 index 0000000..80a2f9e --- /dev/null +++ b/states/repo/defaults.yaml @@ -0,0 +1,2 @@ +--- +repo: {} diff --git a/states/repos/init.sls b/states/repo/init.sls similarity index 100% rename from states/repos/init.sls rename to states/repo/init.sls diff --git a/states/repos/install.sls b/states/repo/install.sls similarity index 92% rename from states/repos/install.sls rename to states/repo/install.sls index 25aafef..f6c98ac 100644 --- a/states/repos/install.sls +++ b/states/repo/install.sls @@ -1,6 +1,6 @@ --- -{%- from "repos/map.jinja" import repos with context %} -{%- for name,repo in repos.items() %} +{%- from "repo/map.jinja" import repo with context %} +{%- for name,repo in repo.items() %} {%- if repo.enabled %} {%- if repo.key_method is defined %} diff --git a/states/repo/map.jinja b/states/repo/map.jinja new file mode 100644 index 0000000..b722f3c --- /dev/null +++ b/states/repo/map.jinja @@ -0,0 +1,5 @@ +{%- import_yaml "repo/defaults.yaml" as default_settings -%} + +{%- set defaults = salt['grains.filter_by'](default_settings, default='repo') -%} + +{%- set repo = salt['pillar.get']('repo', default=defaults, merge=True) -%} diff --git a/states/repos/prereqs.sls b/states/repo/prereqs.sls similarity index 100% rename from states/repos/prereqs.sls rename to states/repo/prereqs.sls diff --git a/states/repos/defaults.yaml b/states/repos/defaults.yaml deleted file mode 100644 index 4c6a390..0000000 --- a/states/repos/defaults.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -repos: {} diff --git a/states/repos/map.jinja b/states/repos/map.jinja deleted file mode 100644 index 7ca4aef..0000000 --- a/states/repos/map.jinja +++ /dev/null @@ -1,5 +0,0 @@ -{%- import_yaml "repos/defaults.yaml" as default_settings -%} - -{%- set defaults = salt['grains.filter_by'](default_settings, default='repos') -%} - -{%- set repos = salt['pillar.get']('repos', default=defaults, merge=True) -%}