From 11ba75ca5c0723fbfa36b0737d3da50125b1f596 Mon Sep 17 00:00:00 2001 From: Dafydd Jones Date: Fri, 10 Nov 2023 14:38:19 +0000 Subject: [PATCH 1/3] test(pre-commit): switch to using `pre-commit`'s built-in file filtering * only run `yamllint` when relevant files have changed * avoids having to exclude files/dirs not tracked by Git e.g. .kitchen/, .bundle/ etc. * avoids a `yamllint` bug whereby pillar files under `test/` were not checked due to a conflicting `ignore` entry --- .pre-commit-config.yaml | 30 +++++++++++++++++++++++++++--- .yamllint | 31 ------------------------------- 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b9617222..12a5225b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,9 +45,33 @@ repos: hooks: - id: yamllint name: Check YAML syntax with yamllint - args: [--strict, '.'] - always_run: true - pass_filenames: false + args: [--strict] + types: [file] + # Files to include + # 1. Obvious YAML files + # 2. `pillar.example` and similar files + # 3. SLS files under directory `test/` which are pillar files + # Files to exclude + # 1. SLS files under directory `test/` which are state files + # 2. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax + # 3. YAML files heavily reliant on Jinja + files: | + (?x)^( + .*\.yaml| + .*\.yml| + \.salt-lint| + \.yamllint| + .*\.example| + test/.*\.sls + )$ + exclude: | + (?x)^( + kitchen.vagrant.yml| + test/.*/states/.*\.sls| + salt/osfamilymap.yaml| + salt/osmap.yaml| + salt/osfingermap.yaml + )$ - repo: https://github.com/warpnet/salt-lint rev: v0.9.2 hooks: diff --git a/.yamllint b/.yamllint index ada644b86..b40878840 100644 --- a/.yamllint +++ b/.yamllint @@ -4,37 +4,6 @@ # Extend the `default` configuration provided by `yamllint` extends: 'default' -# Files to ignore completely -# 1. All YAML files under directory `.bundle/`, introduced if gems are installed locally -# 2. All YAML files under directory `.cache/`, introduced during the CI run -# 3. All YAML files under directory `.git/` -# 4. All YAML files under directory `node_modules/`, introduced during the CI run -# 5. Any SLS files under directory `test/`, which are actually state files -# 6. Any YAML files under directory `.kitchen/`, introduced during local testing -# 7. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax -# 8. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR -ignore: | - .bundle/ - .cache/ - .git/ - node_modules/ - test/**/states/**/*.sls - .kitchen/ - kitchen.vagrant.yml - salt/osfamilymap.yaml - salt/osmap.yaml - salt/osfingermap.yaml - -yaml-files: - # Default settings - - '*.yaml' - - '*.yml' - - .salt-lint - - .yamllint - # SaltStack Formulas additional settings - - '*.example' - - test/**/*.sls - rules: empty-values: forbid-in-block-mappings: true From f033f904a3a55481540aecbae1d84cc4d89800bd Mon Sep 17 00:00:00 2001 From: Dafydd Jones Date: Mon, 4 Dec 2023 21:00:06 +0000 Subject: [PATCH 2/3] ci: update container images --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2fbb55c69..e2e35e096 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,8 +14,8 @@ stage_test: &stage_test 'test' # `image` image_commitlint: &image_commitlint 'myii/ssf-commitlint:11' - image_dindruby: &image_dindruby 'dafyddj/ci-dind-python-ruby:2.0.0' - image_precommit: &image_precommit 'dafyddj/ci-pre-commit:2.0.2' + image_dindruby: &image_dindruby 'dafyddj/ci-dind-python-ruby:2.0.2' + image_precommit: &image_precommit 'dafyddj/ci-pre-commit:2.1.0' image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest' image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14' # `services` From 6e688e0ff0a723d87c2dfbc8b8b844f985ff94d2 Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Tue, 6 Feb 2024 17:04:54 +0900 Subject: [PATCH 3/3] fix(config): master_job_cache in saltmaster jinja --- salt/files/master.d/f_defaults.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/salt/files/master.d/f_defaults.conf b/salt/files/master.d/f_defaults.conf index 16aecc7ad..d3c77bd5e 100644 --- a/salt/files/master.d/f_defaults.conf +++ b/salt/files/master.d/f_defaults.conf @@ -80,6 +80,11 @@ # {{ get_config('cachedir', '/var/cache/salt/master') }} +# Specify the returner to use for the job cache. The job cache will only be +# interacted with from the salt master and therefore does not need to be +# accessible from the minions. +{{ get_config('master_job_cache', 'local_cache') }} + # Directory for custom modules. This directory can contain subdirectories for # each of Salt's module types such as "runners", "output", "wheel", "modules", # "states", "returners", etc. @@ -1223,7 +1228,7 @@ ext_pillar: {%- endif %} {%- endfor -%} {%- elif pillar[key] is mapping and pillar[key] is not string %} - - {{ key }}: + - {{ key }}: {%- for parameter in pillar[key] %} {{ parameter }}: {{pillar[key][parameter]}} {%- endfor %}