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) -%}