├── .github └── workflows │ ├── commitlint.yml │ ├── kitchen.vagrant.yml │ └── kitchen.windows.yml ├── .gitignore ├── .gitlab-ci.yml ├── .pre-commit-config.yaml ├── .rstcheck.cfg ├── .rubocop.yml ├── .salt-lint ├── .travis.yml ├── .yamllint ├── AUTHORS.md ├── CHANGELOG.md ├── CODEOWNERS ├── FORMULA ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── bin ├── install-hooks └── kitchen ├── commitlint.config.js ├── docs ├── AUTHORS.rst ├── CHANGELOG.rst ├── README.rst └── TOFS_pattern.rst ├── kitchen.vagrant.yml ├── kitchen.windows.yml ├── kitchen.yml ├── node ├── _mapdata │ ├── _mapdata.jinja │ └── init.sls ├── archive │ ├── clean.sls │ ├── init.sls │ └── install.sls ├── clean.sls ├── config.sls ├── config │ ├── clean.sls │ ├── environ.sls │ ├── file.sls │ └── init.sls ├── defaults.yaml ├── files │ ├── default │ │ ├── environ.sh.jinja │ │ └── npmrc.default.jinja │ └── macros.jinja ├── init.sls ├── libtofs.jinja ├── map.jinja ├── osarchmap.yaml ├── oscodenamemap.yaml ├── osfamilymap.yaml ├── osfingermap.yaml ├── osmap.yaml ├── package │ ├── clean.sls │ ├── init.sls │ ├── install.sls │ └── repo │ │ ├── clean.sls │ │ ├── init.sls │ │ └── install.sls ├── pkg.sls └── source │ ├── clean.sls │ ├── init.sls │ └── install.sls ├── pillar.example ├── pre-commit_semantic-release.sh ├── release-rules.js ├── release.config.js └── test ├── integration ├── archive │ ├── README.md │ ├── controls │ │ ├── binary_spec.rb │ │ ├── config_spec.rb │ │ └── environ_spec.rb │ └── inspec.yml ├── default │ ├── README.md │ ├── controls │ │ ├── config_spec.rb │ │ ├── environ_spec.rb │ │ └── packages_spec.rb │ └── inspec.yml ├── share │ ├── README.md │ ├── inspec.yml │ └── libraries │ │ └── system.rb └── source │ ├── README.md │ ├── controls │ ├── config_spec.rb │ ├── environ_spec.rb │ └── source_spec.rb │ └── inspec.yml └── salt └── pillar ├── archive.sls ├── default.sls ├── repo.sls └── source.sls /.github/workflows/commitlint.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: Commitlint 5 | 'on': [pull_request] 6 | 7 | jobs: 8 | lint: 9 | runs-on: ubuntu-latest 10 | env: 11 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 12 | steps: 13 | - uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | - uses: wagoid/commitlint-github-action@v1 17 | -------------------------------------------------------------------------------- /.github/workflows/kitchen.vagrant.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: 'Kitchen Vagrant (FreeBSD, OpenBSD & Windows)' 5 | 'on': ['push', 'pull_request'] 6 | 7 | env: 8 | KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml' 9 | 10 | jobs: 11 | test: 12 | runs-on: 'macos-10.15' 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | instance: 17 | - default-freebsd-130-master-py3 18 | # - archive-freebsd-130-master-py3 19 | # - source-freebsd-130-master-py3 20 | # - repo-freebsd-130-master-py3 21 | - default-freebsd-123-master-py3 22 | # - archive-freebsd-123-master-py3 23 | # - source-freebsd-123-master-py3 24 | # - repo-freebsd-123-master-py3 25 | # - default-freebsd-130-3004-0-py3 26 | # - default-freebsd-123-3004-0-py3 27 | - default-openbsd-70-3003-3-py3 28 | # - archive-openbsd-70-3003-3-py3 29 | - default-windows-10-latest-py3 30 | # - archive-windows-10-latest-py3 31 | - default-windows-81-latest-py3 32 | # - archive-windows-81-latest-py3 33 | steps: 34 | - name: 'Check out code' 35 | uses: 'actions/checkout@v2' 36 | - name: 'Set up Bundler cache' 37 | uses: 'actions/cache@v1' 38 | with: 39 | path: 'vendor/bundle' 40 | key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" 41 | restore-keys: "${{ runner.os }}-gems-" 42 | - name: 'Run Bundler' 43 | run: | 44 | ruby --version 45 | bundle config path vendor/bundle 46 | bundle install --jobs 4 --retry 3 47 | - name: 'Run Test Kitchen' 48 | run: 'bundle exec kitchen verify ${{ matrix.instance }}' 49 | -------------------------------------------------------------------------------- /.github/workflows/kitchen.windows.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: 'Kitchen (Windows)' 5 | 'on': ['push', 'pull_request'] 6 | 7 | env: 8 | machine_user: kitchen 9 | machine_pass: Pass@word1 10 | machine_port: 5985 11 | KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' 12 | 13 | jobs: 14 | test-2022: 15 | runs-on: 'windows-2022' 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | instance: 20 | - default-windows-2022-latest-py3 21 | # - archive-windows-2022-latest-py3 22 | steps: 23 | - name: 'Check out code' 24 | uses: 'actions/checkout@v2' 25 | - name: 'Install Chef' 26 | uses: 'actionshub/chef-install@1.1.0' 27 | with: 28 | project: 'chef' 29 | version: '16.10.8' 30 | - name: 'Add Chef bindir to PATH' 31 | uses: 'myci-actions/export-env-var-powershell@1' 32 | with: 33 | name: 'PATH' 34 | value: "C:\\opscode\\chef\\bin;\ 35 | C:\\opscode\\chef\\embedded\\bin;$env:PATH" 36 | - name: 'Set up Bundler cache' 37 | uses: 'actions/cache@v1' 38 | with: 39 | path: 'vendor/bundle' 40 | key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" 41 | restore-keys: "${{ runner.os }}-gems-" 42 | - name: 'Set up test user' 43 | run: | 44 | $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force 45 | New-LocalUser $env:machine_user -Password $password 46 | Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user 47 | - name: 'Set up WinRM' 48 | run: | 49 | Set-WSManQuickConfig -Force 50 | - name: 'Run Bundler' 51 | run: | 52 | ruby --version 53 | bundle config path vendor/bundle 54 | bundle install --jobs 4 --retry 3 55 | - name: 'Run Test Kitchen' 56 | run: 'bundle exec kitchen verify ${{ matrix.instance }}' 57 | test-2019: 58 | runs-on: 'windows-2019' 59 | strategy: 60 | fail-fast: false 61 | matrix: 62 | instance: 63 | - default-windows-2019-latest-py3 64 | # - archive-windows-2019-latest-py3 65 | steps: 66 | - name: 'Check out code' 67 | uses: 'actions/checkout@v2' 68 | - name: 'Install Chef' 69 | uses: 'actionshub/chef-install@1.1.0' 70 | with: 71 | project: 'chef' 72 | version: '16.10.8' 73 | - name: 'Add Chef bindir to PATH' 74 | uses: 'myci-actions/export-env-var-powershell@1' 75 | with: 76 | name: 'PATH' 77 | value: "C:\\opscode\\chef\\bin;\ 78 | C:\\opscode\\chef\\embedded\\bin;$env:PATH" 79 | - name: 'Set up Bundler cache' 80 | uses: 'actions/cache@v1' 81 | with: 82 | path: 'vendor/bundle' 83 | key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" 84 | restore-keys: "${{ runner.os }}-gems-" 85 | - name: 'Set up test user' 86 | run: | 87 | $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force 88 | New-LocalUser $env:machine_user -Password $password 89 | Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user 90 | - name: 'Set up WinRM' 91 | run: | 92 | Set-WSManQuickConfig -Force 93 | - name: 'Run Bundler' 94 | run: | 95 | ruby --version 96 | bundle config path vendor/bundle 97 | bundle install --jobs 4 --retry 3 98 | - name: 'Run Test Kitchen' 99 | run: 'bundle exec kitchen verify ${{ matrix.instance }}' 100 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a packager 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .kitchen 49 | .kitchen.local.yml 50 | kitchen.local.yml 51 | junit-*.xml 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | 61 | # Flask stuff: 62 | instance/ 63 | .webassets-cache 64 | 65 | # Scrapy stuff: 66 | .scrapy 67 | 68 | # Sphinx documentation 69 | docs/_build/ 70 | 71 | # PyBuilder 72 | target/ 73 | 74 | # Jupyter Notebook 75 | .ipynb_checkpoints 76 | 77 | # pyenv 78 | .python-version 79 | 80 | # celery beat schedule file 81 | celerybeat-schedule 82 | 83 | # SageMath parsed files 84 | *.sage.py 85 | 86 | # dotenv 87 | .env 88 | 89 | # virtualenv 90 | .venv 91 | venv/ 92 | ENV/ 93 | 94 | # visual studio 95 | .vs/ 96 | 97 | # Spyder project settings 98 | .spyderproject 99 | .spyproject 100 | 101 | # Rope project settings 102 | .ropeproject 103 | 104 | # mkdocs documentation 105 | /site 106 | 107 | # mypy 108 | .mypy_cache/ 109 | 110 | # Bundler 111 | .bundle/ 112 | 113 | # copied `.md` files used for conversion to `.rst` using `m2r` 114 | docs/*.md 115 | 116 | # Vim 117 | *.sw? 118 | 119 | ## Collected when centralising formulas (check and sort) 120 | # `collectd-formula` 121 | .pytest_cache/ 122 | /.idea/ 123 | Dockerfile.*_* 124 | ignore/ 125 | tmp/ 126 | 127 | # `salt-formula` -- Vagrant Specific files 128 | .vagrant 129 | top.sls 130 | !test/salt/pillar/top.sls 131 | 132 | # `suricata-formula` -- Platform binaries 133 | *.rpm 134 | *.deb 135 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | ############################################################################### 5 | # Define all YAML node anchors 6 | ############################################################################### 7 | .node_anchors: 8 | # `only` (also used for `except` where applicable) 9 | only_branch_master_parent_repo: &only_branch_master_parent_repo 10 | - 'master@saltstack-formulas/node-formula' 11 | # `stage` 12 | stage_lint: &stage_lint 'lint' 13 | stage_release: &stage_release 'release' 14 | stage_test: &stage_test 'test' 15 | # `image` 16 | image_commitlint: &image_commitlint 'myii/ssf-commitlint:11' 17 | image_dindruby: &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3' 18 | image_precommit: &image_precommit 19 | name: 'myii/ssf-pre-commit:2.9.2' 20 | entrypoint: ['/bin/bash', '-c'] 21 | image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest' 22 | image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14' 23 | # `services` 24 | services_docker_dind: &services_docker_dind 25 | - 'docker:dind' 26 | # `variables` 27 | # https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3 28 | # https://bundler.io/v1.16/bundle_config.html 29 | variables_bundler: &variables_bundler 30 | BUNDLE_CACHE_PATH: '${CI_PROJECT_DIR}/.cache/bundler' 31 | BUNDLE_WITHOUT: 'production' 32 | # `cache` 33 | cache_bundler: &cache_bundler 34 | key: '${CI_JOB_STAGE}' 35 | paths: 36 | - '${BUNDLE_CACHE_PATH}' 37 | 38 | ############################################################################### 39 | # Define stages and global variables 40 | ############################################################################### 41 | stages: 42 | - *stage_lint 43 | - *stage_test 44 | - *stage_release 45 | variables: 46 | DOCKER_DRIVER: 'overlay2' 47 | 48 | ############################################################################### 49 | # `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed) 50 | ############################################################################### 51 | commitlint: 52 | stage: *stage_lint 53 | image: *image_commitlint 54 | script: 55 | # Add `upstream` remote to get access to `upstream/master` 56 | - 'git remote add upstream 57 | https://gitlab.com/saltstack-formulas/node-formula.git' 58 | - 'git fetch --all' 59 | # Set default commit hashes for `--from` and `--to` 60 | - 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"' 61 | - 'export COMMITLINT_TO="${CI_COMMIT_SHA}"' 62 | # `coqbot` adds a merge commit to test PRs on top of the latest commit in 63 | # the repo; amend this merge commit message to avoid failure 64 | - | 65 | if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \ 66 | && [ "${CI_COMMIT_BRANCH}" != "master" ]; then 67 | git commit --amend -m \ 68 | 'chore: reword coqbot merge commit message for commitlint' 69 | export COMMITLINT_TO=HEAD 70 | fi 71 | # Run `commitlint` 72 | - 'commitlint --from "${COMMITLINT_FROM}" 73 | --to "${COMMITLINT_TO}" 74 | --verbose' 75 | 76 | pre-commit: 77 | stage: *stage_lint 78 | image: *image_precommit 79 | # https://pre-commit.com/#gitlab-ci-example 80 | variables: 81 | PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit' 82 | cache: 83 | key: '${CI_JOB_NAME}' 84 | paths: 85 | - '${PRE_COMMIT_HOME}' 86 | script: 87 | - 'pre-commit run --all-files --color always --verbose' 88 | 89 | # Use a separate job for `rubocop` other than the one potentially run by `pre-commit` 90 | # - The `pre-commit` check will only be available for formulas that pass the default 91 | # `rubocop` check -- and must continue to do so 92 | # - This job is allowed to fail, so can be used for all formulas 93 | # - Furthermore, this job uses all of the latest `rubocop` features & cops, 94 | # which will help when upgrading the `rubocop` linter used in `pre-commit` 95 | rubocop: 96 | allow_failure: true 97 | stage: *stage_lint 98 | image: *image_rubocop 99 | script: 100 | - 'rubocop -d -P -S --enable-pending-cops' 101 | 102 | ############################################################################### 103 | # Define `test` template 104 | ############################################################################### 105 | .test_instance: &test_instance 106 | stage: *stage_test 107 | image: *image_dindruby 108 | services: *services_docker_dind 109 | variables: *variables_bundler 110 | cache: *cache_bundler 111 | before_script: 112 | # TODO: This should work from the env vars above automatically 113 | - 'bundle config set path "${BUNDLE_CACHE_PATH}"' 114 | - 'bundle config set without "${BUNDLE_WITHOUT}"' 115 | - 'bundle install' 116 | script: 117 | # Alternative value to consider: `${CI_JOB_NAME}` 118 | - 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"' 119 | 120 | ############################################################################### 121 | # Define `test` template (`allow_failure: true`) 122 | ############################################################################### 123 | .test_instance_failure_permitted: 124 | <<: *test_instance 125 | allow_failure: true 126 | 127 | ############################################################################### 128 | # `test` stage: each instance below uses the `test` template above 129 | ############################################################################### 130 | ## Define the rest of the matrix based on Kitchen testing 131 | # Make sure the instances listed below match up with 132 | # the `platforms` defined in `kitchen.yml` 133 | # yamllint disable rule:line-length 134 | # default-debian-11-tiamat-py3: {extends: '.test_instance'} 135 | # default-debian-10-tiamat-py3: {extends: '.test_instance'} 136 | # default-debian-9-tiamat-py3: {extends: '.test_instance'} 137 | # default-ubuntu-2204-tiamat-py3: {extends: '.test_instance_failure_permitted'} 138 | # default-ubuntu-2004-tiamat-py3: {extends: '.test_instance'} 139 | # default-ubuntu-1804-tiamat-py3: {extends: '.test_instance'} 140 | # default-centos-stream8-tiamat-py3: {extends: '.test_instance_failure_permitted'} 141 | # default-centos-7-tiamat-py3: {extends: '.test_instance'} 142 | # default-amazonlinux-2-tiamat-py3: {extends: '.test_instance'} 143 | # default-oraclelinux-8-tiamat-py3: {extends: '.test_instance'} 144 | # default-oraclelinux-7-tiamat-py3: {extends: '.test_instance'} 145 | # default-almalinux-8-tiamat-py3: {extends: '.test_instance'} 146 | # default-rockylinux-8-tiamat-py3: {extends: '.test_instance'} 147 | # default-debian-11-master-py3: {extends: '.test_instance'} 148 | # archive-debian-11-master-py3: {extends: '.test_instance'} 149 | # source-debian-11-master-py3: {extends: '.test_instance'} 150 | repo-debian-11-master-py3: {extends: '.test_instance_failure_permitted'} 151 | # default-debian-10-master-py3: {extends: '.test_instance'} 152 | # archive-debian-10-master-py3: {extends: '.test_instance'} 153 | # source-debian-10-master-py3: {extends: '.test_instance'} 154 | repo-debian-10-master-py3: {extends: '.test_instance'} 155 | # default-debian-9-master-py3: {extends: '.test_instance'} 156 | # archive-debian-9-master-py3: {extends: '.test_instance'} 157 | # source-debian-9-master-py3: {extends: '.test_instance'} 158 | repo-debian-9-master-py3: {extends: '.test_instance'} 159 | # default-ubuntu-2204-master-py3: {extends: '.test_instance_failure_permitted'} 160 | # archive-ubuntu-2204-master-py3: {extends: '.test_instance_failure_permitted'} 161 | # source-ubuntu-2204-master-py3: {extends: '.test_instance_failure_permitted'} 162 | repo-ubuntu-2204-master-py3: {extends: '.test_instance_failure_permitted'} 163 | # default-ubuntu-2004-master-py3: {extends: '.test_instance'} 164 | # archive-ubuntu-2004-master-py3: {extends: '.test_instance'} 165 | # source-ubuntu-2004-master-py3: {extends: '.test_instance'} 166 | repo-ubuntu-2004-master-py3: {extends: '.test_instance'} 167 | # default-ubuntu-1804-master-py3: {extends: '.test_instance'} 168 | # archive-ubuntu-1804-master-py3: {extends: '.test_instance'} 169 | # source-ubuntu-1804-master-py3: {extends: '.test_instance'} 170 | repo-ubuntu-1804-master-py3: {extends: '.test_instance'} 171 | default-centos-stream8-master-py3: {extends: '.test_instance_failure_permitted'} 172 | # archive-centos-stream8-master-py3: {extends: '.test_instance_failure_permitted'} 173 | # source-centos-stream8-master-py3: {extends: '.test_instance_failure_permitted'} 174 | # repo-centos-stream8-master-py3: {extends: '.test_instance_failure_permitted'} 175 | default-centos-7-master-py3: {extends: '.test_instance'} 176 | # archive-centos-7-master-py3: {extends: '.test_instance'} 177 | # source-centos-7-master-py3: {extends: '.test_instance'} 178 | # repo-centos-7-master-py3: {extends: '.test_instance'} 179 | default-fedora-36-master-py3: {extends: '.test_instance_failure_permitted'} 180 | # archive-fedora-36-master-py3: {extends: '.test_instance_failure_permitted'} 181 | # source-fedora-36-master-py3: {extends: '.test_instance_failure_permitted'} 182 | # repo-fedora-36-master-py3: {extends: '.test_instance_failure_permitted'} 183 | default-fedora-35-master-py3: {extends: '.test_instance'} 184 | # archive-fedora-35-master-py3: {extends: '.test_instance'} 185 | # source-fedora-35-master-py3: {extends: '.test_instance'} 186 | # repo-fedora-35-master-py3: {extends: '.test_instance'} 187 | default-opensuse-leap-153-master-py3: {extends: '.test_instance'} 188 | # archive-opensuse-leap-153-master-py3: {extends: '.test_instance'} 189 | # source-opensuse-leap-153-master-py3: {extends: '.test_instance'} 190 | # repo-opensuse-leap-153-master-py3: {extends: '.test_instance'} 191 | default-opensuse-tmbl-latest-master-py3: {extends: '.test_instance_failure_permitted'} 192 | # archive-opensuse-tmbl-latest-master-py3: {extends: '.test_instance_failure_permitted'} 193 | # source-opensuse-tmbl-latest-master-py3: {extends: '.test_instance_failure_permitted'} 194 | # repo-opensuse-tmbl-latest-master-py3: {extends: '.test_instance_failure_permitted'} 195 | # default-amazonlinux-2-master-py3: {extends: '.test_instance'} 196 | archive-amazonlinux-2-master-py3: {extends: '.test_instance'} 197 | # source-amazonlinux-2-master-py3: {extends: '.test_instance'} 198 | # repo-amazonlinux-2-master-py3: {extends: '.test_instance'} 199 | default-oraclelinux-8-master-py3: {extends: '.test_instance'} 200 | # archive-oraclelinux-8-master-py3: {extends: '.test_instance'} 201 | # source-oraclelinux-8-master-py3: {extends: '.test_instance'} 202 | # repo-oraclelinux-8-master-py3: {extends: '.test_instance'} 203 | default-oraclelinux-7-master-py3: {extends: '.test_instance'} 204 | # archive-oraclelinux-7-master-py3: {extends: '.test_instance'} 205 | # source-oraclelinux-7-master-py3: {extends: '.test_instance'} 206 | # repo-oraclelinux-7-master-py3: {extends: '.test_instance'} 207 | default-arch-base-latest-master-py3: {extends: '.test_instance'} 208 | # archive-arch-base-latest-master-py3: {extends: '.test_instance'} 209 | # source-arch-base-latest-master-py3: {extends: '.test_instance'} 210 | # repo-arch-base-latest-master-py3: {extends: '.test_instance'} 211 | # default-gentoo-stage3-latest-master-py3: {extends: '.test_instance'} 212 | # archive-gentoo-stage3-latest-master-py3: {extends: '.test_instance'} 213 | # source-gentoo-stage3-latest-master-py3: {extends: '.test_instance'} 214 | # repo-gentoo-stage3-latest-master-py3: {extends: '.test_instance'} 215 | # default-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'} 216 | # archive-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'} 217 | # source-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'} 218 | # repo-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'} 219 | default-almalinux-8-master-py3: {extends: '.test_instance'} 220 | # archive-almalinux-8-master-py3: {extends: '.test_instance'} 221 | # source-almalinux-8-master-py3: {extends: '.test_instance'} 222 | # repo-almalinux-8-master-py3: {extends: '.test_instance'} 223 | default-rockylinux-8-master-py3: {extends: '.test_instance'} 224 | # archive-rockylinux-8-master-py3: {extends: '.test_instance'} 225 | # source-rockylinux-8-master-py3: {extends: '.test_instance'} 226 | # repo-rockylinux-8-master-py3: {extends: '.test_instance'} 227 | # default-debian-11-3004-1-py3: {extends: '.test_instance'} 228 | # default-debian-10-3004-1-py3: {extends: '.test_instance'} 229 | # default-debian-9-3004-1-py3: {extends: '.test_instance'} 230 | # default-ubuntu-2204-3004-1-py3: {extends: '.test_instance_failure_permitted'} 231 | # default-ubuntu-2004-3004-1-py3: {extends: '.test_instance'} 232 | # default-ubuntu-1804-3004-1-py3: {extends: '.test_instance'} 233 | # default-centos-stream8-3004-1-py3: {extends: '.test_instance_failure_permitted'} 234 | # default-centos-7-3004-1-py3: {extends: '.test_instance'} 235 | # default-fedora-36-3004-1-py3: {extends: '.test_instance_failure_permitted'} 236 | # default-fedora-35-3004-1-py3: {extends: '.test_instance'} 237 | # default-amazonlinux-2-3004-1-py3: {extends: '.test_instance'} 238 | # default-oraclelinux-8-3004-1-py3: {extends: '.test_instance'} 239 | # default-oraclelinux-7-3004-1-py3: {extends: '.test_instance'} 240 | # default-arch-base-latest-3004-1-py3: {extends: '.test_instance'} 241 | # default-gentoo-stage3-latest-3004-1-py3: {extends: '.test_instance'} 242 | # default-gentoo-stage3-systemd-3004-1-py3: {extends: '.test_instance'} 243 | # default-almalinux-8-3004-1-py3: {extends: '.test_instance'} 244 | # default-rockylinux-8-3004-1-py3: {extends: '.test_instance'} 245 | # default-opensuse-leap-153-3004-0-py3: {extends: '.test_instance'} 246 | # default-opensuse-tmbl-latest-3004-0-py3: {extends: '.test_instance_failure_permitted'} 247 | # default-debian-10-3003-4-py3: {extends: '.test_instance'} 248 | # default-debian-9-3003-4-py3: {extends: '.test_instance'} 249 | # default-ubuntu-2004-3003-4-py3: {extends: '.test_instance'} 250 | # default-ubuntu-1804-3003-4-py3: {extends: '.test_instance'} 251 | # default-centos-stream8-3003-4-py3: {extends: '.test_instance_failure_permitted'} 252 | # default-centos-7-3003-4-py3: {extends: '.test_instance'} 253 | # default-amazonlinux-2-3003-4-py3: {extends: '.test_instance'} 254 | # default-oraclelinux-8-3003-4-py3: {extends: '.test_instance'} 255 | # default-oraclelinux-7-3003-4-py3: {extends: '.test_instance'} 256 | # default-almalinux-8-3003-4-py3: {extends: '.test_instance'} 257 | # yamllint enable rule:line-length 258 | 259 | ############################################################################### 260 | # `release` stage: `semantic-release` 261 | ############################################################################### 262 | semantic-release: 263 | only: *only_branch_master_parent_repo 264 | stage: *stage_release 265 | image: *image_semanticrelease 266 | variables: 267 | MAINTAINER_TOKEN: '${GH_TOKEN}' 268 | script: 269 | # Update `AUTHORS.md` 270 | - '${HOME}/go/bin/maintainer contributor' 271 | # Run `semantic-release` 272 | - 'semantic-release' 273 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # See https://pre-commit.com for more information 5 | # See https://pre-commit.com/hooks.html for more hooks 6 | ci: 7 | autofix_commit_msg: | 8 | ci(pre-commit.ci): apply auto fixes from pre-commit.com hooks 9 | 10 | For more information, see https://pre-commit.ci 11 | autofix_prs: true 12 | autoupdate_branch: '' 13 | autoupdate_commit_msg: | 14 | ci(pre-commit.ci): perform `pre-commit` autoupdate 15 | autoupdate_schedule: quarterly 16 | skip: [] 17 | submodules: false 18 | default_stages: [commit] 19 | repos: 20 | - repo: https://github.com/dafyddj/commitlint-pre-commit-hook 21 | rev: v2.3.0 22 | hooks: 23 | - id: commitlint 24 | name: Check commit message using commitlint 25 | description: Lint commit message against @commitlint/config-conventional rules 26 | stages: [commit-msg] 27 | additional_dependencies: ['@commitlint/config-conventional@8.3.4'] 28 | - id: commitlint-travis 29 | stages: [manual] 30 | additional_dependencies: ['@commitlint/config-conventional@8.3.4'] 31 | always_run: true 32 | - repo: https://github.com/rubocop-hq/rubocop 33 | rev: v1.30.1 34 | hooks: 35 | - id: rubocop 36 | name: Check Ruby files with rubocop 37 | args: [--debug] 38 | always_run: true 39 | pass_filenames: false 40 | - repo: https://github.com/shellcheck-py/shellcheck-py 41 | rev: v0.8.0.4 42 | hooks: 43 | - id: shellcheck 44 | name: Check shell scripts with shellcheck 45 | files: ^.*\.(sh|bash|ksh)$ 46 | types: [] 47 | - repo: https://github.com/adrienverge/yamllint 48 | rev: v1.26.3 49 | hooks: 50 | - id: yamllint 51 | name: Check YAML syntax with yamllint 52 | args: [--strict, '.'] 53 | always_run: true 54 | pass_filenames: false 55 | - repo: https://github.com/warpnet/salt-lint 56 | rev: v0.8.0 57 | hooks: 58 | - id: salt-lint 59 | name: Check Salt files using salt-lint 60 | files: ^.*\.(sls|jinja|j2|tmpl|tst)$ 61 | - repo: https://github.com/myint/rstcheck 62 | rev: 3f929574 63 | hooks: 64 | - id: rstcheck 65 | name: Check reST files using rstcheck 66 | exclude: 'docs/CHANGELOG.rst' 67 | - repo: https://github.com/saltstack-formulas/mirrors-rst-lint 68 | rev: v1.3.2 69 | hooks: 70 | - id: rst-lint 71 | name: Check reST files using rst-lint 72 | exclude: | 73 | (?x)^( 74 | docs/CHANGELOG.rst| 75 | docs/TOFS_pattern.rst| 76 | )$ 77 | additional_dependencies: [pygments==2.9.0] 78 | -------------------------------------------------------------------------------- /.rstcheck.cfg: -------------------------------------------------------------------------------- 1 | [rstcheck] 2 | report=info 3 | ignore_language=rst 4 | ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$) 5 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # General overrides used across formulas in the org 5 | Layout/LineLength: 6 | # Increase from default of `80` 7 | # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) 8 | Max: 88 9 | Metrics/BlockLength: 10 | IgnoredMethods: 11 | - control 12 | - describe 13 | # Increase from default of `25` 14 | Max: 30 15 | Security/YAMLLoad: 16 | Exclude: 17 | - test/integration/**/_mapdata.rb 18 | 19 | # General settings across all cops in this formula 20 | AllCops: 21 | NewCops: enable 22 | 23 | # Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config` 24 | -------------------------------------------------------------------------------- /.salt-lint: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | exclude_paths: [] 5 | rules: {} 6 | skip_list: 7 | # Using `salt-lint` for linting other files as well, such as Jinja macros/templates 8 | - 205 # Use ".sls" as a Salt State file extension 9 | # Skipping `207` and `208` because `210` is sufficient, at least for the time-being 10 | # I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755` 11 | - 207 # File modes should always be encapsulated in quotation marks 12 | - 208 # File modes should always contain a leading zero 13 | tags: [] 14 | verbosity: 1 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | ################################################################################ 5 | # NOTE: This file is UNMAINTAINED; it is provided for references purposes only. 6 | # No guarantees are tendered that this structure will work after 2020. 7 | ################################################################################ 8 | # * https://en.wikipedia.org/wiki/Travis_CI: 9 | # - "... free open-source plans were removed in [sic] the end of 2020" 10 | # - https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing 11 | # - https://ropensci.org/technotes/2020/11/19/moving-away-travis/ 12 | ################################################################################ 13 | ## Machine config 14 | os: 'linux' 15 | arch: 'amd64' 16 | dist: 'bionic' 17 | version: '~> 1.0' 18 | 19 | ## Language and cache config 20 | language: 'ruby' 21 | cache: 'bundler' 22 | 23 | ## Services config 24 | services: 25 | - docker 26 | 27 | ## Script to run for the test stage 28 | script: 29 | - bin/kitchen verify "${INSTANCE}" 30 | 31 | ## Stages and jobs matrix 32 | stages: 33 | - test 34 | # # As part of the switch away from Travis CI, ensure that the `release` stage 35 | # # is not run inadvertently 36 | # - name: 'release' 37 | # if: 'branch = master AND type != pull_request' 38 | jobs: 39 | include: 40 | ## Define the test stage that runs the linters (and testing matrix, if applicable) 41 | 42 | # Run all of the linters in a single job 43 | - language: 'node_js' 44 | node_js: 'lts/*' 45 | env: 'Lint' 46 | name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint' 47 | before_install: 'skip' 48 | script: 49 | # Install and run `salt-lint` 50 | - pip install --user salt-lint 51 | - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst' 52 | | xargs salt-lint 53 | # Install and run `yamllint` 54 | # Need at least `v1.17.0` for the `yaml-files` setting 55 | - pip install --user yamllint>=1.17.0 56 | - yamllint -s . 57 | # Install and run `rubocop` 58 | - gem install rubocop 59 | - rubocop -d 60 | # Run `shellcheck` (already pre-installed in Travis) 61 | - shellcheck --version 62 | - git ls-files -- '*.sh' '*.bash' '*.ksh' 63 | | xargs shellcheck 64 | # Install and run `commitlint` 65 | - npm i -D @commitlint/config-conventional 66 | @commitlint/travis-cli 67 | - commitlint-travis 68 | 69 | # Run `pre-commit` linters in a single job 70 | - language: 'python' 71 | env: 'Lint_pre-commit' 72 | name: 'Lint: pre-commit' 73 | before_install: 'skip' 74 | cache: 75 | directories: 76 | - $HOME/.cache/pre-commit 77 | script: 78 | # Install and run `pre-commit` 79 | - pip install pre-commit==2.7.1 80 | - pre-commit run --all-files --color always --verbose 81 | - pre-commit run --color always --hook-stage manual --verbose commitlint-travis 82 | 83 | ## Define the rest of the matrix based on Kitchen testing 84 | # Make sure the instances listed below match up with 85 | # the `platforms` defined in `kitchen.yml` 86 | # - env: INSTANCE=default-debian-11-tiamat-py3 87 | # - env: INSTANCE=default-debian-10-tiamat-py3 88 | # - env: INSTANCE=default-debian-9-tiamat-py3 89 | # - env: INSTANCE=default-ubuntu-2204-tiamat-py3 90 | # - env: INSTANCE=default-ubuntu-2004-tiamat-py3 91 | # - env: INSTANCE=default-ubuntu-1804-tiamat-py3 92 | # - env: INSTANCE=default-centos-stream8-tiamat-py3 93 | # - env: INSTANCE=default-centos-7-tiamat-py3 94 | # - env: INSTANCE=default-amazonlinux-2-tiamat-py3 95 | # - env: INSTANCE=default-oraclelinux-8-tiamat-py3 96 | # - env: INSTANCE=default-oraclelinux-7-tiamat-py3 97 | # - env: INSTANCE=default-almalinux-8-tiamat-py3 98 | # - env: INSTANCE=default-rockylinux-8-tiamat-py3 99 | # - env: INSTANCE=default-debian-11-master-py3 100 | # - env: INSTANCE=archive-debian-11-master-py3 101 | # - env: INSTANCE=source-debian-11-master-py3 102 | - env: INSTANCE=repo-debian-11-master-py3 103 | # - env: INSTANCE=default-debian-10-master-py3 104 | # - env: INSTANCE=archive-debian-10-master-py3 105 | # - env: INSTANCE=source-debian-10-master-py3 106 | - env: INSTANCE=repo-debian-10-master-py3 107 | # - env: INSTANCE=default-debian-9-master-py3 108 | # - env: INSTANCE=archive-debian-9-master-py3 109 | # - env: INSTANCE=source-debian-9-master-py3 110 | - env: INSTANCE=repo-debian-9-master-py3 111 | # - env: INSTANCE=default-ubuntu-2204-master-py3 112 | # - env: INSTANCE=archive-ubuntu-2204-master-py3 113 | # - env: INSTANCE=source-ubuntu-2204-master-py3 114 | - env: INSTANCE=repo-ubuntu-2204-master-py3 115 | # - env: INSTANCE=default-ubuntu-2004-master-py3 116 | # - env: INSTANCE=archive-ubuntu-2004-master-py3 117 | # - env: INSTANCE=source-ubuntu-2004-master-py3 118 | - env: INSTANCE=repo-ubuntu-2004-master-py3 119 | # - env: INSTANCE=default-ubuntu-1804-master-py3 120 | # - env: INSTANCE=archive-ubuntu-1804-master-py3 121 | # - env: INSTANCE=source-ubuntu-1804-master-py3 122 | - env: INSTANCE=repo-ubuntu-1804-master-py3 123 | - env: INSTANCE=default-centos-stream8-master-py3 124 | # - env: INSTANCE=archive-centos-stream8-master-py3 125 | # - env: INSTANCE=source-centos-stream8-master-py3 126 | # - env: INSTANCE=repo-centos-stream8-master-py3 127 | - env: INSTANCE=default-centos-7-master-py3 128 | # - env: INSTANCE=archive-centos-7-master-py3 129 | # - env: INSTANCE=source-centos-7-master-py3 130 | # - env: INSTANCE=repo-centos-7-master-py3 131 | - env: INSTANCE=default-fedora-36-master-py3 132 | # - env: INSTANCE=archive-fedora-36-master-py3 133 | # - env: INSTANCE=source-fedora-36-master-py3 134 | # - env: INSTANCE=repo-fedora-36-master-py3 135 | - env: INSTANCE=default-fedora-35-master-py3 136 | # - env: INSTANCE=archive-fedora-35-master-py3 137 | # - env: INSTANCE=source-fedora-35-master-py3 138 | # - env: INSTANCE=repo-fedora-35-master-py3 139 | - env: INSTANCE=default-opensuse-leap-153-master-py3 140 | # - env: INSTANCE=archive-opensuse-leap-153-master-py3 141 | # - env: INSTANCE=source-opensuse-leap-153-master-py3 142 | # - env: INSTANCE=repo-opensuse-leap-153-master-py3 143 | - env: INSTANCE=default-opensuse-tmbl-latest-master-py3 144 | # - env: INSTANCE=archive-opensuse-tmbl-latest-master-py3 145 | # - env: INSTANCE=source-opensuse-tmbl-latest-master-py3 146 | # - env: INSTANCE=repo-opensuse-tmbl-latest-master-py3 147 | # - env: INSTANCE=default-amazonlinux-2-master-py3 148 | - env: INSTANCE=archive-amazonlinux-2-master-py3 149 | # - env: INSTANCE=source-amazonlinux-2-master-py3 150 | # - env: INSTANCE=repo-amazonlinux-2-master-py3 151 | - env: INSTANCE=default-oraclelinux-8-master-py3 152 | # - env: INSTANCE=archive-oraclelinux-8-master-py3 153 | # - env: INSTANCE=source-oraclelinux-8-master-py3 154 | # - env: INSTANCE=repo-oraclelinux-8-master-py3 155 | - env: INSTANCE=default-oraclelinux-7-master-py3 156 | # - env: INSTANCE=archive-oraclelinux-7-master-py3 157 | # - env: INSTANCE=source-oraclelinux-7-master-py3 158 | # - env: INSTANCE=repo-oraclelinux-7-master-py3 159 | - env: INSTANCE=default-arch-base-latest-master-py3 160 | # - env: INSTANCE=archive-arch-base-latest-master-py3 161 | # - env: INSTANCE=source-arch-base-latest-master-py3 162 | # - env: INSTANCE=repo-arch-base-latest-master-py3 163 | # - env: INSTANCE=default-gentoo-stage3-latest-master-py3 164 | # - env: INSTANCE=archive-gentoo-stage3-latest-master-py3 165 | # - env: INSTANCE=source-gentoo-stage3-latest-master-py3 166 | # - env: INSTANCE=repo-gentoo-stage3-latest-master-py3 167 | # - env: INSTANCE=default-gentoo-stage3-systemd-master-py3 168 | # - env: INSTANCE=archive-gentoo-stage3-systemd-master-py3 169 | # - env: INSTANCE=source-gentoo-stage3-systemd-master-py3 170 | # - env: INSTANCE=repo-gentoo-stage3-systemd-master-py3 171 | - env: INSTANCE=default-almalinux-8-master-py3 172 | # - env: INSTANCE=archive-almalinux-8-master-py3 173 | # - env: INSTANCE=source-almalinux-8-master-py3 174 | # - env: INSTANCE=repo-almalinux-8-master-py3 175 | - env: INSTANCE=default-rockylinux-8-master-py3 176 | # - env: INSTANCE=archive-rockylinux-8-master-py3 177 | # - env: INSTANCE=source-rockylinux-8-master-py3 178 | # - env: INSTANCE=repo-rockylinux-8-master-py3 179 | # - env: INSTANCE=default-debian-11-3004-1-py3 180 | # - env: INSTANCE=default-debian-10-3004-1-py3 181 | # - env: INSTANCE=default-debian-9-3004-1-py3 182 | # - env: INSTANCE=default-ubuntu-2204-3004-1-py3 183 | # - env: INSTANCE=default-ubuntu-2004-3004-1-py3 184 | # - env: INSTANCE=default-ubuntu-1804-3004-1-py3 185 | # - env: INSTANCE=default-centos-stream8-3004-1-py3 186 | # - env: INSTANCE=default-centos-7-3004-1-py3 187 | # - env: INSTANCE=default-fedora-36-3004-1-py3 188 | # - env: INSTANCE=default-fedora-35-3004-1-py3 189 | # - env: INSTANCE=default-amazonlinux-2-3004-1-py3 190 | # - env: INSTANCE=default-oraclelinux-8-3004-1-py3 191 | # - env: INSTANCE=default-oraclelinux-7-3004-1-py3 192 | # - env: INSTANCE=default-arch-base-latest-3004-1-py3 193 | # - env: INSTANCE=default-gentoo-stage3-latest-3004-1-py3 194 | # - env: INSTANCE=default-gentoo-stage3-systemd-3004-1-py3 195 | # - env: INSTANCE=default-almalinux-8-3004-1-py3 196 | # - env: INSTANCE=default-rockylinux-8-3004-1-py3 197 | # - env: INSTANCE=default-opensuse-leap-153-3004-0-py3 198 | # - env: INSTANCE=default-opensuse-tmbl-latest-3004-0-py3 199 | # - env: INSTANCE=default-debian-10-3003-4-py3 200 | # - env: INSTANCE=default-debian-9-3003-4-py3 201 | # - env: INSTANCE=default-ubuntu-2004-3003-4-py3 202 | # - env: INSTANCE=default-ubuntu-1804-3003-4-py3 203 | # - env: INSTANCE=default-centos-stream8-3003-4-py3 204 | # - env: INSTANCE=default-centos-7-3003-4-py3 205 | # - env: INSTANCE=default-amazonlinux-2-3003-4-py3 206 | # - env: INSTANCE=default-oraclelinux-8-3003-4-py3 207 | # - env: INSTANCE=default-oraclelinux-7-3003-4-py3 208 | # - env: INSTANCE=default-almalinux-8-3003-4-py3 209 | 210 | ## Define the release stage that runs `semantic-release` 211 | - stage: 'release' 212 | language: 'node_js' 213 | node_js: 'lts/*' 214 | env: 'Release' 215 | name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' 216 | before_install: 'skip' 217 | script: 218 | # Update `AUTHORS.md` 219 | - export MAINTAINER_TOKEN=${GH_TOKEN} 220 | - go get github.com/myii/maintainer 221 | - maintainer contributor 222 | 223 | # Install all dependencies required for `semantic-release` 224 | - npm i -D @semantic-release/changelog@3 225 | @semantic-release/exec@3 226 | @semantic-release/git@7 227 | deploy: 228 | provider: 'script' 229 | # Opt-in to `dpl v2` to complete the Travis build config validation (beta) 230 | # * https://docs.travis-ci.com/user/build-config-validation 231 | # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default 232 | edge: true 233 | # Run `semantic-release` 234 | script: 'npx semantic-release@15.14' 235 | 236 | # Notification options: `always`, `never` or `change` 237 | notifications: 238 | webhooks: 239 | if: 'repo = saltstack-formulas/node-formula' 240 | urls: 241 | - https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=saltstack-formulas%2Fnode-formula&ignore_pull_requests=true 242 | on_success: always # default: always 243 | on_failure: always # default: always 244 | on_start: always # default: never 245 | on_cancel: always # default: always 246 | on_error: always # default: always 247 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # Extend the `default` configuration provided by `yamllint` 5 | extends: 'default' 6 | 7 | # Files to ignore completely 8 | # 1. All YAML files under directory `.bundle/`, introduced if gems are installed locally 9 | # 2. All YAML files under directory `.cache/`, introduced during the CI run 10 | # 3. All YAML files under directory `.git/` 11 | # 4. All YAML files under directory `node_modules/`, introduced during the CI run 12 | # 5. Any SLS files under directory `test/`, which are actually state files 13 | # 6. Any YAML files under directory `.kitchen/`, introduced during local testing 14 | # 7. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax 15 | ignore: | 16 | .bundle/ 17 | .cache/ 18 | .git/ 19 | node_modules/ 20 | test/**/states/**/*.sls 21 | .kitchen/ 22 | kitchen.vagrant.yml 23 | node/osfamilymap.yaml 24 | 25 | yaml-files: 26 | # Default settings 27 | - '*.yaml' 28 | - '*.yml' 29 | - .salt-lint 30 | - .yamllint 31 | # SaltStack Formulas additional settings 32 | - '*.example' 33 | - test/**/*.sls 34 | 35 | rules: 36 | empty-values: 37 | forbid-in-block-mappings: true 38 | forbid-in-flow-mappings: true 39 | line-length: 40 | # Increase from default of `80` 41 | # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) 42 | max: 88 43 | octal-values: 44 | forbid-implicit-octal: true 45 | forbid-explicit-octal: true 46 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | # Authors 2 | 3 | This list is sorted by the number of commits per contributor in _descending_ order. 4 | 5 | Avatar|Contributor|Contributions 6 | :-:|---|:-: 7 | @myii|[@myii](https://github.com/myii)|123 8 | @gravyboat|[@gravyboat](https://github.com/gravyboat)|12 9 | @noelmcloughlin|[@noelmcloughlin](https://github.com/noelmcloughlin)|10 10 | @Granjow|[@Granjow](https://github.com/Granjow)|7 11 | @javierbertoli|[@javierbertoli](https://github.com/javierbertoli)|5 12 | @johnkeates|[@johnkeates](https://github.com/johnkeates)|5 13 | @aboe76|[@aboe76](https://github.com/aboe76)|5 14 | @fooka03|[@fooka03](https://github.com/fooka03)|5 15 | @dafyddj|[@dafyddj](https://github.com/dafyddj)|3 16 | @schwing|[@schwing](https://github.com/schwing)|3 17 | @techhat|[@techhat](https://github.com/techhat)|3 18 | @luislobo|[@luislobo](https://github.com/luislobo)|3 19 | @malept|[@malept](https://github.com/malept)|3 20 | @stp-ip|[@stp-ip](https://github.com/stp-ip)|3 21 | @myoung34|[@myoung34](https://github.com/myoung34)|3 22 | @iggy|[@iggy](https://github.com/iggy)|2 23 | @johnklehm|[@johnklehm](https://github.com/johnklehm)|2 24 | @JulioECastro|[@JulioECastro](https://github.com/JulioECastro)|2 25 | @nmadhok|[@nmadhok](https://github.com/nmadhok)|2 26 | @whiteinge|[@whiteinge](https://github.com/whiteinge)|2 27 | @timka|[@timka](https://github.com/timka)|2 28 | @akatrevorjay|[@akatrevorjay](https://github.com/akatrevorjay)|2 29 | @brandonparsons|[@brandonparsons](https://github.com/brandonparsons)|2 30 | @ek9|[@ek9](https://github.com/ek9)|2 31 | @puneetk|[@puneetk](https://github.com/puneetk)|2 32 | @auser|[@auser](https://github.com/auser)|1 33 | @briandesousa|[@briandesousa](https://github.com/briandesousa)|1 34 | @baby-gnu|[@baby-gnu](https://github.com/baby-gnu)|1 35 | @gesundkrank|[@gesundkrank](https://github.com/gesundkrank)|1 36 | @Lucianovici|[@Lucianovici](https://github.com/Lucianovici)|1 37 | @mdzidic|[@mdzidic](https://github.com/mdzidic)|1 38 | @meganlkm|[@meganlkm](https://github.com/meganlkm)|1 39 | @smitelli|[@smitelli](https://github.com/smitelli)|1 40 | @wolodjawentland|[@wolodjawentland](https://github.com/wolodjawentland)|1 41 | @Yoda-BZH|[@Yoda-BZH](https://github.com/Yoda-BZH)|1 42 | @abednarik|[@abednarik](https://github.com/abednarik)|1 43 | @chrisportela|[@chrisportela](https://github.com/chrisportela)|1 44 | 45 | --- 46 | 47 | Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2022-07-17. 48 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | # [2.5.0](https://github.com/saltstack-formulas/node-formula/compare/v2.4.0...v2.5.0) (2022-07-17) 4 | 5 | 6 | ### Continuous Integration 7 | 8 | * update `pre-commit` configuration inc. for pre-commit.ci [skip ci] ([cd18cec](https://github.com/saltstack-formulas/node-formula/commit/cd18cec051362a843365dff391061958baccce17)) 9 | 10 | 11 | ### Features 12 | 13 | * **os*map:** update version installed on Debian/Ubuntu ([1e82b29](https://github.com/saltstack-formulas/node-formula/commit/1e82b2987e0794e9d580ff91647c4987717edbae)) 14 | 15 | # [2.4.0](https://github.com/saltstack-formulas/node-formula/compare/v2.3.0...v2.4.0) (2022-06-07) 16 | 17 | 18 | ### Continuous Integration 19 | 20 | * **kitchen+gitlab:** update for new pre-salted images [skip ci] ([3c2ee6e](https://github.com/saltstack-formulas/node-formula/commit/3c2ee6eb11c81903961973814938ed1d6f649698)) 21 | * **vagrant:** use `linked_clone` at all times (inc. CI) [skip ci] ([0db341d](https://github.com/saltstack-formulas/node-formula/commit/0db341da2589d73cccd25776471ca35cfa485731)) 22 | 23 | 24 | ### Features 25 | 26 | * **os*map:** update version installed on Debian/Ubuntu ([b0c4bd9](https://github.com/saltstack-formulas/node-formula/commit/b0c4bd9041b5e3826412804c16e11f8a99287807)) 27 | * **os*map:** update version installed on Debian/Ubuntu [skip ci] ([f204851](https://github.com/saltstack-formulas/node-formula/commit/f2048513e84fb3eb445668303386c2ffbcda3c89)) 28 | 29 | 30 | ### Tests 31 | 32 | * **system.rb:** add support for `mac_os_x` [skip ci] ([74d8a56](https://github.com/saltstack-formulas/node-formula/commit/74d8a56bf4edc4438d067fd3881591e808fa5e70)) 33 | 34 | # [2.3.0](https://github.com/saltstack-formulas/node-formula/compare/v2.2.0...v2.3.0) (2022-03-24) 35 | 36 | 37 | ### Continuous Integration 38 | 39 | * enable Vagrant-based testing using GitHub Actions ([0d1bd4a](https://github.com/saltstack-formulas/node-formula/commit/0d1bd4a31185bce4cc6b5ebeeb198dfb5f9d7874)) 40 | * update linters to latest versions [skip ci] ([ed63546](https://github.com/saltstack-formulas/node-formula/commit/ed63546091e9d140d264f8bc88842134a2fb0dac)) 41 | * **gemfile:** allow rubygems proxy to be provided as an env var [skip ci] ([478c2c7](https://github.com/saltstack-formulas/node-formula/commit/478c2c76584777701df8028f3bb35d75b577bcd1)) 42 | * **kitchen+gitlab:** update for new pre-salted images [skip ci] ([7e237d1](https://github.com/saltstack-formulas/node-formula/commit/7e237d1e90327c8822b311205ddc14964df4ceeb)) 43 | 44 | 45 | ### Documentation 46 | 47 | * **readme:** add `Testing with Vagrant` section ([05c942e](https://github.com/saltstack-formulas/node-formula/commit/05c942ecb05f3a918fe762a7164cb2d9f7118cc7)) 48 | 49 | 50 | ### Features 51 | 52 | * **freebsd:** add support to work with the `default` suite ([0f50475](https://github.com/saltstack-formulas/node-formula/commit/0f50475063856a540f72217cb4bb2bad3501da0e)) 53 | * **openbsd:** add support to work with the `default` suite ([1d97949](https://github.com/saltstack-formulas/node-formula/commit/1d97949be7532fbbafd040c334846ac869a1be4b)) 54 | * **os*map:** update version installed on Debian/Ubuntu [skip ci] ([d4407fa](https://github.com/saltstack-formulas/node-formula/commit/d4407fa3e263eb8fced94657a61da2db7d902feb)) 55 | * **os*map:** update version installed on Debian/Ubuntu [skip ci] ([e806dcb](https://github.com/saltstack-formulas/node-formula/commit/e806dcbd4bee7fd085727383475ee47dc870ed95)) 56 | * **os*map:** update version installed on Debian/Ubuntu [skip ci] ([2976bf2](https://github.com/saltstack-formulas/node-formula/commit/2976bf2c7381fb3b5187caa4673d4d5d2db0f4b8)) 57 | * **osfingermap:** use last working version for Fedora 34 [skip ci] ([c38f422](https://github.com/saltstack-formulas/node-formula/commit/c38f4225b921d0a3d0e7291b4a3e86ab73ccc9c1)) 58 | * **windows:** add support to work with the `default` suite ([f1066d6](https://github.com/saltstack-formulas/node-formula/commit/f1066d6758552cee9b240fa33bb2cdb32e0a9d15)) 59 | 60 | 61 | ### Tests 62 | 63 | * **system:** add `build_platform_codename` [skip ci] ([de02abe](https://github.com/saltstack-formulas/node-formula/commit/de02abe07864c6e744283be2aa7ef818297d13af)) 64 | 65 | # [2.2.0](https://github.com/saltstack-formulas/node-formula/compare/v2.1.0...v2.2.0) (2022-01-16) 66 | 67 | 68 | ### Code Refactoring 69 | 70 | * add `osfingermap` ([e5f9399](https://github.com/saltstack-formulas/node-formula/commit/e5f93992935f2179d2aa857c75277a59766e3f5c)) 71 | 72 | 73 | ### Features 74 | 75 | * **tumbleweed:** update version via. new `oscodenamemap` ([3ce9ef2](https://github.com/saltstack-formulas/node-formula/commit/3ce9ef2c6cb694e6f2da6f044ffc47a81145ad93)) 76 | 77 | # [2.1.0](https://github.com/saltstack-formulas/node-formula/compare/v2.0.0...v2.1.0) (2022-01-14) 78 | 79 | 80 | ### Continuous Integration 81 | 82 | * **kitchen+ci:** update with `3004` pre-salted images/boxes [skip ci] ([29a797a](https://github.com/saltstack-formulas/node-formula/commit/29a797a8d609a87442c757f876b16f522a45b723)) 83 | 84 | 85 | ### Features 86 | 87 | * **repo:** update installation `version` [skip ci] ([4902faf](https://github.com/saltstack-formulas/node-formula/commit/4902faff4402034e226dca966f8fd94bb30c7c39)) 88 | * **repo:** update installation version ([cad52df](https://github.com/saltstack-formulas/node-formula/commit/cad52dfa08aa54f5bfd51badfdb225c874d1e532)) 89 | 90 | # [2.0.0](https://github.com/saltstack-formulas/node-formula/compare/v1.1.1...v2.0.0) (2021-11-12) 91 | 92 | 93 | ### Bug Fixes 94 | 95 | * **package:** use correct version parameter with packages ([6ce8259](https://github.com/saltstack-formulas/node-formula/commit/6ce8259a4ec8ba715cf4fb2923f7bfc3b5a02ebc)) 96 | 97 | 98 | ### BREAKING CHANGES 99 | 100 | * **package:** `node:pkg:version` needs to be specified as the 101 | full version number (ie, 16.13.0) instead of just the major number 102 | in order to be able to properly install using packages and pin the 103 | desired version. 104 | 105 | ## [1.1.1](https://github.com/saltstack-formulas/node-formula/compare/v1.1.0...v1.1.1) (2021-10-27) 106 | 107 | 108 | ### Bug Fixes 109 | 110 | * **package:** remove double colon on pillar item ([6049849](https://github.com/saltstack-formulas/node-formula/commit/60498496a9b3f1e59f8c32fa613ce4157ab82fbd)) 111 | 112 | 113 | ### Code Refactoring 114 | 115 | * **jinja:** remove on due date ([eddad91](https://github.com/saltstack-formulas/node-formula/commit/eddad9170a1bc1a5be7caee45599c2a84dff53a3)) 116 | 117 | # [1.1.0](https://github.com/saltstack-formulas/node-formula/compare/v1.0.1...v1.1.0) (2021-10-26) 118 | 119 | 120 | ### Bug Fixes 121 | 122 | * **debian:** allow version to be user-provided, don't force v13 ([9b1eb68](https://github.com/saltstack-formulas/node-formula/commit/9b1eb68fe2002f556fad27acb5c055e730b5509e)) 123 | * **debian:** don't include comps in name and in comps, comps is string ([becd5ba](https://github.com/saltstack-formulas/node-formula/commit/becd5baed5b099cab985ce9b0ea4e65c37feda43)) 124 | * **debian:** don't rely on pillar.get, build repo.name when needed ([67a3dda](https://github.com/saltstack-formulas/node-formula/commit/67a3dda9b3f00d0b9febf36fba50022f56225fe6)) 125 | 126 | 127 | ### Continuous Integration 128 | 129 | * **3003.1:** update inc. AlmaLinux, Rocky & `rst-lint` [skip ci] ([b47573e](https://github.com/saltstack-formulas/node-formula/commit/b47573e4ffca9b7f717a9cd942b0e09482fc6907)) 130 | * **gemfile+lock:** use `ssf` customised `inspec` repo [skip ci] ([426bf1e](https://github.com/saltstack-formulas/node-formula/commit/426bf1ef3bd640ddfae1e0f2c45950b3f9945bf3)) 131 | * **kitchen:** move `provisioner` block & update `run_command` [skip ci] ([a40e1e8](https://github.com/saltstack-formulas/node-formula/commit/a40e1e83fb699b826aaebb2ab6e8b6ac4261fd45)) 132 | * **kitchen+ci:** update with latest `3003.2` pre-salted images [skip ci] ([e60311b](https://github.com/saltstack-formulas/node-formula/commit/e60311be2f08a6feedb1a4841bbeb3b2e043d3ba)) 133 | * **kitchen+ci:** update with latest CVE pre-salted images [skip ci] ([0c485e2](https://github.com/saltstack-formulas/node-formula/commit/0c485e2146c24b8da612b25493024ace2d19560d)) 134 | * add `arch-master` to matrix and update `.travis.yml` [skip ci] ([922e34d](https://github.com/saltstack-formulas/node-formula/commit/922e34db71046d3b2fcabc34b216d941fb780bd9)) 135 | * add Debian 11 Bullseye & update `yamllint` configuration [skip ci] ([25d4626](https://github.com/saltstack-formulas/node-formula/commit/25d46263bc5a7c22a221dab3853c65300774f51e)) 136 | * **commitlint:** ensure `upstream/master` uses main repo URL [skip ci] ([c7e7957](https://github.com/saltstack-formulas/node-formula/commit/c7e795783b5d158352857f276bdb86f8658617b5)) 137 | * **gemfile+lock:** use `ssf` customised `kitchen-docker` repo [skip ci] ([a099234](https://github.com/saltstack-formulas/node-formula/commit/a099234a08e217c495b4ce770e2d1ce2e329958e)) 138 | * **gitlab-ci:** add `rubocop` linter (with `allow_failure`) [skip ci] ([ae1484a](https://github.com/saltstack-formulas/node-formula/commit/ae1484aa4032cf54ea48fdbd3d014b1ae718a34c)) 139 | * **kitchen+ci:** use latest pre-salted images (after CVE) [skip ci] ([490ccb2](https://github.com/saltstack-formulas/node-formula/commit/490ccb2aa9fd6fbcc73ed0f021b3a277b125c08b)) 140 | * **kitchen+gitlab:** adjust matrix to add `3003` [skip ci] ([6138902](https://github.com/saltstack-formulas/node-formula/commit/6138902f6862a19f14da2c3b01573816f0fde8d4)) 141 | * **kitchen+gitlab:** remove Ubuntu 16.04 & Fedora 32 (EOL) [skip ci] ([75dde65](https://github.com/saltstack-formulas/node-formula/commit/75dde65eb76f086665fc76bd90e8eb8bd51d0eb6)) 142 | * **kitchen+gitlab-ci:** use latest pre-salted images [skip ci] ([8f864c1](https://github.com/saltstack-formulas/node-formula/commit/8f864c1d6d85e7094b2e8d151905d7ec302f6073)) 143 | * **pre-commit:** update hook for `rubocop` [skip ci] ([fdb19f4](https://github.com/saltstack-formulas/node-formula/commit/fdb19f437563c534105cb7c1c2c515686cbcbb0f)) 144 | 145 | 146 | ### Documentation 147 | 148 | * **readme:** fix headings [skip ci] ([49e05b5](https://github.com/saltstack-formulas/node-formula/commit/49e05b51f97ad296de455876eeb6f364d206eead)) 149 | 150 | 151 | ### Features 152 | 153 | * **suse:** update installation from `nodejs10` => `nodejs14` [skip ci] ([bf107ff](https://github.com/saltstack-formulas/node-formula/commit/bf107ff537e120df4a10d50335b9a452a1d7508e)) 154 | 155 | 156 | ### Tests 157 | 158 | * standardise use of `share` suite & `_mapdata` state [skip ci] ([42f8881](https://github.com/saltstack-formulas/node-formula/commit/42f888114407dcde97e684566a474817f7a89aac)) 159 | 160 | ## [1.0.1](https://github.com/saltstack-formulas/node-formula/compare/v1.0.0...v1.0.1) (2020-12-16) 161 | 162 | 163 | ### Continuous Integration 164 | 165 | * **gitlab-ci:** use GitLab CI as Travis CI replacement ([88cc5e4](https://github.com/saltstack-formulas/node-formula/commit/88cc5e4f8176f9c61f3aa67ae278a6356b017155)) 166 | * **kitchen:** use `saltimages` Docker Hub where available [skip ci] ([4c4c93a](https://github.com/saltstack-formulas/node-formula/commit/4c4c93aa3904de698f55d4db1b55f7bfa8a3ee06)) 167 | * **pre-commit:** add to formula [skip ci] ([5c6ac84](https://github.com/saltstack-formulas/node-formula/commit/5c6ac846426ed63d107d5e26c9b6f7723c9d0d89)) 168 | * **pre-commit:** enable/disable `rstcheck` as relevant [skip ci] ([65d4b7b](https://github.com/saltstack-formulas/node-formula/commit/65d4b7ba353d52b9f5ec2db865c5f77d4e319d8a)) 169 | * **pre-commit:** finalise `rstcheck` configuration [skip ci] ([f4009a0](https://github.com/saltstack-formulas/node-formula/commit/f4009a06a8db3e017b3c3df0b0d527e670e9e911)) 170 | 171 | 172 | ### Styles 173 | 174 | * **libtofs.jinja:** use Black-inspired Jinja formatting [skip ci] ([1f0a3d2](https://github.com/saltstack-formulas/node-formula/commit/1f0a3d2c0eb25e31e22d66e8388787050f13a381)) 175 | 176 | # [1.0.0](https://github.com/saltstack-formulas/node-formula/compare/v0.14.2...v1.0.0) (2020-06-01) 177 | 178 | 179 | ### Continuous Integration 180 | 181 | * **kitchen+travis:** add new platforms [skip ci] ([60239d4](https://github.com/saltstack-formulas/node-formula/commit/60239d44a5406a28b9e84423d66d0c6f71637b2d)) 182 | * **kitchen+travis:** adjust matrix to add `3000.3` [skip ci] ([3527bc5](https://github.com/saltstack-formulas/node-formula/commit/3527bc5597dc767fb93c462e90654404e18a29ee)) 183 | 184 | 185 | ### Features 186 | 187 | * **formula:** store macros.jinja in subdir ([277d617](https://github.com/saltstack-formulas/node-formula/commit/277d617f97bbfce1ceb349cedc60b0b8f329ae6a)) 188 | 189 | 190 | ### BREAKING CHANGES 191 | 192 | * **formula:** Major refactor of formula to bring it in alignment with the 193 | `template-formula`. As with all substantial changes, please ensure your 194 | existing configurations work in the ways you expect from this formula. 195 | 196 | ## [0.14.2](https://github.com/saltstack-formulas/node-formula/compare/v0.14.1...v0.14.2) (2020-05-02) 197 | 198 | 199 | ### Bug Fixes 200 | 201 | * **config/file:** use `|tojson` (was failing on Arch `2019.2`) ([032abda](https://github.com/saltstack-formulas/node-formula/commit/032abda3626ec69023eec480f75e6ad552ecd180)) 202 | 203 | 204 | ### Continuous Integration 205 | 206 | * **kitchen+travis:** adjust matrix to add `3000.2` & remove `2018.3` ([21dc1c9](https://github.com/saltstack-formulas/node-formula/commit/21dc1c928f894aeb87fdda451f5e51442ef57793)) 207 | 208 | ## [0.14.1](https://github.com/saltstack-formulas/node-formula/compare/v0.14.0...v0.14.1) (2020-04-15) 209 | 210 | 211 | ### Bug Fixes 212 | 213 | * **osfamilymap:** use correct package for `Suse` ([d8a8264](https://github.com/saltstack-formulas/node-formula/commit/d8a8264ccaea147b65049b2cc9bd8473d1a74ebc)) 214 | 215 | 216 | ### Continuous Integration 217 | 218 | * **travis:** update matrix to test across all platforms ([f923134](https://github.com/saltstack-formulas/node-formula/commit/f923134e0292cacc9a2478e8d92c0f48788a6d1f)) 219 | 220 | # [0.14.0](https://github.com/saltstack-formulas/node-formula/compare/v0.13.2...v0.14.0) (2020-04-13) 221 | 222 | 223 | ### Bug Fixes 224 | 225 | * **cleanup:** tidyup few loose ends ([febeb4c](https://github.com/saltstack-formulas/node-formula/commit/febeb4cea1c1a92f185f8e533f3181c754f59c2a)) 226 | 227 | 228 | ### Features 229 | 230 | * **template:** align to template formula ([2570563](https://github.com/saltstack-formulas/node-formula/commit/2570563e4734b6c54c07ebd1091efa7578589009)) 231 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners 2 | 3 | # SECTION: Owner(s) for everything in the repo, unless a later match takes precedence 4 | # ************************************************************************** 5 | # *** NO GLOBAL OWNER(S) SPECIFIED *** 6 | # *** Ideally this will be defined for a healthy, well-maintained repo *** 7 | # ************************************************************************** 8 | # FILE PATTERN OWNER(S) 9 | * @NONE 10 | 11 | # SECTION: Owner(s) for specific directories 12 | # FILE PATTERN OWNER(S) 13 | 14 | # SECTION: Owner(s) for files/directories related to `semantic-release` 15 | # FILE PATTERN OWNER(S) 16 | /.github/workflows/ @saltstack-formulas/ssf 17 | /bin/install-hooks @saltstack-formulas/ssf 18 | /bin/kitchen @saltstack-formulas/ssf 19 | /docs/AUTHORS.rst @saltstack-formulas/ssf 20 | /docs/CHANGELOG.rst @saltstack-formulas/ssf 21 | /docs/TOFS_pattern.rst @saltstack-formulas/ssf 22 | /*/_mapdata/ @saltstack-formulas/ssf 23 | /*/libsaltcli.jinja @saltstack-formulas/ssf 24 | /*/libtofs.jinja @saltstack-formulas/ssf 25 | /test/integration/**/_mapdata.rb @saltstack-formulas/ssf 26 | /test/integration/**/libraries/system.rb @saltstack-formulas/ssf 27 | /test/integration/**/inspec.yml @saltstack-formulas/ssf 28 | /test/integration/**/README.md @saltstack-formulas/ssf 29 | /test/salt/pillar/top.sls @saltstack-formulas/ssf 30 | /.gitignore @saltstack-formulas/ssf 31 | /.cirrus.yml @saltstack-formulas/ssf 32 | /.gitlab-ci.yml @saltstack-formulas/ssf 33 | /.pre-commit-config.yaml @saltstack-formulas/ssf 34 | /.rstcheck.cfg @saltstack-formulas/ssf 35 | /.rubocop.yml @saltstack-formulas/ssf 36 | /.salt-lint @saltstack-formulas/ssf 37 | /.travis.yml @saltstack-formulas/ssf 38 | /.yamllint @saltstack-formulas/ssf 39 | /AUTHORS.md @saltstack-formulas/ssf 40 | /CHANGELOG.md @saltstack-formulas/ssf 41 | /CODEOWNERS @saltstack-formulas/ssf 42 | /commitlint.config.js @saltstack-formulas/ssf 43 | /FORMULA @saltstack-formulas/ssf 44 | /Gemfile @saltstack-formulas/ssf 45 | /Gemfile.lock @saltstack-formulas/ssf 46 | /kitchen.yml @saltstack-formulas/ssf 47 | /kitchen.vagrant.yml @saltstack-formulas/ssf 48 | /kitchen.windows.yml @saltstack-formulas/ssf 49 | /pre-commit_semantic-release.sh @saltstack-formulas/ssf 50 | /release-rules.js @saltstack-formulas/ssf 51 | /release.config.js @saltstack-formulas/ssf 52 | 53 | # SECTION: Owner(s) for specific files 54 | # FILE PATTERN OWNER(S) 55 | -------------------------------------------------------------------------------- /FORMULA: -------------------------------------------------------------------------------- 1 | name: node 2 | os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Amazon, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS 3 | os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS 4 | version: 2.5.0 5 | release: 1 6 | minimum_version: 2016.11 7 | summary: node formula 8 | description: Formula to install node/sar and configure it. 9 | top_level_dir: node 10 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source ENV.fetch('PROXY_RUBYGEMSORG', 'https://rubygems.org') 4 | 5 | # Install the `inspec` gem using `git` because versions after `4.22.22` 6 | # suppress diff output; this version fixes this for our uses. 7 | # rubocop:disable Layout/LineLength 8 | gem 'inspec', git: 'https://gitlab.com/saltstack-formulas/infrastructure/inspec', branch: 'ssf' 9 | # rubocop:enable Layout/LineLength 10 | 11 | # Install the `kitchen-docker` gem using `git` in order to gain a performance 12 | # improvement: avoid package installations which are already covered by the 13 | # `salt-image-builder` (i.e. the pre-salted images that we're using) 14 | # rubocop:disable Layout/LineLength 15 | gem 'kitchen-docker', git: 'https://gitlab.com/saltstack-formulas/infrastructure/kitchen-docker', branch: 'ssf' 16 | # rubocop:enable Layout/LineLength 17 | 18 | gem 'kitchen-inspec', '>= 2.5.0' 19 | gem 'kitchen-salt', '>= 0.7.2' 20 | 21 | group :vagrant do 22 | gem 'kitchen-vagrant' 23 | end 24 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://gitlab.com/saltstack-formulas/infrastructure/inspec 3 | revision: aaef842906a5666f0fc0b4f186b4dd3498f5b28c 4 | branch: ssf 5 | specs: 6 | inspec (5.18.15) 7 | cookstyle 8 | faraday_middleware (>= 0.12.2, < 1.1) 9 | inspec-core (= 5.18.15) 10 | mongo (= 2.13.2) 11 | progress_bar (~> 1.3.3) 12 | rake 13 | train (~> 3.10) 14 | train-aws (~> 0.2) 15 | train-habitat (~> 0.1) 16 | train-winrm (~> 0.2) 17 | inspec-core (5.18.15) 18 | addressable (~> 2.4) 19 | chef-telemetry (~> 1.0, >= 1.0.8) 20 | faraday (>= 0.9.0, < 1.5) 21 | faraday_middleware (~> 1.0) 22 | hashie (>= 3.4, < 5.0) 23 | license-acceptance (>= 0.2.13, < 3.0) 24 | method_source (>= 0.8, < 2.0) 25 | mixlib-log (~> 3.0) 26 | multipart-post (~> 2.0) 27 | parallel (~> 1.9) 28 | parslet (>= 1.5, < 2.0) 29 | pry (~> 0.13) 30 | rspec (>= 3.9, <= 3.11) 31 | rspec-its (~> 1.2) 32 | rubyzip (>= 1.2.2, < 3.0) 33 | semverse (~> 3.0) 34 | sslshake (~> 1.2) 35 | thor (>= 0.20, < 2.0) 36 | tomlrb (>= 1.2, < 2.1) 37 | train-core (~> 3.10) 38 | tty-prompt (~> 0.17) 39 | tty-table (~> 0.10) 40 | 41 | GIT 42 | remote: https://gitlab.com/saltstack-formulas/infrastructure/kitchen-docker 43 | revision: 9a09bc1e571e25f3ccabf4725ca2048d970fff82 44 | branch: ssf 45 | specs: 46 | kitchen-docker (2.12.0) 47 | test-kitchen (>= 1.0.0) 48 | 49 | GEM 50 | remote: https://rubygems.org/ 51 | specs: 52 | activesupport (7.0.3.1) 53 | concurrent-ruby (~> 1.0, >= 1.0.2) 54 | i18n (>= 1.6, < 2) 55 | minitest (>= 5.1) 56 | tzinfo (~> 2.0) 57 | addressable (2.8.0) 58 | public_suffix (>= 2.0.2, < 5.0) 59 | ast (2.4.2) 60 | aws-eventstream (1.2.0) 61 | aws-partitions (1.607.0) 62 | aws-sdk-alexaforbusiness (1.56.0) 63 | aws-sdk-core (~> 3, >= 3.127.0) 64 | aws-sigv4 (~> 1.1) 65 | aws-sdk-amplify (1.32.0) 66 | aws-sdk-core (~> 3, >= 3.120.0) 67 | aws-sigv4 (~> 1.1) 68 | aws-sdk-apigateway (1.78.0) 69 | aws-sdk-core (~> 3, >= 3.127.0) 70 | aws-sigv4 (~> 1.1) 71 | aws-sdk-apigatewayv2 (1.42.0) 72 | aws-sdk-core (~> 3, >= 3.127.0) 73 | aws-sigv4 (~> 1.1) 74 | aws-sdk-applicationautoscaling (1.51.0) 75 | aws-sdk-core (~> 3, >= 3.112.0) 76 | aws-sigv4 (~> 1.1) 77 | aws-sdk-athena (1.55.0) 78 | aws-sdk-core (~> 3, >= 3.127.0) 79 | aws-sigv4 (~> 1.1) 80 | aws-sdk-autoscaling (1.63.0) 81 | aws-sdk-core (~> 3, >= 3.112.0) 82 | aws-sigv4 (~> 1.1) 83 | aws-sdk-batch (1.47.0) 84 | aws-sdk-core (~> 3, >= 3.112.0) 85 | aws-sigv4 (~> 1.1) 86 | aws-sdk-budgets (1.50.0) 87 | aws-sdk-core (~> 3, >= 3.127.0) 88 | aws-sigv4 (~> 1.1) 89 | aws-sdk-cloudformation (1.70.0) 90 | aws-sdk-core (~> 3, >= 3.127.0) 91 | aws-sigv4 (~> 1.1) 92 | aws-sdk-cloudfront (1.65.0) 93 | aws-sdk-core (~> 3, >= 3.127.0) 94 | aws-sigv4 (~> 1.1) 95 | aws-sdk-cloudhsm (1.39.0) 96 | aws-sdk-core (~> 3, >= 3.127.0) 97 | aws-sigv4 (~> 1.1) 98 | aws-sdk-cloudhsmv2 (1.42.0) 99 | aws-sdk-core (~> 3, >= 3.127.0) 100 | aws-sigv4 (~> 1.1) 101 | aws-sdk-cloudtrail (1.49.0) 102 | aws-sdk-core (~> 3, >= 3.127.0) 103 | aws-sigv4 (~> 1.1) 104 | aws-sdk-cloudwatch (1.64.0) 105 | aws-sdk-core (~> 3, >= 3.127.0) 106 | aws-sigv4 (~> 1.1) 107 | aws-sdk-cloudwatchevents (1.46.0) 108 | aws-sdk-core (~> 3, >= 3.112.0) 109 | aws-sigv4 (~> 1.1) 110 | aws-sdk-cloudwatchlogs (1.53.0) 111 | aws-sdk-core (~> 3, >= 3.127.0) 112 | aws-sigv4 (~> 1.1) 113 | aws-sdk-codecommit (1.51.0) 114 | aws-sdk-core (~> 3, >= 3.127.0) 115 | aws-sigv4 (~> 1.1) 116 | aws-sdk-codedeploy (1.49.0) 117 | aws-sdk-core (~> 3, >= 3.127.0) 118 | aws-sigv4 (~> 1.1) 119 | aws-sdk-codepipeline (1.53.0) 120 | aws-sdk-core (~> 3, >= 3.127.0) 121 | aws-sigv4 (~> 1.1) 122 | aws-sdk-cognitoidentity (1.31.0) 123 | aws-sdk-core (~> 3, >= 3.112.0) 124 | aws-sigv4 (~> 1.1) 125 | aws-sdk-cognitoidentityprovider (1.53.0) 126 | aws-sdk-core (~> 3, >= 3.112.0) 127 | aws-sigv4 (~> 1.1) 128 | aws-sdk-configservice (1.79.0) 129 | aws-sdk-core (~> 3, >= 3.127.0) 130 | aws-sigv4 (~> 1.1) 131 | aws-sdk-core (3.131.2) 132 | aws-eventstream (~> 1, >= 1.0.2) 133 | aws-partitions (~> 1, >= 1.525.0) 134 | aws-sigv4 (~> 1.1) 135 | jmespath (~> 1, >= 1.6.1) 136 | aws-sdk-costandusagereportservice (1.40.0) 137 | aws-sdk-core (~> 3, >= 3.127.0) 138 | aws-sigv4 (~> 1.1) 139 | aws-sdk-databasemigrationservice (1.53.0) 140 | aws-sdk-core (~> 3, >= 3.112.0) 141 | aws-sigv4 (~> 1.1) 142 | aws-sdk-dynamodb (1.75.0) 143 | aws-sdk-core (~> 3, >= 3.127.0) 144 | aws-sigv4 (~> 1.1) 145 | aws-sdk-ec2 (1.322.0) 146 | aws-sdk-core (~> 3, >= 3.127.0) 147 | aws-sigv4 (~> 1.1) 148 | aws-sdk-ecr (1.56.0) 149 | aws-sdk-core (~> 3, >= 3.127.0) 150 | aws-sigv4 (~> 1.1) 151 | aws-sdk-ecrpublic (1.12.0) 152 | aws-sdk-core (~> 3, >= 3.127.0) 153 | aws-sigv4 (~> 1.1) 154 | aws-sdk-ecs (1.100.0) 155 | aws-sdk-core (~> 3, >= 3.127.0) 156 | aws-sigv4 (~> 1.1) 157 | aws-sdk-efs (1.54.0) 158 | aws-sdk-core (~> 3, >= 3.127.0) 159 | aws-sigv4 (~> 1.1) 160 | aws-sdk-eks (1.75.0) 161 | aws-sdk-core (~> 3, >= 3.127.0) 162 | aws-sigv4 (~> 1.1) 163 | aws-sdk-elasticache (1.78.0) 164 | aws-sdk-core (~> 3, >= 3.127.0) 165 | aws-sigv4 (~> 1.1) 166 | aws-sdk-elasticbeanstalk (1.51.0) 167 | aws-sdk-core (~> 3, >= 3.127.0) 168 | aws-sigv4 (~> 1.1) 169 | aws-sdk-elasticloadbalancing (1.40.0) 170 | aws-sdk-core (~> 3, >= 3.127.0) 171 | aws-sigv4 (~> 1.1) 172 | aws-sdk-elasticloadbalancingv2 (1.78.0) 173 | aws-sdk-core (~> 3, >= 3.127.0) 174 | aws-sigv4 (~> 1.1) 175 | aws-sdk-elasticsearchservice (1.65.0) 176 | aws-sdk-core (~> 3, >= 3.127.0) 177 | aws-sigv4 (~> 1.1) 178 | aws-sdk-emr (1.53.0) 179 | aws-sdk-core (~> 3, >= 3.121.2) 180 | aws-sigv4 (~> 1.1) 181 | aws-sdk-eventbridge (1.24.0) 182 | aws-sdk-core (~> 3, >= 3.112.0) 183 | aws-sigv4 (~> 1.1) 184 | aws-sdk-firehose (1.48.0) 185 | aws-sdk-core (~> 3, >= 3.127.0) 186 | aws-sigv4 (~> 1.1) 187 | aws-sdk-glue (1.88.0) 188 | aws-sdk-core (~> 3, >= 3.112.0) 189 | aws-sigv4 (~> 1.1) 190 | aws-sdk-guardduty (1.58.0) 191 | aws-sdk-core (~> 3, >= 3.127.0) 192 | aws-sigv4 (~> 1.1) 193 | aws-sdk-iam (1.69.0) 194 | aws-sdk-core (~> 3, >= 3.127.0) 195 | aws-sigv4 (~> 1.1) 196 | aws-sdk-kafka (1.50.0) 197 | aws-sdk-core (~> 3, >= 3.127.0) 198 | aws-sigv4 (~> 1.1) 199 | aws-sdk-kinesis (1.41.0) 200 | aws-sdk-core (~> 3, >= 3.127.0) 201 | aws-sigv4 (~> 1.1) 202 | aws-sdk-kms (1.57.0) 203 | aws-sdk-core (~> 3, >= 3.127.0) 204 | aws-sigv4 (~> 1.1) 205 | aws-sdk-lambda (1.84.0) 206 | aws-sdk-core (~> 3, >= 3.127.0) 207 | aws-sigv4 (~> 1.1) 208 | aws-sdk-mq (1.40.0) 209 | aws-sdk-core (~> 3, >= 3.120.0) 210 | aws-sigv4 (~> 1.1) 211 | aws-sdk-networkfirewall (1.17.0) 212 | aws-sdk-core (~> 3, >= 3.127.0) 213 | aws-sigv4 (~> 1.1) 214 | aws-sdk-networkmanager (1.24.0) 215 | aws-sdk-core (~> 3, >= 3.127.0) 216 | aws-sigv4 (~> 1.1) 217 | aws-sdk-organizations (1.59.0) 218 | aws-sdk-core (~> 3, >= 3.112.0) 219 | aws-sigv4 (~> 1.1) 220 | aws-sdk-ram (1.26.0) 221 | aws-sdk-core (~> 3, >= 3.112.0) 222 | aws-sigv4 (~> 1.1) 223 | aws-sdk-rds (1.148.0) 224 | aws-sdk-core (~> 3, >= 3.127.0) 225 | aws-sigv4 (~> 1.1) 226 | aws-sdk-redshift (1.84.0) 227 | aws-sdk-core (~> 3, >= 3.127.0) 228 | aws-sigv4 (~> 1.1) 229 | aws-sdk-route53 (1.63.0) 230 | aws-sdk-core (~> 3, >= 3.127.0) 231 | aws-sigv4 (~> 1.1) 232 | aws-sdk-route53domains (1.40.0) 233 | aws-sdk-core (~> 3, >= 3.127.0) 234 | aws-sigv4 (~> 1.1) 235 | aws-sdk-route53resolver (1.37.0) 236 | aws-sdk-core (~> 3, >= 3.127.0) 237 | aws-sigv4 (~> 1.1) 238 | aws-sdk-s3 (1.114.0) 239 | aws-sdk-core (~> 3, >= 3.127.0) 240 | aws-sdk-kms (~> 1) 241 | aws-sigv4 (~> 1.4) 242 | aws-sdk-s3control (1.43.0) 243 | aws-sdk-core (~> 3, >= 3.122.0) 244 | aws-sigv4 (~> 1.1) 245 | aws-sdk-secretsmanager (1.46.0) 246 | aws-sdk-core (~> 3, >= 3.112.0) 247 | aws-sigv4 (~> 1.1) 248 | aws-sdk-securityhub (1.67.0) 249 | aws-sdk-core (~> 3, >= 3.127.0) 250 | aws-sigv4 (~> 1.1) 251 | aws-sdk-servicecatalog (1.60.0) 252 | aws-sdk-core (~> 3, >= 3.112.0) 253 | aws-sigv4 (~> 1.1) 254 | aws-sdk-ses (1.41.0) 255 | aws-sdk-core (~> 3, >= 3.120.0) 256 | aws-sigv4 (~> 1.1) 257 | aws-sdk-shield (1.48.0) 258 | aws-sdk-core (~> 3, >= 3.127.0) 259 | aws-sigv4 (~> 1.1) 260 | aws-sdk-signer (1.32.0) 261 | aws-sdk-core (~> 3, >= 3.120.0) 262 | aws-sigv4 (~> 1.1) 263 | aws-sdk-simpledb (1.29.0) 264 | aws-sdk-core (~> 3, >= 3.120.0) 265 | aws-sigv2 (~> 1.0) 266 | aws-sdk-sms (1.40.0) 267 | aws-sdk-core (~> 3, >= 3.127.0) 268 | aws-sigv4 (~> 1.1) 269 | aws-sdk-sns (1.53.0) 270 | aws-sdk-core (~> 3, >= 3.127.0) 271 | aws-sigv4 (~> 1.1) 272 | aws-sdk-sqs (1.51.1) 273 | aws-sdk-core (~> 3, >= 3.127.0) 274 | aws-sigv4 (~> 1.1) 275 | aws-sdk-ssm (1.137.0) 276 | aws-sdk-core (~> 3, >= 3.127.0) 277 | aws-sigv4 (~> 1.1) 278 | aws-sdk-states (1.39.0) 279 | aws-sdk-core (~> 3, >= 3.112.0) 280 | aws-sigv4 (~> 1.1) 281 | aws-sdk-synthetics (1.19.0) 282 | aws-sdk-core (~> 3, >= 3.121.2) 283 | aws-sigv4 (~> 1.1) 284 | aws-sdk-transfer (1.34.0) 285 | aws-sdk-core (~> 3, >= 3.112.0) 286 | aws-sigv4 (~> 1.1) 287 | aws-sdk-waf (1.43.0) 288 | aws-sdk-core (~> 3, >= 3.122.0) 289 | aws-sigv4 (~> 1.1) 290 | aws-sigv2 (1.1.0) 291 | aws-sigv4 (1.5.0) 292 | aws-eventstream (~> 1, >= 1.0.2) 293 | azure_graph_rbac (0.17.2) 294 | ms_rest_azure (~> 0.12.0) 295 | azure_mgmt_key_vault (0.17.7) 296 | ms_rest_azure (~> 0.12.0) 297 | azure_mgmt_resources (0.18.2) 298 | ms_rest_azure (~> 0.12.0) 299 | azure_mgmt_security (0.19.0) 300 | ms_rest_azure (~> 0.12.0) 301 | azure_mgmt_storage (0.23.0) 302 | ms_rest_azure (~> 0.12.0) 303 | bcrypt_pbkdf (1.1.0) 304 | bson (4.15.0) 305 | builder (3.2.4) 306 | chef-config (17.10.0) 307 | addressable 308 | chef-utils (= 17.10.0) 309 | fuzzyurl 310 | mixlib-config (>= 2.2.12, < 4.0) 311 | mixlib-shellout (>= 2.0, < 4.0) 312 | tomlrb (~> 1.2) 313 | chef-telemetry (1.1.1) 314 | chef-config 315 | concurrent-ruby (~> 1.0) 316 | chef-utils (17.10.0) 317 | concurrent-ruby 318 | coderay (1.1.3) 319 | concurrent-ruby (1.1.10) 320 | cookstyle (7.32.1) 321 | rubocop (= 1.25.1) 322 | declarative (0.0.20) 323 | diff-lcs (1.5.0) 324 | docker-api (2.2.0) 325 | excon (>= 0.47.0) 326 | multi_json 327 | domain_name (0.5.20190701) 328 | unf (>= 0.0.5, < 1.0.0) 329 | ed25519 (1.3.0) 330 | erubi (1.10.0) 331 | excon (0.92.3) 332 | faraday (1.4.3) 333 | faraday-em_http (~> 1.0) 334 | faraday-em_synchrony (~> 1.0) 335 | faraday-excon (~> 1.1) 336 | faraday-net_http (~> 1.0) 337 | faraday-net_http_persistent (~> 1.1) 338 | multipart-post (>= 1.2, < 3) 339 | ruby2_keywords (>= 0.0.4) 340 | faraday-cookie_jar (0.0.7) 341 | faraday (>= 0.8.0) 342 | http-cookie (~> 1.0.0) 343 | faraday-em_http (1.0.0) 344 | faraday-em_synchrony (1.0.0) 345 | faraday-excon (1.1.0) 346 | faraday-net_http (1.0.1) 347 | faraday-net_http_persistent (1.2.0) 348 | faraday_middleware (1.0.0) 349 | faraday (~> 1.0) 350 | ffi (1.15.5) 351 | fuzzyurl (0.9.0) 352 | google-api-client (0.52.0) 353 | addressable (~> 2.5, >= 2.5.1) 354 | googleauth (~> 0.9) 355 | httpclient (>= 2.8.1, < 3.0) 356 | mini_mime (~> 1.0) 357 | representable (~> 3.0) 358 | retriable (>= 2.0, < 4.0) 359 | rexml 360 | signet (~> 0.12) 361 | googleauth (0.14.0) 362 | faraday (>= 0.17.3, < 2.0) 363 | jwt (>= 1.4, < 3.0) 364 | memoist (~> 0.16) 365 | multi_json (~> 1.11) 366 | os (>= 0.9, < 2.0) 367 | signet (~> 0.14) 368 | gssapi (1.3.1) 369 | ffi (>= 1.0.1) 370 | gyoku (1.4.0) 371 | builder (>= 2.1.2) 372 | rexml (~> 3.0) 373 | hashie (4.1.0) 374 | highline (2.0.3) 375 | http-cookie (1.0.5) 376 | domain_name (~> 0.5) 377 | httpclient (2.8.3) 378 | i18n (1.12.0) 379 | concurrent-ruby (~> 1.0) 380 | inifile (3.0.0) 381 | jmespath (1.6.1) 382 | json (2.6.2) 383 | jwt (2.4.1) 384 | kitchen-inspec (2.6.1) 385 | hashie (>= 3.4, <= 5.0) 386 | inspec (>= 2.2.64, < 7.0) 387 | test-kitchen (>= 2.7, < 4) 388 | kitchen-salt (0.7.2) 389 | hashie (>= 3.5) 390 | test-kitchen (>= 1.4) 391 | kitchen-vagrant (1.12.0) 392 | test-kitchen (>= 1.4, < 4) 393 | license-acceptance (2.1.13) 394 | pastel (~> 0.7) 395 | tomlrb (>= 1.2, < 3.0) 396 | tty-box (~> 0.6) 397 | tty-prompt (~> 0.20) 398 | little-plugger (1.1.4) 399 | logging (2.3.1) 400 | little-plugger (~> 1.1) 401 | multi_json (~> 1.14) 402 | memoist (0.16.2) 403 | method_source (1.0.0) 404 | mini_mime (1.1.2) 405 | minitest (5.16.2) 406 | mixlib-config (3.0.27) 407 | tomlrb 408 | mixlib-install (3.12.19) 409 | mixlib-shellout 410 | mixlib-versioning 411 | thor 412 | mixlib-log (3.0.9) 413 | mixlib-shellout (3.2.7) 414 | chef-utils 415 | mixlib-versioning (1.2.12) 416 | mongo (2.13.2) 417 | bson (>= 4.8.2, < 5.0.0) 418 | ms_rest (0.7.6) 419 | concurrent-ruby (~> 1.0) 420 | faraday (>= 0.9, < 2.0.0) 421 | timeliness (~> 0.3.10) 422 | ms_rest_azure (0.12.0) 423 | concurrent-ruby (~> 1.0) 424 | faraday (>= 0.9, < 2.0.0) 425 | faraday-cookie_jar (~> 0.0.6) 426 | ms_rest (~> 0.7.6) 427 | multi_json (1.15.0) 428 | multipart-post (2.2.3) 429 | net-scp (3.0.0) 430 | net-ssh (>= 2.6.5, < 7.0.0) 431 | net-ssh (6.1.0) 432 | net-ssh-gateway (2.0.0) 433 | net-ssh (>= 4.0.0) 434 | nori (2.6.0) 435 | options (2.3.2) 436 | os (1.1.4) 437 | parallel (1.22.1) 438 | parser (3.1.2.0) 439 | ast (~> 2.4.1) 440 | parslet (1.8.2) 441 | pastel (0.8.0) 442 | tty-color (~> 0.5) 443 | progress_bar (1.3.3) 444 | highline (>= 1.6, < 3) 445 | options (~> 2.3.0) 446 | pry (0.14.1) 447 | coderay (~> 1.1) 448 | method_source (~> 1.0) 449 | public_suffix (4.0.7) 450 | rainbow (3.1.1) 451 | rake (13.0.6) 452 | regexp_parser (2.5.0) 453 | representable (3.2.0) 454 | declarative (< 0.1.0) 455 | trailblazer-option (>= 0.1.1, < 0.2.0) 456 | uber (< 0.2.0) 457 | retriable (3.1.2) 458 | rexml (3.2.5) 459 | rspec (3.11.0) 460 | rspec-core (~> 3.11.0) 461 | rspec-expectations (~> 3.11.0) 462 | rspec-mocks (~> 3.11.0) 463 | rspec-core (3.11.0) 464 | rspec-support (~> 3.11.0) 465 | rspec-expectations (3.11.0) 466 | diff-lcs (>= 1.2.0, < 2.0) 467 | rspec-support (~> 3.11.0) 468 | rspec-its (1.3.0) 469 | rspec-core (>= 3.0.0) 470 | rspec-expectations (>= 3.0.0) 471 | rspec-mocks (3.11.1) 472 | diff-lcs (>= 1.2.0, < 2.0) 473 | rspec-support (~> 3.11.0) 474 | rspec-support (3.11.0) 475 | rubocop (1.25.1) 476 | parallel (~> 1.10) 477 | parser (>= 3.1.0.0) 478 | rainbow (>= 2.2.2, < 4.0) 479 | regexp_parser (>= 1.8, < 3.0) 480 | rexml 481 | rubocop-ast (>= 1.15.1, < 2.0) 482 | ruby-progressbar (~> 1.7) 483 | unicode-display_width (>= 1.4.0, < 3.0) 484 | rubocop-ast (1.19.1) 485 | parser (>= 3.1.1.0) 486 | ruby-progressbar (1.11.0) 487 | ruby2_keywords (0.0.5) 488 | rubyntlm (0.6.3) 489 | rubyzip (2.3.2) 490 | semverse (3.0.2) 491 | signet (0.17.0) 492 | addressable (~> 2.8) 493 | faraday (>= 0.17.5, < 3.a) 494 | jwt (>= 1.5, < 3.0) 495 | multi_json (~> 1.10) 496 | sslshake (1.3.1) 497 | strings (0.2.1) 498 | strings-ansi (~> 0.2) 499 | unicode-display_width (>= 1.5, < 3.0) 500 | unicode_utils (~> 1.4) 501 | strings-ansi (0.2.0) 502 | test-kitchen (3.3.1) 503 | bcrypt_pbkdf (~> 1.0) 504 | chef-utils (>= 16.4.35) 505 | ed25519 (~> 1.2) 506 | license-acceptance (>= 1.0.11, < 3.0) 507 | mixlib-install (~> 3.6) 508 | mixlib-shellout (>= 1.2, < 4.0) 509 | net-scp (>= 1.1, < 4.0) 510 | net-ssh (>= 2.9, < 7.0) 511 | net-ssh-gateway (>= 1.2, < 3.0) 512 | thor (>= 0.19, < 2.0) 513 | winrm (~> 2.0) 514 | winrm-elevated (~> 1.0) 515 | winrm-fs (~> 1.1) 516 | thor (1.2.1) 517 | timeliness (0.3.10) 518 | tomlrb (1.3.0) 519 | trailblazer-option (0.1.2) 520 | train (3.10.1) 521 | activesupport (>= 6.0.3.1) 522 | azure_graph_rbac (~> 0.16) 523 | azure_mgmt_key_vault (~> 0.17) 524 | azure_mgmt_resources (~> 0.15) 525 | azure_mgmt_security (~> 0.18) 526 | azure_mgmt_storage (~> 0.18) 527 | docker-api (>= 1.26, < 3.0) 528 | google-api-client (>= 0.23.9, <= 0.52.0) 529 | googleauth (>= 0.6.6, <= 0.14.0) 530 | inifile (~> 3.0) 531 | train-core (= 3.10.1) 532 | train-winrm (~> 0.2) 533 | train-aws (0.2.24) 534 | aws-sdk-alexaforbusiness (~> 1.0) 535 | aws-sdk-amplify (~> 1.32.0) 536 | aws-sdk-apigateway (~> 1.0) 537 | aws-sdk-apigatewayv2 (~> 1.0) 538 | aws-sdk-applicationautoscaling (>= 1.46, < 1.52) 539 | aws-sdk-athena (~> 1.0) 540 | aws-sdk-autoscaling (>= 1.22, < 1.64) 541 | aws-sdk-batch (>= 1.36, < 1.48) 542 | aws-sdk-budgets (~> 1.0) 543 | aws-sdk-cloudformation (~> 1.0) 544 | aws-sdk-cloudfront (~> 1.0) 545 | aws-sdk-cloudhsm (~> 1.0) 546 | aws-sdk-cloudhsmv2 (~> 1.0) 547 | aws-sdk-cloudtrail (~> 1.8) 548 | aws-sdk-cloudwatch (~> 1.13) 549 | aws-sdk-cloudwatchevents (>= 1.36, < 1.47) 550 | aws-sdk-cloudwatchlogs (~> 1.13) 551 | aws-sdk-codecommit (~> 1.0) 552 | aws-sdk-codedeploy (~> 1.0) 553 | aws-sdk-codepipeline (~> 1.0) 554 | aws-sdk-cognitoidentity (>= 1.26, < 1.32) 555 | aws-sdk-cognitoidentityprovider (>= 1.46, < 1.54) 556 | aws-sdk-configservice (~> 1.21) 557 | aws-sdk-core (~> 3.0) 558 | aws-sdk-costandusagereportservice (~> 1.6) 559 | aws-sdk-databasemigrationservice (>= 1.42, < 1.54) 560 | aws-sdk-dynamodb (~> 1.31) 561 | aws-sdk-ec2 (~> 1.70) 562 | aws-sdk-ecr (~> 1.18) 563 | aws-sdk-ecrpublic (~> 1.3) 564 | aws-sdk-ecs (~> 1.30) 565 | aws-sdk-efs (~> 1.0) 566 | aws-sdk-eks (~> 1.9) 567 | aws-sdk-elasticache (~> 1.0) 568 | aws-sdk-elasticbeanstalk (~> 1.0) 569 | aws-sdk-elasticloadbalancing (~> 1.8) 570 | aws-sdk-elasticloadbalancingv2 (~> 1.0) 571 | aws-sdk-elasticsearchservice (~> 1.0) 572 | aws-sdk-emr (~> 1.53.0) 573 | aws-sdk-eventbridge (~> 1.24.0) 574 | aws-sdk-firehose (~> 1.0) 575 | aws-sdk-glue (>= 1.71, < 1.89) 576 | aws-sdk-guardduty (~> 1.31) 577 | aws-sdk-iam (~> 1.13) 578 | aws-sdk-kafka (~> 1.0) 579 | aws-sdk-kinesis (~> 1.0) 580 | aws-sdk-kms (~> 1.13) 581 | aws-sdk-lambda (~> 1.0) 582 | aws-sdk-mq (~> 1.40.0) 583 | aws-sdk-networkfirewall (>= 1.6.0) 584 | aws-sdk-networkmanager (>= 1.13.0) 585 | aws-sdk-organizations (>= 1.17, < 1.60) 586 | aws-sdk-ram (>= 1.21, < 1.27) 587 | aws-sdk-rds (~> 1.43) 588 | aws-sdk-redshift (~> 1.0) 589 | aws-sdk-route53 (~> 1.0) 590 | aws-sdk-route53domains (~> 1.0) 591 | aws-sdk-route53resolver (~> 1.0) 592 | aws-sdk-s3 (~> 1.30) 593 | aws-sdk-s3control (~> 1.43.0) 594 | aws-sdk-secretsmanager (>= 1.42, < 1.47) 595 | aws-sdk-securityhub (~> 1.0) 596 | aws-sdk-servicecatalog (>= 1.48, < 1.61) 597 | aws-sdk-ses (~> 1.41.0) 598 | aws-sdk-shield (~> 1.30) 599 | aws-sdk-signer (~> 1.32.0) 600 | aws-sdk-simpledb (~> 1.29.0) 601 | aws-sdk-sms (~> 1.0) 602 | aws-sdk-sns (~> 1.9) 603 | aws-sdk-sqs (~> 1.10) 604 | aws-sdk-ssm (~> 1.0) 605 | aws-sdk-states (>= 1.35, < 1.40) 606 | aws-sdk-synthetics (~> 1.19.0) 607 | aws-sdk-transfer (>= 1.26, < 1.35) 608 | aws-sdk-waf (~> 1.43.0) 609 | train-core (3.10.1) 610 | addressable (~> 2.5) 611 | ffi (!= 1.13.0) 612 | json (>= 1.8, < 3.0) 613 | mixlib-shellout (>= 2.0, < 4.0) 614 | net-scp (>= 1.2, < 4.0) 615 | net-ssh (>= 2.9, < 7.0) 616 | train-habitat (0.2.22) 617 | train-winrm (0.2.13) 618 | winrm (>= 2.3.6, < 3.0) 619 | winrm-elevated (~> 1.2.2) 620 | winrm-fs (~> 1.0) 621 | tty-box (0.7.0) 622 | pastel (~> 0.8) 623 | strings (~> 0.2.0) 624 | tty-cursor (~> 0.7) 625 | tty-color (0.6.0) 626 | tty-cursor (0.7.1) 627 | tty-prompt (0.23.1) 628 | pastel (~> 0.8) 629 | tty-reader (~> 0.8) 630 | tty-reader (0.9.0) 631 | tty-cursor (~> 0.7) 632 | tty-screen (~> 0.8) 633 | wisper (~> 2.0) 634 | tty-screen (0.8.1) 635 | tty-table (0.12.0) 636 | pastel (~> 0.8) 637 | strings (~> 0.2.0) 638 | tty-screen (~> 0.8) 639 | tzinfo (2.0.4) 640 | concurrent-ruby (~> 1.0) 641 | uber (0.1.0) 642 | unf (0.1.4) 643 | unf_ext 644 | unf_ext (0.0.8.2) 645 | unicode-display_width (2.2.0) 646 | unicode_utils (1.4.0) 647 | winrm (2.3.6) 648 | builder (>= 2.1.2) 649 | erubi (~> 1.8) 650 | gssapi (~> 1.2) 651 | gyoku (~> 1.0) 652 | httpclient (~> 2.2, >= 2.2.0.2) 653 | logging (>= 1.6.1, < 3.0) 654 | nori (~> 2.0) 655 | rubyntlm (~> 0.6.0, >= 0.6.3) 656 | winrm-elevated (1.2.3) 657 | erubi (~> 1.8) 658 | winrm (~> 2.0) 659 | winrm-fs (~> 1.0) 660 | winrm-fs (1.3.5) 661 | erubi (~> 1.8) 662 | logging (>= 1.6.1, < 3.0) 663 | rubyzip (~> 2.0) 664 | winrm (~> 2.0) 665 | wisper (2.0.1) 666 | 667 | PLATFORMS 668 | ruby 669 | 670 | DEPENDENCIES 671 | inspec! 672 | kitchen-docker! 673 | kitchen-inspec (>= 2.5.0) 674 | kitchen-salt (>= 0.7.2) 675 | kitchen-vagrant 676 | 677 | BUNDLED WITH 678 | 2.1.2 679 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Salt Stack Formulas 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /bin/install-hooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -o nounset # Treat unset variables as an error and immediately exit 3 | set -o errexit # If a command fails exit the whole script 4 | 5 | if [ "${DEBUG:-false}" = "true" ]; then 6 | set -x # Run the entire script in debug mode 7 | fi 8 | 9 | if ! command -v pre-commit >/dev/null 2>&1; then 10 | echo "pre-commit not found: please install or check your PATH" >&2 11 | echo "See https://pre-commit.com/#installation" >&2 12 | exit 1 13 | fi 14 | 15 | pre-commit install --install-hooks 16 | pre-commit install --hook-type commit-msg --install-hooks 17 | -------------------------------------------------------------------------------- /bin/kitchen: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'kitchen' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require 'pathname' 12 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', 13 | Pathname.new(__FILE__).realpath) 14 | 15 | bundle_binstub = File.expand_path('bundle', __dir__) 16 | 17 | if File.file?(bundle_binstub) 18 | if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ 19 | load(bundle_binstub) 20 | else 21 | abort( 22 | 'Your `bin/bundle` was not generated by Bundler, ' \ 23 | 'so this binstub cannot run. Replace `bin/bundle` by running ' \ 24 | '`bundle binstubs bundler --force`, then run this command again.' 25 | ) 26 | end 27 | end 28 | 29 | require 'rubygems' 30 | require 'bundler/setup' 31 | 32 | load Gem.bin_path('test-kitchen', 'kitchen') 33 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | rules: { 4 | 'body-max-line-length': [2, 'always', 120], 5 | 'footer-max-line-length': [2, 'always', 120], 6 | 'header-max-length': [2, 'always', 72], 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /docs/AUTHORS.rst: -------------------------------------------------------------------------------- 1 | .. role:: raw-html-m2r(raw) 2 | :format: html 3 | 4 | 5 | Authors 6 | ======= 7 | 8 | This list is sorted by the number of commits per contributor in *descending* order. 9 | 10 | .. list-table:: 11 | :header-rows: 1 12 | 13 | * - Avatar 14 | - Contributor 15 | - Contributions 16 | * - :raw-html-m2r:`@myii` 17 | - `@myii `_ 18 | - 118 19 | * - :raw-html-m2r:`@gravyboat` 20 | - `@gravyboat `_ 21 | - 12 22 | * - :raw-html-m2r:`@noelmcloughlin` 23 | - `@noelmcloughlin `_ 24 | - 10 25 | * - :raw-html-m2r:`@Granjow` 26 | - `@Granjow `_ 27 | - 7 28 | * - :raw-html-m2r:`@javierbertoli` 29 | - `@javierbertoli `_ 30 | - 5 31 | * - :raw-html-m2r:`@johnkeates` 32 | - `@johnkeates `_ 33 | - 5 34 | * - :raw-html-m2r:`@aboe76` 35 | - `@aboe76 `_ 36 | - 5 37 | * - :raw-html-m2r:`@fooka03` 38 | - `@fooka03 `_ 39 | - 5 40 | * - :raw-html-m2r:`@dafyddj` 41 | - `@dafyddj `_ 42 | - 3 43 | * - :raw-html-m2r:`@schwing` 44 | - `@schwing `_ 45 | - 3 46 | * - :raw-html-m2r:`@techhat` 47 | - `@techhat `_ 48 | - 3 49 | * - :raw-html-m2r:`@luislobo` 50 | - `@luislobo `_ 51 | - 3 52 | * - :raw-html-m2r:`@malept` 53 | - `@malept `_ 54 | - 3 55 | * - :raw-html-m2r:`@stp-ip` 56 | - `@stp-ip `_ 57 | - 3 58 | * - :raw-html-m2r:`@myoung34` 59 | - `@myoung34 `_ 60 | - 3 61 | * - :raw-html-m2r:`@iggy` 62 | - `@iggy `_ 63 | - 2 64 | * - :raw-html-m2r:`@johnklehm` 65 | - `@johnklehm `_ 66 | - 2 67 | * - :raw-html-m2r:`@JulioECastro` 68 | - `@JulioECastro `_ 69 | - 2 70 | * - :raw-html-m2r:`@nmadhok` 71 | - `@nmadhok `_ 72 | - 2 73 | * - :raw-html-m2r:`@whiteinge` 74 | - `@whiteinge `_ 75 | - 2 76 | * - :raw-html-m2r:`@timka` 77 | - `@timka `_ 78 | - 2 79 | * - :raw-html-m2r:`@akatrevorjay` 80 | - `@akatrevorjay `_ 81 | - 2 82 | * - :raw-html-m2r:`@brandonparsons` 83 | - `@brandonparsons `_ 84 | - 2 85 | * - :raw-html-m2r:`@ek9` 86 | - `@ek9 `_ 87 | - 2 88 | * - :raw-html-m2r:`@puneetk` 89 | - `@puneetk `_ 90 | - 2 91 | * - :raw-html-m2r:`@auser` 92 | - `@auser `_ 93 | - 1 94 | * - :raw-html-m2r:`@briandesousa` 95 | - `@briandesousa `_ 96 | - 1 97 | * - :raw-html-m2r:`@baby-gnu` 98 | - `@baby-gnu `_ 99 | - 1 100 | * - :raw-html-m2r:`@gesundkrank` 101 | - `@gesundkrank `_ 102 | - 1 103 | * - :raw-html-m2r:`@Lucianovici` 104 | - `@Lucianovici `_ 105 | - 1 106 | * - :raw-html-m2r:`@mdzidic` 107 | - `@mdzidic `_ 108 | - 1 109 | * - :raw-html-m2r:`@meganlkm` 110 | - `@meganlkm `_ 111 | - 1 112 | * - :raw-html-m2r:`@smitelli` 113 | - `@smitelli `_ 114 | - 1 115 | * - :raw-html-m2r:`@babilen` 116 | - `@babilen `_ 117 | - 1 118 | * - :raw-html-m2r:`@Yoda-BZH` 119 | - `@Yoda-BZH `_ 120 | - 1 121 | * - :raw-html-m2r:`@abednarik` 122 | - `@abednarik `_ 123 | - 1 124 | * - :raw-html-m2r:`@chrisportela` 125 | - `@chrisportela `_ 126 | - 1 127 | 128 | 129 | ---- 130 | 131 | Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2022-06-07. 132 | -------------------------------------------------------------------------------- /docs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | 2 | Changelog 3 | ========= 4 | 5 | `2.4.0 `_ (2022-06-07) 6 | ------------------------------------------------------------------------------------------------------ 7 | 8 | Continuous Integration 9 | ^^^^^^^^^^^^^^^^^^^^^^ 10 | 11 | 12 | * **kitchen+gitlab:** update for new pre-salted images [skip ci] (\ `3c2ee6e `_\ ) 13 | * **vagrant:** use ``linked_clone`` at all times (inc. CI) [skip ci] (\ `0db341d `_\ ) 14 | 15 | Features 16 | ^^^^^^^^ 17 | 18 | 19 | * **os*map:** update version installed on Debian/Ubuntu (\ `b0c4bd9 `_\ ) 20 | * **os*map:** update version installed on Debian/Ubuntu [skip ci] (\ `f204851 `_\ ) 21 | 22 | Tests 23 | ^^^^^ 24 | 25 | 26 | * **system.rb:** add support for ``mac_os_x`` [skip ci] (\ `74d8a56 `_\ ) 27 | 28 | `2.3.0 `_ (2022-03-24) 29 | ------------------------------------------------------------------------------------------------------ 30 | 31 | Continuous Integration 32 | ^^^^^^^^^^^^^^^^^^^^^^ 33 | 34 | 35 | * enable Vagrant-based testing using GitHub Actions (\ `0d1bd4a `_\ ) 36 | * update linters to latest versions [skip ci] (\ `ed63546 `_\ ) 37 | * **gemfile:** allow rubygems proxy to be provided as an env var [skip ci] (\ `478c2c7 `_\ ) 38 | * **kitchen+gitlab:** update for new pre-salted images [skip ci] (\ `7e237d1 `_\ ) 39 | 40 | Documentation 41 | ^^^^^^^^^^^^^ 42 | 43 | 44 | * **readme:** add ``Testing with Vagrant`` section (\ `05c942e `_\ ) 45 | 46 | Features 47 | ^^^^^^^^ 48 | 49 | 50 | * **freebsd:** add support to work with the ``default`` suite (\ `0f50475 `_\ ) 51 | * **openbsd:** add support to work with the ``default`` suite (\ `1d97949 `_\ ) 52 | * **os*map:** update version installed on Debian/Ubuntu [skip ci] (\ `d4407fa `_\ ) 53 | * **os*map:** update version installed on Debian/Ubuntu [skip ci] (\ `e806dcb `_\ ) 54 | * **os*map:** update version installed on Debian/Ubuntu [skip ci] (\ `2976bf2 `_\ ) 55 | * **osfingermap:** use last working version for Fedora 34 [skip ci] (\ `c38f422 `_\ ) 56 | * **windows:** add support to work with the ``default`` suite (\ `f1066d6 `_\ ) 57 | 58 | Tests 59 | ^^^^^ 60 | 61 | 62 | * **system:** add ``build_platform_codename`` [skip ci] (\ `de02abe `_\ ) 63 | 64 | `2.2.0 `_ (2022-01-16) 65 | ------------------------------------------------------------------------------------------------------ 66 | 67 | Code Refactoring 68 | ^^^^^^^^^^^^^^^^ 69 | 70 | 71 | * add ``osfingermap`` (\ `e5f9399 `_\ ) 72 | 73 | Features 74 | ^^^^^^^^ 75 | 76 | 77 | * **tumbleweed:** update version via. new ``oscodenamemap`` (\ `3ce9ef2 `_\ ) 78 | 79 | `2.1.0 `_ (2022-01-14) 80 | ------------------------------------------------------------------------------------------------------ 81 | 82 | Continuous Integration 83 | ^^^^^^^^^^^^^^^^^^^^^^ 84 | 85 | 86 | * **kitchen+ci:** update with ``3004`` pre-salted images/boxes [skip ci] (\ `29a797a `_\ ) 87 | 88 | Features 89 | ^^^^^^^^ 90 | 91 | 92 | * **repo:** update installation ``version`` [skip ci] (\ `4902faf `_\ ) 93 | * **repo:** update installation version (\ `cad52df `_\ ) 94 | 95 | `2.0.0 `_ (2021-11-12) 96 | ------------------------------------------------------------------------------------------------------ 97 | 98 | Bug Fixes 99 | ^^^^^^^^^ 100 | 101 | 102 | * **package:** use correct version parameter with packages (\ `6ce8259 `_\ ) 103 | 104 | BREAKING CHANGES 105 | ^^^^^^^^^^^^^^^^ 106 | 107 | 108 | * **package:** ``node:pkg:version`` needs to be specified as the 109 | full version number (ie, 16.13.0) instead of just the major number 110 | in order to be able to properly install using packages and pin the 111 | desired version. 112 | 113 | `1.1.1 `_ (2021-10-27) 114 | ------------------------------------------------------------------------------------------------------ 115 | 116 | Bug Fixes 117 | ^^^^^^^^^ 118 | 119 | 120 | * **package:** remove double colon on pillar item (\ `6049849 `_\ ) 121 | 122 | Code Refactoring 123 | ^^^^^^^^^^^^^^^^ 124 | 125 | 126 | * **jinja:** remove on due date (\ `eddad91 `_\ ) 127 | 128 | `1.1.0 `_ (2021-10-26) 129 | ------------------------------------------------------------------------------------------------------ 130 | 131 | Bug Fixes 132 | ^^^^^^^^^ 133 | 134 | 135 | * **debian:** allow version to be user-provided, don't force v13 (\ `9b1eb68 `_\ ) 136 | * **debian:** don't include comps in name and in comps, comps is string (\ `becd5ba `_\ ) 137 | * **debian:** don't rely on pillar.get, build repo.name when needed (\ `67a3dda `_\ ) 138 | 139 | Continuous Integration 140 | ^^^^^^^^^^^^^^^^^^^^^^ 141 | 142 | 143 | * **3003.1:** update inc. AlmaLinux, Rocky & ``rst-lint`` [skip ci] (\ `b47573e `_\ ) 144 | * **gemfile+lock:** use ``ssf`` customised ``inspec`` repo [skip ci] (\ `426bf1e `_\ ) 145 | * **kitchen:** move ``provisioner`` block & update ``run_command`` [skip ci] (\ `a40e1e8 `_\ ) 146 | * **kitchen+ci:** update with latest ``3003.2`` pre-salted images [skip ci] (\ `e60311b `_\ ) 147 | * **kitchen+ci:** update with latest CVE pre-salted images [skip ci] (\ `0c485e2 `_\ ) 148 | * add ``arch-master`` to matrix and update ``.travis.yml`` [skip ci] (\ `922e34d `_\ ) 149 | * add Debian 11 Bullseye & update ``yamllint`` configuration [skip ci] (\ `25d4626 `_\ ) 150 | * **commitlint:** ensure ``upstream/master`` uses main repo URL [skip ci] (\ `c7e7957 `_\ ) 151 | * **gemfile+lock:** use ``ssf`` customised ``kitchen-docker`` repo [skip ci] (\ `a099234 `_\ ) 152 | * **gitlab-ci:** add ``rubocop`` linter (with ``allow_failure``\ ) [skip ci] (\ `ae1484a `_\ ) 153 | * **kitchen+ci:** use latest pre-salted images (after CVE) [skip ci] (\ `490ccb2 `_\ ) 154 | * **kitchen+gitlab:** adjust matrix to add ``3003`` [skip ci] (\ `6138902 `_\ ) 155 | * **kitchen+gitlab:** remove Ubuntu 16.04 & Fedora 32 (EOL) [skip ci] (\ `75dde65 `_\ ) 156 | * **kitchen+gitlab-ci:** use latest pre-salted images [skip ci] (\ `8f864c1 `_\ ) 157 | * **pre-commit:** update hook for ``rubocop`` [skip ci] (\ `fdb19f4 `_\ ) 158 | 159 | Documentation 160 | ^^^^^^^^^^^^^ 161 | 162 | 163 | * **readme:** fix headings [skip ci] (\ `49e05b5 `_\ ) 164 | 165 | Features 166 | ^^^^^^^^ 167 | 168 | 169 | * **suse:** update installation from ``nodejs10`` => ``nodejs14`` [skip ci] (\ `bf107ff `_\ ) 170 | 171 | Tests 172 | ^^^^^ 173 | 174 | 175 | * standardise use of ``share`` suite & ``_mapdata`` state [skip ci] (\ `42f8881 `_\ ) 176 | 177 | `1.0.1 `_ (2020-12-16) 178 | ------------------------------------------------------------------------------------------------------ 179 | 180 | Continuous Integration 181 | ^^^^^^^^^^^^^^^^^^^^^^ 182 | 183 | 184 | * **gitlab-ci:** use GitLab CI as Travis CI replacement (\ `88cc5e4 `_\ ) 185 | * **kitchen:** use ``saltimages`` Docker Hub where available [skip ci] (\ `4c4c93a `_\ ) 186 | * **pre-commit:** add to formula [skip ci] (\ `5c6ac84 `_\ ) 187 | * **pre-commit:** enable/disable ``rstcheck`` as relevant [skip ci] (\ `65d4b7b `_\ ) 188 | * **pre-commit:** finalise ``rstcheck`` configuration [skip ci] (\ `f4009a0 `_\ ) 189 | 190 | Styles 191 | ^^^^^^ 192 | 193 | 194 | * **libtofs.jinja:** use Black-inspired Jinja formatting [skip ci] (\ `1f0a3d2 `_\ ) 195 | 196 | `1.0.0 `_ (2020-06-01) 197 | ------------------------------------------------------------------------------------------------------- 198 | 199 | Continuous Integration 200 | ^^^^^^^^^^^^^^^^^^^^^^ 201 | 202 | 203 | * **kitchen+travis:** add new platforms [skip ci] (\ `60239d4 `_\ ) 204 | * **kitchen+travis:** adjust matrix to add ``3000.3`` [skip ci] (\ `3527bc5 `_\ ) 205 | 206 | Features 207 | ^^^^^^^^ 208 | 209 | 210 | * **formula:** store macros.jinja in subdir (\ `277d617 `_\ ) 211 | 212 | BREAKING CHANGES 213 | ^^^^^^^^^^^^^^^^ 214 | 215 | 216 | * **formula:** Major refactor of formula to bring it in alignment with the 217 | ``template-formula``. As with all substantial changes, please ensure your 218 | existing configurations work in the ways you expect from this formula. 219 | 220 | `0.14.2 `_ (2020-05-02) 221 | --------------------------------------------------------------------------------------------------------- 222 | 223 | Bug Fixes 224 | ^^^^^^^^^ 225 | 226 | 227 | * **config/file:** use ``|tojson`` (was failing on Arch ``2019.2``\ ) (\ `032abda `_\ ) 228 | 229 | Continuous Integration 230 | ^^^^^^^^^^^^^^^^^^^^^^ 231 | 232 | 233 | * **kitchen+travis:** adjust matrix to add ``3000.2`` & remove ``2018.3`` (\ `21dc1c9 `_\ ) 234 | 235 | `0.14.1 `_ (2020-04-15) 236 | --------------------------------------------------------------------------------------------------------- 237 | 238 | Bug Fixes 239 | ^^^^^^^^^ 240 | 241 | 242 | * **osfamilymap:** use correct package for ``Suse`` (\ `d8a8264 `_\ ) 243 | 244 | Continuous Integration 245 | ^^^^^^^^^^^^^^^^^^^^^^ 246 | 247 | 248 | * **travis:** update matrix to test across all platforms (\ `f923134 `_\ ) 249 | 250 | `0.14.0 `_ (2020-04-13) 251 | --------------------------------------------------------------------------------------------------------- 252 | 253 | Bug Fixes 254 | ^^^^^^^^^ 255 | 256 | 257 | * **cleanup:** tidyup few loose ends (\ `febeb4c `_\ ) 258 | 259 | Features 260 | ^^^^^^^^ 261 | 262 | 263 | * **template:** align to template formula (\ `2570563 `_\ ) 264 | -------------------------------------------------------------------------------- /docs/README.rst: -------------------------------------------------------------------------------- 1 | node-formula 2 | ============ 3 | 4 | |img_travis| |img_sr| 5 | 6 | .. |img_travis| image:: https://travis-ci.com/saltstack-formulas/node-formula.svg?branch=master 7 | :alt: Travis CI Build Status 8 | :scale: 100% 9 | :target: https://travis-ci.com/saltstack-formulas/node-formula 10 | .. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg 11 | :alt: Semantic Release 12 | :scale: 100% 13 | :target: https://github.com/semantic-release/semantic-release 14 | 15 | Formula to install Node.js on GNU/Linux, MacOS, and BSD. 16 | 17 | The default method is package. See pillar.example file for other ideas. 18 | 19 | .. contents:: **Table of Contents** 20 | :depth: 1 21 | 22 | General notes 23 | ------------- 24 | 25 | See the full `SaltStack Formulas installation and usage instructions 26 | `_. 27 | 28 | If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section 29 | `_. 30 | 31 | If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``, 32 | which contains the currently released version. This formula is versioned according to `Semantic Versioning `_. 33 | 34 | See `Formula Versioning Section `_ for more details. 35 | 36 | If you need (non-default) configuration, please pay attention to the ``pillar.example`` file and/or `Special notes`_ section. 37 | 38 | Contributing to this repo 39 | ------------------------- 40 | 41 | **Commit message formatting is significant!!** 42 | 43 | Please see `How to contribute `_ for more details. 44 | 45 | Special notes 46 | ------------- 47 | 48 | None. 49 | 50 | 51 | Available states 52 | ---------------- 53 | 54 | .. contents:: 55 | :local: 56 | 57 | ``node`` 58 | ^^^^^^^^ 59 | 60 | *Meta-state (This is a state that includes other states)*. 61 | 62 | This installs Node package, 63 | manages Node configuration file and then 64 | starts the associated node service. 65 | 66 | ``node.package`` 67 | ^^^^^^^^^^^^^^^^ 68 | 69 | This state will install Node package only. 70 | 71 | ``node.archive`` 72 | ^^^^^^^^^^^^^^^^ 73 | 74 | This state will install Node from archive only. 75 | 76 | ``node.source`` 77 | ^^^^^^^^^^^^^^^ 78 | 79 | This state will install Node from source only. 80 | 81 | ``node.config`` 82 | ^^^^^^^^^^^^^^^ 83 | 84 | This state will configure npmrc and/or environment and has a dependency on ``node.install`` 85 | via include list. 86 | 87 | ``node.clean`` 88 | ^^^^^^^^^^^^^^ 89 | 90 | *Meta-state (This is a state that includes other states)*. 91 | 92 | this state will undo everything performed in the ``node`` meta-state in reverse order, i.e. 93 | removes the configuration file and 94 | then uninstalls the package. 95 | 96 | ``node.config.clean`` 97 | ^^^^^^^^^^^^^^^^^^^^^ 98 | 99 | This state will remove the configuration of Node and has a 100 | dependency on ``node.package.clean`` via include list. 101 | 102 | ``node.package.clean`` 103 | ^^^^^^^^^^^^^^^^^^^^^^ 104 | 105 | This state will remove Node package and has a dependency on 106 | ``node.config.clean`` via include list. 107 | 108 | ``node.source.clean`` 109 | ^^^^^^^^^^^^^^^^^^^^^ 110 | 111 | This state will remove Node package and has a dependency on 112 | ``node.config.clean`` via include list. 113 | 114 | ``node.archive.clean`` 115 | ^^^^^^^^^^^^^^^^^^^^^^ 116 | 117 | This state will remove Node package and has a dependency on 118 | ``node.config.clean`` via include list. 119 | 120 | Testing 121 | ------- 122 | 123 | Linux testing is done with ``kitchen-salt``. 124 | 125 | Requirements 126 | ^^^^^^^^^^^^ 127 | 128 | * Ruby 129 | * Docker 130 | 131 | .. code-block:: bash 132 | 133 | $ gem install bundler 134 | $ bundle install 135 | $ bin/kitchen test [platform] 136 | 137 | Where ``[platform]`` is the platform name defined in ``kitchen.yml``, 138 | e.g. ``debian-9-2019-2-py3``. 139 | 140 | ``bin/kitchen converge`` 141 | ^^^^^^^^^^^^^^^^^^^^^^^^ 142 | 143 | Creates the docker instance and runs the ``node`` main state, ready for testing. 144 | 145 | ``bin/kitchen verify`` 146 | ^^^^^^^^^^^^^^^^^^^^^^ 147 | 148 | Runs the ``inspec`` tests on the actual instance. 149 | 150 | ``bin/kitchen destroy`` 151 | ^^^^^^^^^^^^^^^^^^^^^^^ 152 | 153 | Removes the docker instance. 154 | 155 | ``bin/kitchen test`` 156 | ^^^^^^^^^^^^^^^^^^^^ 157 | 158 | Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``. 159 | 160 | ``bin/kitchen login`` 161 | ^^^^^^^^^^^^^^^^^^^^^ 162 | 163 | Gives you SSH access to the instance for manual testing. 164 | 165 | Testing with Vagrant 166 | -------------------- 167 | 168 | Windows/FreeBSD/OpenBSD testing is done with ``kitchen-salt``. 169 | 170 | Requirements 171 | ^^^^^^^^^^^^ 172 | 173 | * Ruby 174 | * Virtualbox 175 | * Vagrant 176 | 177 | Setup 178 | ^^^^^ 179 | 180 | .. code-block:: bash 181 | 182 | $ gem install bundler 183 | $ bundle install --with=vagrant 184 | $ bin/kitchen test [platform] 185 | 186 | Where ``[platform]`` is the platform name defined in ``kitchen.vagrant.yml``, 187 | e.g. ``windows-81-latest-py3``. 188 | 189 | Note 190 | ^^^^ 191 | 192 | When testing using Vagrant you must set the environment variable ``KITCHEN_LOCAL_YAML`` to ``kitchen.vagrant.yml``. For example: 193 | 194 | .. code-block:: bash 195 | 196 | $ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test # Alternatively, 197 | $ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml 198 | $ bin/kitchen test 199 | 200 | Then run the following commands as needed. 201 | 202 | ``bin/kitchen converge`` 203 | ^^^^^^^^^^^^^^^^^^^^^^^^ 204 | 205 | Creates the Vagrant instance and runs the ``vault`` main states, ready for testing. 206 | 207 | ``bin/kitchen verify`` 208 | ^^^^^^^^^^^^^^^^^^^^^^ 209 | 210 | Runs the ``inspec`` tests on the actual instance. 211 | 212 | ``bin/kitchen destroy`` 213 | ^^^^^^^^^^^^^^^^^^^^^^^ 214 | 215 | Removes the Vagrant instance. 216 | 217 | ``bin/kitchen test`` 218 | ^^^^^^^^^^^^^^^^^^^^ 219 | 220 | Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``. 221 | 222 | ``bin/kitchen login`` 223 | ^^^^^^^^^^^^^^^^^^^^^ 224 | 225 | Gives you RDP/SSH access to the instance for manual testing. 226 | -------------------------------------------------------------------------------- /docs/TOFS_pattern.rst: -------------------------------------------------------------------------------- 1 | .. _tofs_pattern: 2 | 3 | TOFS: A pattern for using SaltStack 4 | =================================== 5 | 6 | .. list-table:: 7 | :name: tofs-authors 8 | :header-rows: 1 9 | :stub-columns: 1 10 | :widths: 2,2,3,2 11 | 12 | * - 13 | - Person 14 | - Contact 15 | - Date 16 | * - Authored by 17 | - Roberto Moreda 18 | - moreda@allenta.com 19 | - 29/12/2014 20 | * - Modified by 21 | - Daniel Dehennin 22 | - daniel.dehennin@baby-gnu.org 23 | - 07/02/2019 24 | * - Modified by 25 | - Imran Iqbal 26 | - https://github.com/myii 27 | - 23/02/2019 28 | 29 | All that follows is a proposal based on my experience with `SaltStack `_. The good thing of a piece of software like this is that you can "bend it" to suit your needs in many possible ways, and this is one of them. All the recommendations and thoughts are given "as it is" with no warranty of any type. 30 | 31 | .. contents:: **Table of Contents** 32 | 33 | Usage of values in pillar vs templates in ``file_roots`` 34 | -------------------------------------------------------- 35 | 36 | Among other functions, the *master* (or *salt-master*) serves files to the *minions* (or *salt-minions*). The `file_roots `_ is the list of directories used in sequence to find a file when a minion requires it: the first match is served to the minion. Those files could be `state files `_ or configuration templates, among others. 37 | 38 | Using SaltStack is a simple and effective way to implement configuration management, but even in a `non-multitenant `_ scenario, it is not a good idea to generally access some data (e.g. the database password in our `Zabbix `_ server configuration file or the private key of our `Nginx `_ TLS certificate). 39 | 40 | To avoid this situation we can use the `pillar mechanism `_, which is designed to provide controlled access to data from the minions based on some selection rules. As pillar data could be easily integrated in the `Jinja `_ templates, it is a good mechanism to store values to be used in the final rendering of state files and templates. 41 | 42 | There are a variety of approaches on the usage of pillar and templates as seen in the `saltstack-formulas `_' repositories. `Some `_ `developments `_ stress the initial purpose of pillar data into a storage for most of the possible variables for a determined system configuration. This, in my opinion, is shifting too much load from the original template files approach. Adding up some `non-trivial Jinja `_ code as essential part of composing the state file definitely makes SaltStack state files (hence formulas) more difficult to read. The extreme of this approach is that we could end up with a new render mechanism, implemented in Jinja, storing everything needed in pillar data to compose configurations. Additionally, we are establishing a strong dependency with the Jinja renderer. 43 | 44 | In opposition to the *put the code in file_roots and the data in pillars* approach, there is the *pillar as a store for a set of key-values* approach. A full-blown configuration file abstracted in pillar and jinja is complicated to develop, understand and maintain. I think a better and simpler approach is to keep a configuration file templated using just a basic (non-extensive but extensible) set of pillar values. 45 | 46 | On the reusability of SaltStack state files 47 | ------------------------------------------- 48 | 49 | There is a brilliant initiative of the SaltStack community called `salt-formulas `_. Their goal is to provide state files, pillar examples and configuration templates ready to be used for provisioning. I am a contributor for two small ones: `zabbix-formula `_ and `varnish-formula `_. 50 | 51 | The `design guidelines `_ for formulas are clear in many aspects and it is a recommended reading for anyone willing to write state files, even non-formulaic ones. 52 | 53 | In the next section, I am going to describe my proposal to extend further the reusability of formulas, suggesting some patterns of usage. 54 | 55 | The Template Override and Files Switch (TOFS) pattern 56 | ----------------------------------------------------- 57 | 58 | I understand a formula as a **complete, independent set of SaltStack state and configuration template files sufficient to configure a system**. A system could be something as simple as an NTP server or some other much more complex service that requires many state and configuration template files. 59 | 60 | The customization of a formula should be done mainly by providing pillar data used later to render either the state or the configuration template files. 61 | 62 | Example: NTP before applying TOFS 63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 64 | 65 | Let's work with the NTP example. A basic formula that follows the `design guidelines `_ has the following files and directories tree: 66 | 67 | .. code-block:: console 68 | 69 | /srv/saltstack/salt-formulas/ntp-saltstack-formula/ 70 | ntp/ 71 | map.jinja 72 | init.sls 73 | conf.sls 74 | files/ 75 | default/ 76 | etc/ 77 | ntp.conf.jinja 78 | 79 | In order to use it, let's assume a `masterless configuration `_ and this relevant section of ``/etc/salt/minion``: 80 | 81 | .. code-block:: yaml 82 | 83 | pillar_roots: 84 | base: 85 | - /srv/saltstack/pillar 86 | file_client: local 87 | file_roots: 88 | base: 89 | - /srv/saltstack/salt 90 | - /srv/saltstack/salt-formulas/ntp-saltstack-formula 91 | 92 | .. code-block:: jinja 93 | 94 | {#- /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/map.jinja #} 95 | {%- set ntp = salt['grains.filter_by']({ 96 | 'default': { 97 | 'pkg': 'ntp', 98 | 'service': 'ntp', 99 | 'config': '/etc/ntp.conf', 100 | }, 101 | }, merge=salt['pillar.get']('ntp:lookup')) %} 102 | 103 | In ``init.sls`` we have the minimal states required to have NTP configured. In many cases ``init.sls`` is almost equivalent to an ``apt-get install`` or a ``yum install`` of the package. 104 | 105 | .. code-block:: sls 106 | 107 | ## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/init.sls 108 | {%- from 'ntp/map.jinja' import ntp with context %} 109 | 110 | Install NTP: 111 | pkg.installed: 112 | - name: {{ ntp.pkg }} 113 | 114 | Enable and start NTP: 115 | service.running: 116 | - name: {{ ntp.service }} 117 | - enabled: True 118 | - require: 119 | - pkg: Install NTP package 120 | 121 | In ``conf.sls`` we have the configuration states. In most cases, that is just managing configuration file templates and making them to be watched by the service. 122 | 123 | .. code-block:: sls 124 | 125 | ## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/conf.sls 126 | include: 127 | - ntp 128 | 129 | {%- from 'ntp/map.jinja' import ntp with context %} 130 | 131 | Configure NTP: 132 | file.managed: 133 | - name: {{ ntp.config }} 134 | - template: jinja 135 | - source: salt://ntp/files/default/etc/ntp.conf.jinja 136 | - watch_in: 137 | - service: Enable and start NTP service 138 | - require: 139 | - pkg: Install NTP package 140 | 141 | Under ``files/default``, there is a structure that mimics the one in the minion in order to avoid clashes and confusion on where to put the needed templates. There you can find a mostly standard template for the configuration file. 142 | 143 | .. code-block:: jinja 144 | 145 | {#- /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/files/default/etc/ntp.conf.jinja #} 146 | {#- Managed by saltstack #} 147 | {#- Edit pillars or override this template in saltstack if you need customization #} 148 | {%- set settings = salt['pillar.get']('ntp', {}) %} 149 | {%- set default_servers = ['0.ubuntu.pool.ntp.org', 150 | '1.ubuntu.pool.ntp.org', 151 | '2.ubuntu.pool.ntp.org', 152 | '3.ubuntu.pool.ntp.org'] %} 153 | 154 | driftfile /var/lib/ntp/ntp.drift 155 | statistics loopstats peerstats clockstats 156 | filegen loopstats file loopstats type day enable 157 | filegen peerstats file peerstats type day enable 158 | filegen clockstats file clockstats type day enable 159 | 160 | {%- for server in settings.get('servers', default_servers) %} 161 | server {{ server }} 162 | {%- endfor %} 163 | 164 | restrict -4 default kod notrap nomodify nopeer noquery 165 | restrict -6 default kod notrap nomodify nopeer noquery 166 | 167 | restrict 127.0.0.1 168 | restrict ::1 169 | 170 | With all this, it is easy to install and configure a simple NTP server by just running ``salt-call state.sls ntp.conf``: the package will be installed, the service will be running and the configuration should be correct for most of cases, even without pillar data. 171 | 172 | Alternatively, you can define a highstate in ``/srv/saltstack/salt/top.sls`` and run ``salt-call state.highstate``. 173 | 174 | .. code-block:: sls 175 | 176 | ## /srv/saltstack/salt/top.sls 177 | base: 178 | '*': 179 | - ntp.conf 180 | 181 | **Customizing the formula just with pillar data**, we have the option to define the NTP servers. 182 | 183 | .. code-block:: sls 184 | 185 | ## /srv/saltstack/pillar/top.sls 186 | base: 187 | '*': 188 | - ntp 189 | 190 | .. code-block:: sls 191 | 192 | ## /srv/saltstack/pillar/ntp.sls 193 | ntp: 194 | servers: 195 | - 0.ch.pool.ntp.org 196 | - 1.ch.pool.ntp.org 197 | - 2.ch.pool.ntp.org 198 | - 3.ch.pool.ntp.org 199 | 200 | Template Override 201 | ^^^^^^^^^^^^^^^^^ 202 | 203 | If the customization based on pillar data is not enough, we can override the template by creating a new one in ``/srv/saltstack/salt/ntp/files/default/etc/ntp.conf.jinja`` 204 | 205 | .. code-block:: jinja 206 | 207 | {#- /srv/saltstack/salt/ntp/files/default/etc/ntp.conf.jinja #} 208 | {#- Managed by saltstack #} 209 | {#- Edit pillars or override this template in saltstack if you need customization #} 210 | 211 | {#- Some bizarre configurations here #} 212 | {#- ... #} 213 | 214 | {%- for server in settings.get('servers', default_servers) %} 215 | server {{ server }} 216 | {%- endfor %} 217 | 218 | This way we are locally **overriding the template files** offered by the formula in order to make a more complex adaptation. Of course, this could be applied as well to any of the files, including the state files. 219 | 220 | Files Switch 221 | ^^^^^^^^^^^^ 222 | 223 | To bring some order into the set of template files included in a formula, as we commented, we suggest having a similar structure to a normal final file system under ``files/default``. 224 | 225 | We can make different templates coexist for different minions, classified by any `grain `_ value, by simply creating new directories under ``files``. This mechanism is based on **using values of some grains as a switch for the directories under** ``files/``. 226 | 227 | If we decide that we want ``os_family`` as switch, then we could provide the formula template variants for both the ``RedHat`` and ``Debian`` families. 228 | 229 | .. code-block:: console 230 | 231 | /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/files/ 232 | default/ 233 | etc/ 234 | ntp.conf.jinja 235 | RedHat/ 236 | etc/ 237 | ntp.conf.jinja 238 | Debian/ 239 | etc/ 240 | ntp.conf.jinja 241 | 242 | To make this work we need a ``conf.sls`` state file that takes a list of possible files as the configuration template. 243 | 244 | .. code-block:: sls 245 | 246 | ## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/conf.sls 247 | include: 248 | - ntp 249 | 250 | {%- from 'ntp/map.jinja' import ntp with context %} 251 | 252 | Configure NTP: 253 | file.managed: 254 | - name: {{ ntp.config }} 255 | - template: jinja 256 | - source: 257 | - salt://ntp/files/{{ grains.get('os_family', 'default') }}/etc/ntp.conf.jinja 258 | - salt://ntp/files/default/etc/ntp.conf.jinja 259 | - watch_in: 260 | - service: Enable and start NTP service 261 | - require: 262 | - pkg: Install NTP package 263 | 264 | If we want to cover the possibility of a special template for a minion identified by ``node01`` then we could have a specific template in ``/srv/saltstack/salt/ntp/files/node01/etc/ntp.conf.jinja``. 265 | 266 | .. code-block:: jinja 267 | 268 | {#- /srv/saltstack/salt/ntp/files/node01/etc/ntp.conf.jinja #} 269 | {#- Managed by saltstack #} 270 | {#- Edit pillars or override this template in saltstack if you need customization #} 271 | 272 | {#- Some crazy configurations here for node01 #} 273 | {#- ... #} 274 | 275 | To make this work we could write a specially crafted ``conf.sls``. 276 | 277 | .. code-block:: sls 278 | 279 | ## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/conf.sls 280 | include: 281 | - ntp 282 | 283 | {%- from 'ntp/map.jinja' import ntp with context %} 284 | 285 | Configure NTP: 286 | file.managed: 287 | - name: {{ ntp.config }} 288 | - template: jinja 289 | - source: 290 | - salt://ntp/files/{{ grains.get('id') }}/etc/ntp.conf.jinja 291 | - salt://ntp/files/{{ grains.get('os_family') }}/etc/ntp.conf.jinja 292 | - salt://ntp/files/default/etc/ntp.conf.jinja 293 | - watch_in: 294 | - service: Enable and start NTP service 295 | - require: 296 | - pkg: Install NTP package 297 | 298 | Using the ``files_switch`` macro 299 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 300 | 301 | We can simplify the ``conf.sls`` with the new ``files_switch`` macro to use in the ``source`` parameter for the ``file.managed`` state. 302 | 303 | .. code-block:: sls 304 | 305 | ## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/conf.sls 306 | include: 307 | - ntp 308 | 309 | {%- set tplroot = tpldir.split('/')[0] %} 310 | {%- from 'ntp/map.jinja' import ntp with context %} 311 | {%- from 'ntp/libtofs.jinja' import files_switch %} 312 | 313 | Configure NTP: 314 | file.managed: 315 | - name: {{ ntp.config }} 316 | - template: jinja 317 | - source: {{ files_switch(['/etc/ntp.conf.jinja'], 318 | lookup='Configure NTP' 319 | ) 320 | }} 321 | - watch_in: 322 | - service: Enable and start NTP service 323 | - require: 324 | - pkg: Install NTP package 325 | 326 | 327 | * This uses ``config.get``, searching for ``ntp:tofs:source_files:Configure NTP`` to determine the list of template files to use. 328 | * If this returns a result, the default of ``['/etc/ntp.conf.jinja']`` will be appended to it. 329 | * If this does not yield any results, the default of ``['/etc/ntp.conf.jinja']`` will be used. 330 | 331 | In ``libtofs.jinja``, we define this new macro ``files_switch``. 332 | 333 | .. literalinclude:: ../template/libtofs.jinja 334 | :caption: /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/libtofs.jinja 335 | :language: jinja 336 | 337 | How to customise the ``source`` further 338 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 339 | 340 | The examples below are based on an ``Ubuntu`` minion called ``theminion`` being configured via. pillar. 341 | 342 | Using the default settings of the ``files_switch`` macro above, 343 | the ``source`` will be: 344 | 345 | .. code-block:: sls 346 | 347 | - source: 348 | - salt://ntp/files/theminion/etc/ntp.conf.jinja 349 | - salt://ntp/files/Debian/etc/ntp.conf.jinja 350 | - salt://ntp/files/default/etc/ntp.conf.jinja 351 | 352 | Customise ``files`` 353 | ~~~~~~~~~~~~~~~~~~~ 354 | 355 | The ``files`` portion can be customised: 356 | 357 | .. code-block:: sls 358 | 359 | ntp: 360 | tofs: 361 | dirs: 362 | files: files_alt 363 | 364 | Resulting in: 365 | 366 | .. code-block:: sls 367 | 368 | - source: 369 | - salt://ntp/files_alt/theminion/etc/ntp.conf.jinja 370 | - salt://ntp/files_alt/Debian/etc/ntp.conf.jinja 371 | - salt://ntp/files_alt/default/etc/ntp.conf.jinja 372 | 373 | Customise the use of grains 374 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 375 | 376 | Grains can be customised and even arbitrary paths can be supplied: 377 | 378 | .. code-block:: sls 379 | 380 | ntp: 381 | tofs: 382 | files_switch: 383 | - any/path/can/be/used/here 384 | - id 385 | - os 386 | - os_family 387 | 388 | Resulting in: 389 | 390 | .. code-block:: sls 391 | 392 | - source: 393 | - salt://ntp/files/any/path/can/be/used/here/etc/ntp.conf.jinja 394 | - salt://ntp/files/theminion/etc/ntp.conf.jinja 395 | - salt://ntp/files/Ubuntu/etc/ntp.conf.jinja 396 | - salt://ntp/files/Debian/etc/ntp.conf.jinja 397 | - salt://ntp/files/default/etc/ntp.conf.jinja 398 | 399 | Customise the ``default`` path 400 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 401 | 402 | The ``default`` portion of the path can be customised: 403 | 404 | .. code-block:: sls 405 | 406 | ntp: 407 | tofs: 408 | dirs: 409 | default: default_alt 410 | 411 | Resulting in: 412 | 413 | .. code-block:: sls 414 | 415 | - source: 416 | ... 417 | - salt://ntp/files/default_alt/etc/ntp.conf.jinja 418 | 419 | Customise the list of ``source_files`` 420 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 421 | 422 | The list of ``source_files`` can be given: 423 | 424 | .. code-block:: sls 425 | 426 | ntp: 427 | tofs: 428 | source_files: 429 | Configure NTP: 430 | - '/etc/ntp.conf_alt.jinja' 431 | 432 | Resulting in: 433 | 434 | .. code-block:: sls 435 | 436 | - source: 437 | - salt://ntp/files/theminion/etc/ntp.conf_alt.jinja 438 | - salt://ntp/files/theminion/etc/ntp.conf.jinja 439 | - salt://ntp/files/Debian/etc/ntp.conf_alt.jinja 440 | - salt://ntp/files/Debian/etc/ntp.conf.jinja 441 | - salt://ntp/files/default/etc/ntp.conf_alt.jinja 442 | - salt://ntp/files/default/etc/ntp.conf.jinja 443 | 444 | Note: This does *not* override the default value. 445 | Rather, the value from the pillar/config is prepended to the default. 446 | 447 | Using sub-directories for ``components`` 448 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 449 | 450 | If your formula is composed of several components, you may prefer to provides files under sub-directories, like in the `systemd-formula `_. 451 | 452 | .. code-block:: console 453 | 454 | /srv/saltstack/systemd-formula/ 455 | systemd/ 456 | init.sls 457 | libtofs.jinja 458 | map.jinja 459 | networkd/ 460 | init.sls 461 | files/ 462 | default/ 463 | network/ 464 | 99-default.link 465 | resolved/ 466 | init.sls 467 | files/ 468 | default/ 469 | resolved.conf 470 | timesyncd/ 471 | init.sls 472 | files/ 473 | Arch/ 474 | resolved.conf 475 | Debian/ 476 | resolved.conf 477 | default/ 478 | resolved.conf 479 | Ubuntu/ 480 | resolved.conf 481 | 482 | For example, the following ``formula.component.config`` SLS: 483 | 484 | .. code-block:: sls 485 | 486 | {%- from "formula/libtofs.jinja" import files_switch with context %} 487 | 488 | formula configuration file: 489 | file.managed: 490 | - name: /etc/formula.conf 491 | - user: root 492 | - group: root 493 | - mode: 644 494 | - template: jinja 495 | - source: {{ files_switch(['formula.conf'], 496 | lookup='formula', 497 | use_subpath=True 498 | ) 499 | }} 500 | 501 | will be rendered on a ``Debian`` minion named ``salt-formula.ci.local`` as: 502 | 503 | .. code-block:: sls 504 | 505 | formula configuration file: 506 | file.managed: 507 | - name: /etc/formula.conf 508 | - user: root 509 | - group: root 510 | - mode: 644 511 | - template: jinja 512 | - source: 513 | - salt://formula/component/files/salt-formula.ci.local/formula.conf 514 | - salt://formula/component/files/Debian/formula.conf 515 | - salt://formula/component/files/default/formula.conf 516 | - salt://formula/files/salt-formula.ci.local/formula.conf 517 | - salt://formula/files/Debian/formula.conf 518 | - salt://formula/files/default/formula.conf 519 | -------------------------------------------------------------------------------- /kitchen.vagrant.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | driver: 5 | name: vagrant 6 | cache_directory: false 7 | customize: 8 | usbxhci: 'off' 9 | gui: false 10 | ssh: 11 | shell: /bin/sh 12 | linked_clone: true 13 | <% unless ENV['CI'] %> 14 | synced_folders: 15 | - - '.kitchen/kitchen-vagrant/%{instance_name}/vagrant' 16 | - '/vagrant' 17 | - 'create: true, disabled: false' 18 | <% end %> 19 | 20 | platforms: 21 | - name: freebsd-130-master-py3 22 | driver: 23 | box: myii/freebsd-13.0-master-py3 24 | - name: freebsd-123-master-py3 25 | driver: 26 | box: myii/freebsd-12.3-master-py3 27 | - name: freebsd-130-3004-0-py3 28 | driver: 29 | box: myii/freebsd-13.0-3004.0-py3 30 | - name: freebsd-123-3004-0-py3 31 | driver: 32 | box: myii/freebsd-12.3-3004.0-py3 33 | - name: openbsd-70-3003-3-py3 34 | driver: 35 | box: myii/openbsd-7.0-3003.3-py3 36 | ssh: 37 | shell: /bin/ksh 38 | synced_folders: [] 39 | - name: windows-10-latest-py3 40 | driver: 41 | box: techneg/win10x64-pro-salt 42 | cache_directory: "/omnibus/cache" 43 | customize: {} 44 | ssh: {} 45 | provisioner: 46 | # yamllint disable rule:line-length 47 | init_environment: | 48 | # Workaround to allow `kitchen converge` to be used multiple times 49 | # without having to `kitchen destroy` first: remove state files cached by 50 | # Salt during the previous `converge` (if present) 51 | rm -recurse ` 52 | C:\Users\vagrant\AppData\Local\Temp\kitchen\var\cache\salt\minion\files\base ` 53 | -ErrorAction SilentlyContinue 54 | salt-call --local state.single file.managed ` 55 | C:\Users\vagrant\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\node.js.sls ` 56 | source=https://github.com/saltstack/salt-winrepo-ng/raw/master/node.js.sls ` 57 | skip_verify=True makedirs=True 58 | exit 0 59 | # yamllint enable rule:line-length 60 | - name: windows-81-latest-py3 61 | driver: 62 | box: techneg/win81x64-pro-salt 63 | cache_directory: "/omnibus/cache" 64 | customize: {} 65 | ssh: {} 66 | provisioner: 67 | # yamllint disable rule:line-length 68 | init_environment: | 69 | # Workaround to allow `kitchen converge` to be used multiple times 70 | # without having to `kitchen destroy` first: remove state files cached by 71 | # Salt during the previous `converge` (if present) 72 | rm -recurse ` 73 | C:\Users\vagrant\AppData\Local\Temp\kitchen\var\cache\salt\minion\files\base ` 74 | -ErrorAction SilentlyContinue 75 | salt-call --local state.single file.managed ` 76 | C:\Users\vagrant\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\node.js.sls ` 77 | source=https://github.com/saltstack/salt-winrepo-ng/raw/master/node.js.sls ` 78 | skip_verify=True makedirs=True 79 | exit 0 80 | # yamllint enable rule:line-length 81 | -------------------------------------------------------------------------------- /kitchen.windows.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | driver: 5 | name: proxy 6 | host: localhost 7 | reset_command: "exit 0" 8 | port: 5985 9 | username: kitchen 10 | password: Pass@word1 11 | 12 | provisioner: 13 | salt_install: bootstrap 14 | salt_bootstrap_options: -pythonVersion 3 15 | # yamllint disable rule:line-length 16 | init_environment: | 17 | salt-call --local state.single file.managed ` 18 | C:\Users\kitchen\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\node.js.sls ` 19 | source=https://github.com/saltstack/salt-winrepo-ng/raw/master/node.js.sls ` 20 | skip_verify=True makedirs=True 21 | # yamllint enable rule:line-length 22 | 23 | platforms: 24 | - name: windows-2022-latest-py3 25 | - name: windows-2019-latest-py3 26 | -------------------------------------------------------------------------------- /kitchen.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # For help on this file's format, see https://kitchen.ci/ 5 | driver: 6 | name: docker 7 | use_sudo: false 8 | privileged: true 9 | run_command: /usr/lib/systemd/systemd 10 | 11 | provisioner: 12 | name: salt_solo 13 | log_level: debug 14 | salt_install: none 15 | require_chef: false 16 | formula: node 17 | salt_copy_filter: 18 | - .kitchen 19 | - .git 20 | 21 | platforms: 22 | ## SALT `tiamat` 23 | - name: debian-11-tiamat-py3 24 | driver: 25 | image: saltimages/salt-tiamat-py3:debian-11 26 | run_command: /lib/systemd/systemd 27 | - name: debian-10-tiamat-py3 28 | driver: 29 | image: saltimages/salt-tiamat-py3:debian-10 30 | run_command: /lib/systemd/systemd 31 | - name: debian-9-tiamat-py3 32 | driver: 33 | image: saltimages/salt-tiamat-py3:debian-9 34 | run_command: /lib/systemd/systemd 35 | - name: ubuntu-2204-tiamat-py3 36 | driver: 37 | image: saltimages/salt-tiamat-py3:ubuntu-22.04 38 | run_command: /lib/systemd/systemd 39 | - name: ubuntu-2004-tiamat-py3 40 | driver: 41 | image: saltimages/salt-tiamat-py3:ubuntu-20.04 42 | run_command: /lib/systemd/systemd 43 | - name: ubuntu-1804-tiamat-py3 44 | driver: 45 | image: saltimages/salt-tiamat-py3:ubuntu-18.04 46 | run_command: /lib/systemd/systemd 47 | - name: centos-stream8-tiamat-py3 48 | driver: 49 | image: saltimages/salt-tiamat-py3:centos-stream8 50 | - name: centos-7-tiamat-py3 51 | driver: 52 | image: saltimages/salt-tiamat-py3:centos-7 53 | - name: amazonlinux-2-tiamat-py3 54 | driver: 55 | image: saltimages/salt-tiamat-py3:amazonlinux-2 56 | - name: oraclelinux-8-tiamat-py3 57 | driver: 58 | image: saltimages/salt-tiamat-py3:oraclelinux-8 59 | - name: oraclelinux-7-tiamat-py3 60 | driver: 61 | image: saltimages/salt-tiamat-py3:oraclelinux-7 62 | - name: almalinux-8-tiamat-py3 63 | driver: 64 | image: saltimages/salt-tiamat-py3:almalinux-8 65 | - name: rockylinux-8-tiamat-py3 66 | driver: 67 | image: saltimages/salt-tiamat-py3:rockylinux-8 68 | 69 | ## SALT `master` 70 | - name: debian-11-master-py3 71 | driver: 72 | image: saltimages/salt-master-py3:debian-11 73 | run_command: /lib/systemd/systemd 74 | - name: debian-10-master-py3 75 | driver: 76 | image: saltimages/salt-master-py3:debian-10 77 | run_command: /lib/systemd/systemd 78 | - name: debian-9-master-py3 79 | driver: 80 | image: saltimages/salt-master-py3:debian-9 81 | run_command: /lib/systemd/systemd 82 | - name: ubuntu-2204-master-py3 83 | driver: 84 | image: saltimages/salt-master-py3:ubuntu-22.04 85 | run_command: /lib/systemd/systemd 86 | - name: ubuntu-2004-master-py3 87 | driver: 88 | image: saltimages/salt-master-py3:ubuntu-20.04 89 | run_command: /lib/systemd/systemd 90 | - name: ubuntu-1804-master-py3 91 | driver: 92 | image: saltimages/salt-master-py3:ubuntu-18.04 93 | run_command: /lib/systemd/systemd 94 | - name: centos-stream8-master-py3 95 | driver: 96 | image: saltimages/salt-master-py3:centos-stream8 97 | - name: centos-7-master-py3 98 | driver: 99 | image: saltimages/salt-master-py3:centos-7 100 | - name: fedora-36-master-py3 101 | driver: 102 | image: saltimages/salt-master-py3:fedora-36 103 | - name: fedora-35-master-py3 104 | driver: 105 | image: saltimages/salt-master-py3:fedora-35 106 | - name: opensuse-leap-153-master-py3 107 | driver: 108 | image: saltimages/salt-master-py3:opensuse-leap-15.3 109 | # Workaround to avoid intermittent failures on `opensuse-leap-15.3`: 110 | # => SCP did not finish successfully (255): (Net::SCP::Error) 111 | transport: 112 | max_ssh_sessions: 1 113 | - name: opensuse-tmbl-latest-master-py3 114 | driver: 115 | image: saltimages/salt-master-py3:opensuse-tumbleweed-latest 116 | # Workaround to avoid intermittent failures on `opensuse-tumbleweed`: 117 | # => SCP did not finish successfully (255): (Net::SCP::Error) 118 | transport: 119 | max_ssh_sessions: 1 120 | - name: amazonlinux-2-master-py3 121 | driver: 122 | image: saltimages/salt-master-py3:amazonlinux-2 123 | - name: oraclelinux-8-master-py3 124 | driver: 125 | image: saltimages/salt-master-py3:oraclelinux-8 126 | - name: oraclelinux-7-master-py3 127 | driver: 128 | image: saltimages/salt-master-py3:oraclelinux-7 129 | - name: arch-base-latest-master-py3 130 | driver: 131 | image: saltimages/salt-master-py3:arch-base-latest 132 | - name: gentoo-stage3-latest-master-py3 133 | driver: 134 | image: saltimages/salt-master-py3:gentoo-stage3-latest 135 | run_command: /sbin/init 136 | - name: gentoo-stage3-systemd-master-py3 137 | driver: 138 | image: saltimages/salt-master-py3:gentoo-stage3-systemd 139 | - name: almalinux-8-master-py3 140 | driver: 141 | image: saltimages/salt-master-py3:almalinux-8 142 | - name: rockylinux-8-master-py3 143 | driver: 144 | image: saltimages/salt-master-py3:rockylinux-8 145 | 146 | ## SALT `3004.1` 147 | - name: debian-11-3004-1-py3 148 | driver: 149 | image: saltimages/salt-3004.1-py3:debian-11 150 | run_command: /lib/systemd/systemd 151 | - name: debian-10-3004-1-py3 152 | driver: 153 | image: saltimages/salt-3004.1-py3:debian-10 154 | run_command: /lib/systemd/systemd 155 | - name: debian-9-3004-1-py3 156 | driver: 157 | image: saltimages/salt-3004.1-py3:debian-9 158 | run_command: /lib/systemd/systemd 159 | - name: ubuntu-2204-3004-1-py3 160 | driver: 161 | image: saltimages/salt-3004.1-py3:ubuntu-22.04 162 | run_command: /lib/systemd/systemd 163 | - name: ubuntu-2004-3004-1-py3 164 | driver: 165 | image: saltimages/salt-3004.1-py3:ubuntu-20.04 166 | run_command: /lib/systemd/systemd 167 | - name: ubuntu-1804-3004-1-py3 168 | driver: 169 | image: saltimages/salt-3004.1-py3:ubuntu-18.04 170 | run_command: /lib/systemd/systemd 171 | - name: centos-stream8-3004-1-py3 172 | driver: 173 | image: saltimages/salt-3004.1-py3:centos-stream8 174 | - name: centos-7-3004-1-py3 175 | driver: 176 | image: saltimages/salt-3004.1-py3:centos-7 177 | - name: fedora-36-3004-1-py3 178 | driver: 179 | image: saltimages/salt-3004.1-py3:fedora-36 180 | - name: fedora-35-3004-1-py3 181 | driver: 182 | image: saltimages/salt-3004.1-py3:fedora-35 183 | - name: amazonlinux-2-3004-1-py3 184 | driver: 185 | image: saltimages/salt-3004.1-py3:amazonlinux-2 186 | - name: oraclelinux-8-3004-1-py3 187 | driver: 188 | image: saltimages/salt-3004.1-py3:oraclelinux-8 189 | - name: oraclelinux-7-3004-1-py3 190 | driver: 191 | image: saltimages/salt-3004.1-py3:oraclelinux-7 192 | - name: arch-base-latest-3004-1-py3 193 | driver: 194 | image: saltimages/salt-3004.1-py3:arch-base-latest 195 | - name: gentoo-stage3-latest-3004-1-py3 196 | driver: 197 | image: saltimages/salt-3004.1-py3:gentoo-stage3-latest 198 | run_command: /sbin/init 199 | - name: gentoo-stage3-systemd-3004-1-py3 200 | driver: 201 | image: saltimages/salt-3004.1-py3:gentoo-stage3-systemd 202 | - name: almalinux-8-3004-1-py3 203 | driver: 204 | image: saltimages/salt-3004.1-py3:almalinux-8 205 | - name: rockylinux-8-3004-1-py3 206 | driver: 207 | image: saltimages/salt-3004.1-py3:rockylinux-8 208 | 209 | ## SALT `3004.0` 210 | - name: opensuse-leap-153-3004-0-py3 211 | driver: 212 | image: saltimages/salt-3004.0-py3:opensuse-leap-15.3 213 | # Workaround to avoid intermittent failures on `opensuse-leap-15.3`: 214 | # => SCP did not finish successfully (255): (Net::SCP::Error) 215 | transport: 216 | max_ssh_sessions: 1 217 | - name: opensuse-tmbl-latest-3004-0-py3 218 | driver: 219 | image: saltimages/salt-3004.0-py3:opensuse-tumbleweed-latest 220 | # Workaround to avoid intermittent failures on `opensuse-tumbleweed`: 221 | # => SCP did not finish successfully (255): (Net::SCP::Error) 222 | transport: 223 | max_ssh_sessions: 1 224 | 225 | ## SALT `3003.4` 226 | - name: debian-10-3003-4-py3 227 | driver: 228 | image: saltimages/salt-3003.4-py3:debian-10 229 | run_command: /lib/systemd/systemd 230 | - name: debian-9-3003-4-py3 231 | driver: 232 | image: saltimages/salt-3003.4-py3:debian-9 233 | run_command: /lib/systemd/systemd 234 | - name: ubuntu-2004-3003-4-py3 235 | driver: 236 | image: saltimages/salt-3003.4-py3:ubuntu-20.04 237 | run_command: /lib/systemd/systemd 238 | - name: ubuntu-1804-3003-4-py3 239 | driver: 240 | image: saltimages/salt-3003.4-py3:ubuntu-18.04 241 | run_command: /lib/systemd/systemd 242 | - name: centos-stream8-3003-4-py3 243 | driver: 244 | image: saltimages/salt-3003.4-py3:centos-stream8 245 | - name: centos-7-3003-4-py3 246 | driver: 247 | image: saltimages/salt-3003.4-py3:centos-7 248 | - name: amazonlinux-2-3003-4-py3 249 | driver: 250 | image: saltimages/salt-3003.4-py3:amazonlinux-2 251 | - name: oraclelinux-8-3003-4-py3 252 | driver: 253 | image: saltimages/salt-3003.4-py3:oraclelinux-8 254 | - name: oraclelinux-7-3003-4-py3 255 | driver: 256 | image: saltimages/salt-3003.4-py3:oraclelinux-7 257 | - name: almalinux-8-3003-4-py3 258 | driver: 259 | image: saltimages/salt-3003.4-py3:almalinux-8 260 | 261 | verifier: 262 | # https://www.inspec.io/ 263 | name: inspec 264 | sudo: true 265 | reporter: 266 | # cli, documentation, html, progress, json, json-min, json-rspec, junit 267 | - cli 268 | 269 | suites: 270 | - name: default 271 | provisioner: 272 | state_top: 273 | base: 274 | '*': 275 | - node._mapdata 276 | - node 277 | pillars: 278 | top.sls: 279 | base: 280 | '*': 281 | - node 282 | pillars_from_files: 283 | node.sls: test/salt/pillar/default.sls 284 | verifier: 285 | inspec_tests: 286 | - path: test/integration/default 287 | - name: archive 288 | provisioner: 289 | state_top: 290 | base: 291 | '*': 292 | - node._mapdata 293 | - node 294 | pillars: 295 | top.sls: 296 | base: 297 | '*': 298 | - node 299 | pillars_from_files: 300 | node.sls: test/salt/pillar/archive.sls 301 | verifier: 302 | inspec_tests: 303 | - path: test/integration/archive 304 | - name: source 305 | provisioner: 306 | state_top: 307 | base: 308 | '*': 309 | - node._mapdata 310 | - node 311 | pillars: 312 | top.sls: 313 | base: 314 | '*': 315 | - node 316 | pillars_from_files: 317 | node.sls: test/salt/pillar/source.sls 318 | verifier: 319 | inspec_tests: 320 | - path: test/integration/source 321 | - name: repo 322 | provisioner: 323 | state_top: 324 | base: 325 | '*': 326 | - node._mapdata 327 | - node 328 | pillars: 329 | top.sls: 330 | base: 331 | '*': 332 | - node 333 | pillars_from_files: 334 | node.sls: test/salt/pillar/repo.sls 335 | verifier: 336 | inspec_tests: 337 | - path: test/integration/default 338 | -------------------------------------------------------------------------------- /node/_mapdata/_mapdata.jinja: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:indentation rule:line-length 2 | # {{ grains.get("osfinger", grains.os) }} 3 | --- 4 | {#- use salt.slsutil.serialize to avoid encoding errors on some platforms #} 5 | {{ salt["slsutil.serialize"]( 6 | "yaml", 7 | map, 8 | default_flow_style=False, 9 | allow_unicode=True, 10 | ) 11 | | regex_replace("^\s+'$", "'", multiline=True) 12 | | trim 13 | }} 14 | -------------------------------------------------------------------------------- /node/_mapdata/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | --- 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split("/")[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | 8 | {%- set _mapdata = { 9 | "values": node, 10 | } %} 11 | {%- do salt["log.debug"]("### MAP.JINJA DUMP ###\n" ~ _mapdata | yaml(False)) %} 12 | 13 | {%- set output_dir = "/temp" if grains.os_family == "Windows" else "/tmp" %} 14 | {%- set output_file = output_dir ~ "/salt_mapdata_dump.yaml" %} 15 | 16 | {{ tplroot }}-mapdata-dump: 17 | file.managed: 18 | - name: {{ output_file }} 19 | - source: salt://{{ tplroot }}/_mapdata/_mapdata.jinja 20 | - template: jinja 21 | - context: 22 | map: {{ _mapdata | yaml }} 23 | -------------------------------------------------------------------------------- /node/archive/clean.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | 8 | node-package-archive-clean-file-absent: 9 | file.absent: 10 | - names: 11 | - {{ node.pkg.archive.name }} 12 | {%- if node.linux.altpriority|int == 0 and node.kernel in ('linux', 'darwin') %} 13 | - {{ node.dir.archive }}/bin/node 14 | - {{ node.dir.archive }}/bin/npm 15 | - {{ node.dir.archive }}/bin/npx 16 | {%- endif %} 17 | -------------------------------------------------------------------------------- /node/archive/init.sls: -------------------------------------------------------------------------------- 1 | #.-*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .install 6 | -------------------------------------------------------------------------------- /node/archive/install.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node as node with context %} 7 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} 8 | 9 | node-package-archive-install: 10 | pkg.installed: 11 | - names: 12 | - tar 13 | - gzip 14 | - require_in: 15 | - file: node-package-archive-install 16 | file.directory: 17 | - name: {{ node.pkg.archive.name }} 18 | - user: {{ node.rootuser }} 19 | - group: {{ node.rootgroup }} 20 | - mode: 755 21 | - makedirs: True 22 | - clean: True 23 | - require_in: 24 | - archive: node-package-archive-install 25 | - recurse: 26 | - user 27 | - group 28 | - mode 29 | archive.extracted: 30 | {{- format_kwargs(node.pkg.archive) }} 31 | - retry: {{ node.retry_option }} 32 | - user: {{ node.rootuser }} 33 | - group: {{ node.rootgroup }} 34 | - recurse: 35 | - user 36 | - group 37 | - require: 38 | - file: node-package-archive-install 39 | 40 | {%- if node.linux.altpriority|int == 0 %} 41 | {%- for cmd in ('node', 'npx', 'npm',) %} 42 | 43 | node-archive-install-file-symlink-{{ cmd }}: 44 | file.symlink: 45 | - name: /usr/local/bin/{{ cmd }} 46 | - target: {{ node.pkg.archive.name }}/bin/{{ cmd }} 47 | - force: True 48 | - onlyif: {{ node.kernel not in ('windows',) }} 49 | - require: 50 | - archive: node-package-archive-install 51 | {%- endfor %} 52 | {%- endif %} 53 | -------------------------------------------------------------------------------- /node/clean.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {%- if grains.os_family not in ('FreeBSD', 'Windows',) %} 5 | 6 | include: 7 | - .config.clean 8 | - .package.clean 9 | - .source.clean 10 | - .archive.clean 11 | 12 | {%- else %} 13 | 14 | node-not-available-to-clean: 15 | test.show_notification: 16 | - text: | 17 | The node package is unavailable on {{ salt['grains.get']('osfinger', grains.os_family) }} 18 | 19 | {%- endif %} 20 | -------------------------------------------------------------------------------- /node/config.sls: -------------------------------------------------------------------------------- 1 | config/init.sls -------------------------------------------------------------------------------- /node/config/clean.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | 8 | {%- if 'config' in node and node.config %} 9 | 10 | {%- if node.pkg.use_upstream_source %} 11 | {%- set sls_package_clean = tplroot ~ '.source.clean' %} 12 | {%- elif node.pkg.use_upstream_archive %} 13 | {%- set sls_package_clean = tplroot ~ '.archive.clean' %} 14 | {%- else %} 15 | {%- set sls_package_clean = tplroot ~ '.package.clean' %} 16 | {%- endif %} 17 | include: 18 | - {{ sls_package_clean }} 19 | 20 | node-config-clean-file-absent: 21 | file.absent: 22 | - names: 23 | - {{ node.config_file }} 24 | - {{ node.environ_file }} 25 | - require: 26 | - sls: {{ sls_package_clean }} 27 | 28 | {%- endif %} 29 | -------------------------------------------------------------------------------- /node/config/environ.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} 8 | 9 | {%- if 'environ' in node and node.environ and grains.os_family != 'Windows' %} 10 | 11 | {%- if node.pkg.use_upstream_source %} 12 | {%- set sls_package_install = tplroot ~ '.source.install' %} 13 | {%- elif node.pkg.use_upstream_archive %} 14 | {%- set sls_package_install = tplroot ~ '.archive.install' %} 15 | {%- else %} 16 | {%- set sls_package_install = tplroot ~ '.package.install' %} 17 | {%- endif %} 18 | include: 19 | - {{ sls_package_install }} 20 | 21 | node-config-file-file-managed-environ_file: 22 | file.managed: 23 | - name: {{ node.environ_file }} 24 | - source: {{ files_switch(['environ.sh.jinja'], 25 | lookup='node-config-file-file-managed-environ_file' 26 | ) 27 | }} 28 | - mode: 640 29 | - user: {{ node.rootuser }} 30 | - group: {{ node.rootgroup }} 31 | - makedirs: True 32 | - template: jinja 33 | - context: 34 | environ: {{ node.environ|json }} 35 | - require: 36 | - sls: {{ sls_package_install }} 37 | 38 | {%- endif %} 39 | -------------------------------------------------------------------------------- /node/config/file.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {%- set tplroot = tpldir.split('/')[0] %} 5 | {%- from tplroot ~ "/map.jinja" import node with context %} 6 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} 7 | 8 | {%- if 'config' in node and node.config %} 9 | 10 | {%- if node.pkg.use_upstream_source %} 11 | {%- set sls_package_install = tplroot ~ '.source.install' %} 12 | {%- elif node.pkg.use_upstream_archive %} 13 | {%- set sls_package_install = tplroot ~ '.archive.install' %} 14 | {%- else %} 15 | {%- set sls_package_install = tplroot ~ '.package.install' %} 16 | {%- endif %} 17 | include: 18 | - {{ sls_package_install }} 19 | 20 | node-config-npmrc-file-managed-config_file: 21 | file.managed: 22 | - name: {{ node.config_file }} 23 | - source: {{ files_switch(['npmrc.default.jinja'], 24 | lookup='node-config-file-file-managed-config_file' 25 | ) 26 | }} 27 | {%- if grains.os_family != 'Windows' %} 28 | - mode: 640 29 | - user: {{ node.rootuser }} 30 | - group: {{ node.rootgroup }} 31 | {%- endif %} 32 | - makedirs: True 33 | - template: jinja 34 | - context: 35 | config: {{ node.config | tojson }} 36 | - require: 37 | - sls: {{ sls_package_install }} 38 | 39 | {%- endif %} 40 | -------------------------------------------------------------------------------- /node/config/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - node.config.file # full path for legacy symlinks 6 | - node.config.environ 7 | -------------------------------------------------------------------------------- /node/defaults.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | node: 5 | version: 16.13.0 6 | config_file: /etc/npmrc 7 | config: {} 8 | environ_file: /etc/default/node.sh 9 | environ: [] 10 | rootuser: root 11 | rootgroup: root 12 | kernel: '{{ grains.kernel|lower }}' 13 | arch: x64 14 | linux: 15 | altpriority: 0 16 | 17 | dir: 18 | archive: /usr/local 19 | source: /usr/local/src 20 | pkg: 21 | name: nodejs 22 | # version: 16.13.0 23 | use_upstream_repo: false 24 | use_upstream_archive: false 25 | use_upstream_source: false 26 | deps: 27 | - git 28 | - curl 29 | - make 30 | - tar 31 | - gzip 32 | - gcc 33 | repo: {} 34 | suffix: tar.gz 35 | archive: 36 | uri: https://nodejs.org/dist 37 | # node-v16.13.0.tar.gz 38 | source_hash: 9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f 39 | enforce_toplevel: false 40 | trim_output: true 41 | options: '--strip-components=1' 42 | source: 43 | uri: https://github.com/nodejs/node/archive 44 | # https://github.com/nodejs/node/archive/refs/tags/v16.13.0.tar.gz 45 | source_hash: f0327e99f730bf2506a1f13dbd452ec80b33667a7ce1c77a2dacd6babc8643c7 46 | trim_output: true 47 | enforce_toplevel: false 48 | options: '--strip-components=1' 49 | 50 | retry_option: 51 | # https://docs.saltstack.com/en/latest/ref/states/requisites.html#retrying-states 52 | attempts: 3 53 | until: true 54 | interval: 60 55 | splay: 10 56 | 57 | # legacy flags 58 | install_from_source: false # use_upstream_archive 59 | install_from_ppa: false # use_upstream_repo 60 | node_pkg: nodejs 61 | npm_pkg: npm 62 | make_jobs: 1 63 | -------------------------------------------------------------------------------- /node/files/default/environ.sh.jinja: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # File managed by Salt at <{{ source }}>. 3 | # Your changes may be overwritten. 4 | ######################################################################## 5 | 6 | {{ environ|yaml(False) }} 7 | -------------------------------------------------------------------------------- /node/files/default/npmrc.default.jinja: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # File managed by Salt at <{{ source }}>. 3 | # Your changes may be overwritten. 4 | ######################################################################## 5 | 6 | {% for key, value in config.items() %} 7 | {{ key }} = {{ value }} 8 | {% endfor %} 9 | -------------------------------------------------------------------------------- /node/files/macros.jinja: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=jinja 3 | # 4 | # Collection of common macros 5 | 6 | {%- macro format_kwargs(kwarg) -%} 7 | 8 | {%- filter indent(4) %} 9 | {%- for k, v in kwarg|dictsort() %} 10 | - {{ k }}: {{ v }} 11 | {%- endfor %} 12 | {%- endfilter %} 13 | 14 | {%- endmacro %} 15 | -------------------------------------------------------------------------------- /node/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | 8 | {%- if grains.os_family not in ('MacOS',) %} 9 | {%- set p = node.pkg %} 10 | 11 | include: 12 | - {{ '.source' if p.use_upstream_source else '.archive' if p.use_upstream_archive else '.package' }} 13 | - .config 14 | 15 | {%- else %} 16 | 17 | node-not-available-to-install: 18 | test.show_notification: 19 | - text: | 20 | The node package is unavailable on {{ salt['grains.get']('osfinger', grains.os_family) }} 21 | 22 | {%- endif %} 23 | -------------------------------------------------------------------------------- /node/libtofs.jinja: -------------------------------------------------------------------------------- 1 | {%- macro files_switch( 2 | source_files, 3 | lookup=None, 4 | default_files_switch=["id", "os_family"], 5 | indent_width=6, 6 | use_subpath=False 7 | ) %} 8 | {#- 9 | Returns a valid value for the "source" parameter of a "file.managed" 10 | state function. This makes easier the usage of the Template Override and 11 | Files Switch (TOFS) pattern. 12 | Params: 13 | * source_files: ordered list of files to look for 14 | * lookup: key under ":tofs:source_files" to prepend to the 15 | list of source files 16 | * default_files_switch: if there's no config (e.g. pillar) 17 | ":tofs:files_switch" this is the ordered list of grains to 18 | use as selector switch of the directories under 19 | "/files" 20 | * indent_width: indentation of the result value to conform to YAML 21 | * use_subpath: defaults to `False` but if set, lookup the source file 22 | recursively from the current state directory up to `tplroot` 23 | Example (based on a `tplroot` of `xxx`): 24 | If we have a state: 25 | Deploy configuration: 26 | file.managed: 27 | - name: /etc/yyy/zzz.conf 28 | - source: {{ files_switch( 29 | ["/etc/yyy/zzz.conf", "/etc/yyy/zzz.conf.jinja"], 30 | lookup="Deploy configuration", 31 | ) }} 32 | - template: jinja 33 | In a minion with id=theminion and os_family=RedHat, it's going to be 34 | rendered as: 35 | Deploy configuration: 36 | file.managed: 37 | - name: /etc/yyy/zzz.conf 38 | - source: 39 | - salt://xxx/files/theminion/etc/yyy/zzz.conf 40 | - salt://xxx/files/theminion/etc/yyy/zzz.conf.jinja 41 | - salt://xxx/files/RedHat/etc/yyy/zzz.conf 42 | - salt://xxx/files/RedHat/etc/yyy/zzz.conf.jinja 43 | - salt://xxx/files/default/etc/yyy/zzz.conf 44 | - salt://xxx/files/default/etc/yyy/zzz.conf.jinja 45 | - template: jinja 46 | #} 47 | {#- Get the `tplroot` from `tpldir` #} 48 | {%- set tplroot = tpldir.split("/")[0] %} 49 | {%- set path_prefix = salt["config.get"](tplroot ~ ":tofs:path_prefix", tplroot) %} 50 | {%- set files_dir = salt["config.get"](tplroot ~ ":tofs:dirs:files", "files") %} 51 | {%- set files_switch_list = salt["config.get"]( 52 | tplroot ~ ":tofs:files_switch", default_files_switch 53 | ) %} 54 | {#- Lookup source_files (v2), files (v1), or fallback to an empty list #} 55 | {%- set src_files = salt["config.get"]( 56 | tplroot ~ ":tofs:source_files:" ~ lookup, 57 | salt["config.get"](tplroot ~ ":tofs:files:" ~ lookup, []), 58 | ) %} 59 | {#- Append the default source_files #} 60 | {%- set src_files = src_files + source_files %} 61 | {#- Only add to [""] when supporting older TOFS implementations #} 62 | {%- set path_prefix_exts = [""] %} 63 | {%- if use_subpath and tplroot != tpldir %} 64 | {#- Walk directory tree to find {{ files_dir }} #} 65 | {%- set subpath_parts = tpldir.lstrip(tplroot).lstrip("/").split("/") %} 66 | {%- for path in subpath_parts %} 67 | {%- set subpath = subpath_parts[0 : loop.index] | join("/") %} 68 | {%- do path_prefix_exts.append("/" ~ subpath) %} 69 | {%- endfor %} 70 | {%- endif %} 71 | {%- for path_prefix_ext in path_prefix_exts | reverse %} 72 | {%- set path_prefix_inc_ext = path_prefix ~ path_prefix_ext %} 73 | {#- For older TOFS implementation, use `files_switch` from the config #} 74 | {#- Use the default, new method otherwise #} 75 | {%- set fsl = salt["config.get"]( 76 | tplroot ~ path_prefix_ext | replace("/", ":") ~ ":files_switch", 77 | files_switch_list, 78 | ) %} 79 | {#- Append an empty value to evaluate as `default` in the loop below #} 80 | {%- if "" not in fsl %} 81 | {%- set fsl = fsl + [""] %} 82 | {%- endif %} 83 | {%- for fs in fsl %} 84 | {%- for src_file in src_files %} 85 | {%- if fs %} 86 | {%- set fs_dirs = salt["config.get"](fs, fs) %} 87 | {%- else %} 88 | {%- set fs_dirs = salt["config.get"]( 89 | tplroot ~ ":tofs:dirs:default", "default" 90 | ) %} 91 | {%- endif %} 92 | {#- Force the `config.get` lookup result as a list where necessary #} 93 | {#- since we need to also handle grains that are lists #} 94 | {%- if fs_dirs is string %} 95 | {%- set fs_dirs = [fs_dirs] %} 96 | {%- endif %} 97 | {%- for fs_dir in fs_dirs %} 98 | {#- strip empty elements by using a select #} 99 | {%- set url = ( 100 | [ 101 | "- salt:/", 102 | path_prefix_inc_ext.strip("/"), 103 | files_dir.strip("/"), 104 | fs_dir.strip("/"), 105 | src_file.strip("/"), 106 | ] 107 | | select 108 | | join("/") 109 | ) %} 110 | {{ url | indent(indent_width, true) }} 111 | {%- endfor %} 112 | {%- endfor %} 113 | {%- endfor %} 114 | {%- endfor %} 115 | {%- endmacro %} 116 | -------------------------------------------------------------------------------- /node/map.jinja: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=jinja 3 | 4 | {%- set tplroot = tpldir.split('/')[0] %} 5 | {%- import_yaml tplroot ~ "/defaults.yaml" as default_settings with context %} 6 | {%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap with context %} 7 | {%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap with context %} 8 | {%- import_yaml tplroot ~ "/osmap.yaml" as osmap with context %} 9 | {%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap with context %} 10 | {%- import_yaml tplroot ~ "/oscodenamemap.yaml" as oscodenamemap with context %} 11 | 12 | {%- set _config = salt['config.get'](tplroot, default={}) %} 13 | {%- set defaults = salt['grains.filter_by']( 14 | default_settings, 15 | default=tplroot, 16 | merge=salt['grains.filter_by']( osarchmap, grain='osarch', 17 | merge=salt['grains.filter_by']( osfamilymap, grain='os_family', 18 | merge=salt['grains.filter_by']( osmap, grain='os', 19 | merge=salt['grains.filter_by']( osfingermap, grain='osfinger', 20 | merge=salt['grains.filter_by']( oscodenamemap, grain='oscodename', 21 | merge=salt['grains.filter_by']( _config, default='lookup' 22 | ) 23 | ) 24 | ) 25 | ) 26 | ) 27 | ) 28 | ) 29 | %} 30 | {%- set node = salt['grains.filter_by']( {'defaults': defaults}, default='defaults', merge=_config) %} 31 | 32 | {%- if node.pkg.use_upstream_source %} 33 | {%- do node.pkg.source.update({ 'name': node.dir.source ~ '/node-' ~ node.version, 34 | 'source': '%s/v%s.%s'|format(node.pkg.source.uri, node.version, node.pkg.suffix) }) %} 35 | {%- endif %} 36 | {%- if node.pkg.use_upstream_archive %} 37 | {%- set dirname = 'node-v%s-%s-%s'|format( node.version, node.kernel, node.arch ) %} 38 | {%- do node.pkg.archive.update({ 39 | 'name': node.dir.archive ~ '/' ~ dirname, 40 | 'source_hash': node.pkg.archive.uri ~ '/v' ~ node.version ~ '/SHASUMS256.txt', 41 | 'source': '%s/v%s/%s.%s'|format(node.pkg.archive.uri, node.version, dirname, node.pkg.suffix)}) %} 42 | {%- endif %} 43 | {%- if node.pkg.use_upstream_repo -%} 44 | {%- set repo_version = node.version.split('.')[0] | default('') %} 45 | {%- set full_repo_name = 'deb %s/node_%s.x %s'|format(node.pkg.repo.url, repo_version, node.pkg.repo.dist) -%} 46 | {%- do node.pkg.repo.update({ 47 | 'name': full_repo_name}) -%} 48 | {%- endif -%} 49 | -------------------------------------------------------------------------------- /node/osarchmap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | # 4 | # Setup variables using grains['osarch'] based logic. 5 | # You just need to add the key:values for an `osarch` that differ 6 | # from `defaults.yaml`. 7 | # Only add an `osarch` which is/will be supported by the formula. 8 | # 9 | # If you do not need to provide defaults via the `osarch` grain, 10 | # you will need to provide at least an empty dict in this file, e.g. 11 | # osarch: {} 12 | --- 13 | amd64: 14 | arch: x64 15 | 16 | x86_64: 17 | arch: x64 18 | 19 | 386: 20 | arch: x86 21 | 22 | arm64: 23 | arch: arm64 24 | 25 | armhf: 26 | arch: armv7l 27 | 28 | armv7l: 29 | arch: armv7l 30 | 31 | ppc64le: 32 | arch: ppc64le 33 | 34 | s390x: 35 | arch: s390x 36 | -------------------------------------------------------------------------------- /node/oscodenamemap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | openSUSE Tumbleweed: 5 | pkg: 6 | name: nodejs16 7 | -------------------------------------------------------------------------------- /node/osfamilymap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | # 4 | # Setup variables using grains['os_family'] based logic. 5 | # You just need to add the key:values for an `os_family` that differ 6 | # from `defaults.yaml`. 7 | # Only add an `os_family` which is/will be supported by the formula 8 | # 9 | # If you do not need to provide defaults via the `os_family` grain, 10 | # you will need to provide at least an empty dict in this file, e.g. 11 | # osfamilymap: {} 12 | --- 13 | {%- if grains.os == 'MacOS' %} 14 | {%- set macos_rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %} 15 | {%- set macos_rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %} 16 | {%- endif %} 17 | 18 | # Source hashes taken from https://nodejs.org/dist/v node.version /SHASUMS256.txt 19 | 20 | Debian: 21 | pkg: 22 | # Check latest version: https://deb.nodesource.com/node_16.x/pool/main/n/nodejs/ 23 | version: 16.16.0-deb-1nodesource1 24 | deps: 25 | - pkg-config 26 | - build-essential 27 | - make 28 | - checkinstall 29 | - g++ 30 | - libssl-dev 31 | - python3-distutils 32 | {%- if 'oscodename' in grains %} 33 | repo: 34 | humanname: NodeSource Node.js Repository 35 | url: https://deb.nodesource.com 36 | dist: {{ grains['oscodename'] }} 37 | comps: "main" 38 | file: /etc/apt/sources.list.d/nodesource.list 39 | key_url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key 40 | keyserver: keyserver.ubuntu.com 41 | {%- endif %} 42 | 43 | RedHat: 44 | pkg: 45 | deps: 46 | - openssl-devel 47 | - pkgconfig 48 | - gcc-c++ 49 | - make 50 | - automake 51 | - ruby-devel 52 | service: 53 | name: node 54 | enabled: false 55 | 56 | Suse: 57 | pkg: 58 | name: nodejs14 59 | 60 | Gentoo: 61 | pkg: 62 | use_upstream_archive: true 63 | 64 | Arch: {} 65 | 66 | Alpine: {} 67 | 68 | FreeBSD: 69 | rootgroup: wheel 70 | pkg: 71 | name: node 72 | source: 73 | # node-v16.13.0.tar.gz ???? 74 | source_hash: 9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f 75 | 76 | OpenBSD: 77 | rootgroup: wheel 78 | pkg: 79 | name: node 80 | source: 81 | # node-v16.13.0.tar.gz ???? 82 | source_hash: 9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f 83 | 84 | Solaris: {} 85 | 86 | Windows: 87 | config_file: C:\Program Files\nodejs\node_modules\npm\npmrc 88 | config: 89 | prefix: '${APPDATA}\\npm' 90 | pkg: 91 | name: node.js 92 | source: 93 | # win-x64/node.exe 94 | source_hash: 7fca04f83b0e2169e41b2e1845e8da0f07d66cf9c3a1b4150767bf3ffddccf62 95 | archive_suffix: exe 96 | 97 | MacOS: 98 | rootuser: {{ macos_rootuser | d('') }} 99 | rootgroup: {{ macos_rootgroup | d('') }} 100 | pkg: 101 | name: node # homebrew; macports: nodejs7 102 | source: 103 | # darwin amd64 tarball, node-v16.13.0-darwin-x64.tar.gz 104 | source_hash: 37e09a8cf2352f340d1204c6154058d81362fef4ec488b0197b2ce36b3f0367a 105 | -------------------------------------------------------------------------------- /node/osfingermap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | Debian-9: 5 | pkg: 6 | version: 16.16.0-1nodesource1 7 | Ubuntu-18.04: 8 | pkg: 9 | version: 16.16.0-1nodesource1 10 | Fedora-34: 11 | pkg: 12 | version: 1:14.16.0-4.fc34 13 | -------------------------------------------------------------------------------- /node/osmap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | # 4 | # Setup variables using grains['os'] based logic. 5 | # You just need to add the key:values for an `os` that differ 6 | # from `defaults.yaml` + `osarch.yaml` + `os_family.yaml`. 7 | # Only add an `os` which is/will be supported by the formula. 8 | # 9 | # If you do not need to provide defaults via the `os` grain, 10 | # you will need to provide at least an empty dict in this file, e.g. 11 | # osmap: {} 12 | --- 13 | Amazon: 14 | pkg: 15 | use_upstream_archive: true 16 | 17 | # os_family: Gentoo 18 | Funtoo: {} 19 | 20 | # os_family: Arch 21 | Manjaro: {} 22 | 23 | # os_family: Solaris 24 | SmartOS: {} 25 | -------------------------------------------------------------------------------- /node/package/clean.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | 8 | node-package-clean-pkg-removed: 9 | pkg.removed: 10 | - name: {{ node.pkg.name }} 11 | -------------------------------------------------------------------------------- /node/package/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - node.package.install # full path for legacy symlinks 6 | -------------------------------------------------------------------------------- /node/package/install.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | 8 | {%- if node.pkg.repo and node.pkg.use_upstream_repo %} 9 | 10 | include: 11 | - node.package.repo # full path for legacy symlink 12 | 13 | {%- endif %} 14 | 15 | node-package-install-pkg-installed: 16 | pkg.installed: 17 | - name: {{ node.pkg.name }} 18 | - reload_modules: true 19 | {%- if node.pkg.version is defined %} 20 | - version: {{ node.pkg.version }} 21 | {%- endif %} 22 | -------------------------------------------------------------------------------- /node/package/repo/clean.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | 8 | node-package-repo-pkgrepo-absent: 9 | pkgrepo.absent: 10 | - name: {{ node.pkg.repo.name }} 11 | - onlyif: {{ node.pkg.repo and node.pkg.use_upstream_repo }} 12 | -------------------------------------------------------------------------------- /node/package/repo/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - node.package.repo.install 6 | -------------------------------------------------------------------------------- /node/package/repo/install.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} 8 | 9 | node-package-repo-pkgrepo-managed: 10 | pkgrepo.managed: 11 | {{- format_kwargs(node.pkg.repo) }} 12 | - onlyif: {{ node.pkg.repo and node.pkg.use_upstream_repo }} 13 | 14 | -------------------------------------------------------------------------------- /node/pkg.sls: -------------------------------------------------------------------------------- 1 | package/init.sls -------------------------------------------------------------------------------- /node/source/clean.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | 8 | node-package-source-clean-file-absent: 9 | file.absent: 10 | - names: 11 | - {{ node.pkg.source.name }}* 12 | - {{ node.dir.source }}/node-{{ node.version }} 13 | pkg.removed: 14 | - names: 15 | - node-{{ node.version }} 16 | - node-{{ node.version }}-1 17 | -------------------------------------------------------------------------------- /node/source/init.sls: -------------------------------------------------------------------------------- 1 | #.-*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .install 6 | -------------------------------------------------------------------------------- /node/source/install.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- from tplroot ~ "/map.jinja" import node with context %} 7 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} 8 | 9 | node-package-source-install: 10 | {%- if node.pkg.deps %} 11 | pkg.installed: 12 | - names: {{ node.pkg.deps|json }} 13 | - require_in: 14 | - file: node-package-source-install 15 | {%- endif %} 16 | file.directory: 17 | - name: {{ node.pkg.source.name }} 18 | - user: {{ node.rootuser }} 19 | - group: {{ node.rootgroup }} 20 | - mode: 755 21 | - clean: True 22 | - makedirs: True 23 | - require_in: 24 | - source: node-package-source-install 25 | - recurse: 26 | - user 27 | - group 28 | - mode 29 | archive.extracted: 30 | {{- format_kwargs(node.pkg.source) }} 31 | - retry: {{ node.retry_option }} 32 | - user: {{ node.rootuser }} 33 | - group: {{ node.rootgroup }} 34 | - recurse: 35 | - user 36 | - group 37 | - require: 38 | - file: node-package-source-install 39 | cmd.run: 40 | - cwd: {{ node.dir.source }}/node-{{ node.version }} 41 | - names: 42 | - ./configure 43 | - make -j 4 44 | - require: 45 | - archive: node-package-source-install 46 | 47 | {% if grains.os_family in ('RedHat',) %} 48 | 49 | node-package-source-install-make: 50 | gem.installed: 51 | - name: fpm 52 | cmd.run: 53 | - cwd: {{ node.dir.source }}/node-{{ node.version }} 54 | - names: 55 | - make install DESTDIR=./tmp 56 | - fpm -s dir -t rpm -C ./tmp -n node -v {{ node.version }} --iteration 1 --description "Node v{{ node.version }} (fpm)" -f 57 | - onchanges: 58 | - cmd: node-package-source-install 59 | pkg.installed: 60 | - sources: 61 | - node: {{ node.dir.source }}/node-{{ node.version }}/node-{{ node.version }}-1.x86_64.rpm 62 | - onchanges: 63 | - cmd: node-package-source-install-make 64 | 65 | {% else %} 66 | 67 | node-package-source-install-checkinstall: 68 | cmd.run: 69 | - cwd: {{ node.dir.source }}/node-{{ node.version }} 70 | - name: checkinstall --install=yes --pkgname=node --pkgversion "{{ node.version }}" --default 71 | - onchanges: 72 | - cmd: node-package-source-install 73 | 74 | {% endif %} 75 | -------------------------------------------------------------------------------- /pillar.example: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | node: 5 | # This version is used in archive/source installations, and it's major number 6 | # is used in to build the upstream's repo URL when using package installations 7 | # (the default) and `use_upstream_repo: true` 8 | version: 16.13.0 9 | config: 10 | prefix: '/home/vagrant/.npm-packages' 11 | environ: 12 | a: b 13 | pkg: 14 | # This version is used only in `package` based installations, to pin to 15 | # specific package version, specially if the repo has more than one available 16 | # version: 16.13.0 17 | use_upstream_repo: false 18 | use_upstream_archive: false 19 | use_upstream_source: false 20 | archive: 21 | uri: https://nodejs.org/dist 22 | source_hash: 9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f 23 | source: 24 | uri: https://github.com/nodejs/node/archive 25 | source_hash: f0327e99f730bf2506a1f13dbd452ec80b33667a7ce1c77a2dacd6babc8643c7 26 | -------------------------------------------------------------------------------- /pre-commit_semantic-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ############################################################################### 4 | # (A) Update `FORMULA` with `${nextRelease.version}` 5 | ############################################################################### 6 | sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA 7 | 8 | 9 | ############################################################################### 10 | # (B) Use `m2r2` to convert automatically produced `.md` docs to `.rst` 11 | ############################################################################### 12 | 13 | # Install `m2r2` 14 | pip3 install m2r2 15 | 16 | # Copy and then convert the `.md` docs 17 | cp ./*.md docs/ 18 | cd docs/ || exit 19 | m2r2 --overwrite ./*.md 20 | 21 | # Change excess `H1` headings to `H2` in converted `CHANGELOG.rst` 22 | sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst 23 | sed -i -e '1,4s/-/=/g' CHANGELOG.rst 24 | 25 | # Use for debugging output, when required 26 | # cat AUTHORS.rst 27 | # cat CHANGELOG.rst 28 | 29 | # Return back to the main directory 30 | cd .. 31 | -------------------------------------------------------------------------------- /release-rules.js: -------------------------------------------------------------------------------- 1 | // No release is triggered for the types commented out below. 2 | // Commits using these types will be incorporated into the next release. 3 | // 4 | // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`. 5 | module.exports = [ 6 | {breaking: true, release: 'major'}, 7 | // {type: 'build', release: 'patch'}, 8 | // {type: 'chore', release: 'patch'}, 9 | // {type: 'ci', release: 'patch'}, 10 | {type: 'docs', release: 'patch'}, 11 | {type: 'feat', release: 'minor'}, 12 | {type: 'fix', release: 'patch'}, 13 | {type: 'perf', release: 'patch'}, 14 | {type: 'refactor', release: 'patch'}, 15 | {type: 'revert', release: 'patch'}, 16 | {type: 'style', release: 'patch'}, 17 | {type: 'test', release: 'patch'}, 18 | ]; 19 | -------------------------------------------------------------------------------- /release.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | branch: 'master', 3 | repositoryUrl: 'https://github.com/saltstack-formulas/node-formula', 4 | plugins: [ 5 | ['@semantic-release/commit-analyzer', { 6 | preset: 'angular', 7 | releaseRules: './release-rules.js', 8 | }], 9 | '@semantic-release/release-notes-generator', 10 | ['@semantic-release/changelog', { 11 | changelogFile: 'CHANGELOG.md', 12 | changelogTitle: '# Changelog', 13 | }], 14 | ['@semantic-release/exec', { 15 | prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}', 16 | }], 17 | ['@semantic-release/git', { 18 | assets: ['*.md', 'docs/*.rst', 'FORMULA'], 19 | }], 20 | '@semantic-release/github', 21 | ], 22 | generateNotes: { 23 | preset: 'angular', 24 | writerOpts: { 25 | // Required due to upstream bug preventing all types being displayed. 26 | // Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317 27 | // Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410 28 | transform: (commit, context) => { 29 | const issues = [] 30 | 31 | commit.notes.forEach(note => { 32 | note.title = `BREAKING CHANGES` 33 | }) 34 | 35 | // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`. 36 | if (commit.type === `feat`) { 37 | commit.type = `Features` 38 | } else if (commit.type === `fix`) { 39 | commit.type = `Bug Fixes` 40 | } else if (commit.type === `perf`) { 41 | commit.type = `Performance Improvements` 42 | } else if (commit.type === `revert`) { 43 | commit.type = `Reverts` 44 | } else if (commit.type === `docs`) { 45 | commit.type = `Documentation` 46 | } else if (commit.type === `style`) { 47 | commit.type = `Styles` 48 | } else if (commit.type === `refactor`) { 49 | commit.type = `Code Refactoring` 50 | } else if (commit.type === `test`) { 51 | commit.type = `Tests` 52 | } else if (commit.type === `build`) { 53 | commit.type = `Build System` 54 | // } else if (commit.type === `chore`) { 55 | // commit.type = `Maintenance` 56 | } else if (commit.type === `ci`) { 57 | commit.type = `Continuous Integration` 58 | } else { 59 | return 60 | } 61 | 62 | if (commit.scope === `*`) { 63 | commit.scope = `` 64 | } 65 | 66 | if (typeof commit.hash === `string`) { 67 | commit.shortHash = commit.hash.substring(0, 7) 68 | } 69 | 70 | if (typeof commit.subject === `string`) { 71 | let url = context.repository 72 | ? `${context.host}/${context.owner}/${context.repository}` 73 | : context.repoUrl 74 | if (url) { 75 | url = `${url}/issues/` 76 | // Issue URLs. 77 | commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => { 78 | issues.push(issue) 79 | return `[#${issue}](${url}${issue})` 80 | }) 81 | } 82 | if (context.host) { 83 | // User URLs. 84 | commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => { 85 | if (username.includes('/')) { 86 | return `@${username}` 87 | } 88 | 89 | return `[@${username}](${context.host}/${username})` 90 | }) 91 | } 92 | } 93 | 94 | // remove references that already appear in the subject 95 | commit.references = commit.references.filter(reference => { 96 | if (issues.indexOf(reference.issue) === -1) { 97 | return true 98 | } 99 | 100 | return false 101 | }) 102 | 103 | return commit 104 | }, 105 | }, 106 | }, 107 | }; 108 | -------------------------------------------------------------------------------- /test/integration/archive/README.md: -------------------------------------------------------------------------------- 1 | # InSpec Profile: `archive` 2 | 3 | This shows the implementation of the `archive` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). 4 | 5 | ## Verify a profile 6 | 7 | InSpec ships with built-in features to verify a profile structure. 8 | 9 | ```bash 10 | $ inspec check archive 11 | Summary 12 | ------- 13 | Location: archive 14 | Profile: profile 15 | Controls: 4 16 | Timestamp: 2019-06-24T23:09:01+00:00 17 | Valid: true 18 | 19 | Errors 20 | ------ 21 | 22 | Warnings 23 | -------- 24 | ``` 25 | 26 | ## Execute a profile 27 | 28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. 29 | 30 | ```bash 31 | $ inspec exec archive 32 | .. 33 | 34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load) 35 | 8 examples, 0 failures 36 | ``` 37 | 38 | ## Execute a specific control from a profile 39 | 40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`. 41 | 42 | ```bash 43 | $ inspec exec archive --controls package 44 | . 45 | 46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load) 47 | 1 examples, 0 failures 48 | ``` 49 | 50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). 51 | -------------------------------------------------------------------------------- /test/integration/archive/controls/binary_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | title 'node archives profile' 4 | 5 | control 'node archive' do 6 | impact 1.0 7 | title 'should be installed' 8 | 9 | describe file('/usr/local/bin/node') do 10 | it { should exist } 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/integration/archive/controls/config_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'node configuration' do 4 | title 'should match desired lines' 5 | 6 | describe file('/etc/npmrc') do 7 | it { should be_file } 8 | it { should be_owned_by 'root' } 9 | it { should be_grouped_into 'root' } 10 | its('mode') { should cmp '0640' } 11 | # its('content') { should include 'prefix = /home/vagrant/.npm-packages' } 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/integration/archive/controls/environ_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'node configuration environment' do 4 | title 'should match desired lines' 5 | 6 | describe file('/etc/default/node.sh') do 7 | it { should be_file } 8 | it { should be_owned_by 'root' } 9 | it { should be_grouped_into 'root' } 10 | its('mode') { should cmp '0640' } 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/integration/archive/inspec.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: archive 5 | title: node formula 6 | maintainer: SaltStack Formulas 7 | license: Apache-2.0 8 | summary: Verify that the node formula is setup and configured correctly 9 | depends: 10 | - name: share 11 | path: test/integration/share 12 | supports: 13 | - platform-name: debian 14 | - platform-name: ubuntu 15 | - platform-name: centos 16 | - platform-name: fedora 17 | - platform-name: opensuse 18 | - platform-name: suse 19 | - platform-name: freebsd 20 | - platform-name: openbsd 21 | - platform-name: amazon 22 | - platform-name: oracle 23 | - platform-name: arch 24 | - platform-name: gentoo 25 | - platform-name: almalinux 26 | - platform-name: rocky 27 | - platform-name: mac_os_x 28 | - platform: windows 29 | -------------------------------------------------------------------------------- /test/integration/default/README.md: -------------------------------------------------------------------------------- 1 | # InSpec Profile: `default` 2 | 3 | This shows the implementation of the `default` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). 4 | 5 | ## Verify a profile 6 | 7 | InSpec ships with built-in features to verify a profile structure. 8 | 9 | ```bash 10 | $ inspec check default 11 | Summary 12 | ------- 13 | Location: default 14 | Profile: profile 15 | Controls: 4 16 | Timestamp: 2019-06-24T23:09:01+00:00 17 | Valid: true 18 | 19 | Errors 20 | ------ 21 | 22 | Warnings 23 | -------- 24 | ``` 25 | 26 | ## Execute a profile 27 | 28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. 29 | 30 | ```bash 31 | $ inspec exec default 32 | .. 33 | 34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load) 35 | 8 examples, 0 failures 36 | ``` 37 | 38 | ## Execute a specific control from a profile 39 | 40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`. 41 | 42 | ```bash 43 | $ inspec exec default --controls package 44 | . 45 | 46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load) 47 | 1 examples, 0 failures 48 | ``` 49 | 50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). 51 | -------------------------------------------------------------------------------- /test/integration/default/controls/config_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Overide by Platform 4 | npmrc_file, config_prefix = 5 | case platform[:family] 6 | when 'windows' 7 | ['C:\\Program Files\\nodejs\\node_modules\\npm\\npmrc', '${APPDATA}\\npm'] 8 | else 9 | %w[/etc/npmrc /home/vagrant/.npm-packages] 10 | end 11 | 12 | root_group = 13 | case platform[:family] 14 | when 'bsd' 15 | 'wheel' 16 | else 17 | 'root' 18 | end 19 | 20 | control 'node configuration' do 21 | title 'should match desired lines' 22 | 23 | describe file(npmrc_file) do 24 | it { should be_file } 25 | unless %w[windows].include?(platform[:family]) 26 | it { should be_owned_by 'root' } 27 | it { should be_grouped_into root_group } 28 | its('mode') { should cmp '0640' } 29 | end 30 | its('content') { should include "prefix = #{config_prefix}" } 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /test/integration/default/controls/environ_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Overide by Platform 4 | root_group = 5 | case platform[:family] 6 | when 'bsd' 7 | 'wheel' 8 | else 9 | 'root' 10 | end 11 | 12 | control 'node configuration environment' do 13 | title 'should match desired lines' 14 | 15 | only_if('Environment file not managed on Windows') do 16 | !%w[windows].include?(system.platform[:name]) 17 | end 18 | 19 | describe file('/etc/default/node.sh') do 20 | it { should be_file } 21 | it { should be_owned_by 'root' } 22 | it { should be_grouped_into root_group } 23 | its('mode') { should cmp '0640' } 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /test/integration/default/controls/packages_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'nodejs package' do 4 | title 'should be installed' 5 | 6 | # Overide by platform 7 | package_name = 8 | case platform[:family] 9 | when 'suse' 10 | case system.platform[:finger] 11 | when 'opensuse-tumbleweed' 12 | 'nodejs16' 13 | else 14 | 'nodejs14' 15 | end 16 | when 'bsd' 17 | case platform[:name] 18 | when 'freebsd' 19 | 'node' 20 | else 21 | 'nodejs' 22 | end 23 | when 'windows' 24 | 'node.js' 25 | else 26 | 'nodejs' 27 | end 28 | 29 | describe package(package_name) do 30 | it { should be_installed } 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /test/integration/default/inspec.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: default 5 | title: node formula 6 | maintainer: SaltStack Formulas 7 | license: Apache-2.0 8 | summary: Verify that the node formula is setup and configured correctly 9 | depends: 10 | - name: share 11 | path: test/integration/share 12 | supports: 13 | - platform-name: debian 14 | - platform-name: ubuntu 15 | - platform-name: centos 16 | - platform-name: fedora 17 | - platform-name: opensuse 18 | - platform-name: suse 19 | - platform-name: freebsd 20 | - platform-name: openbsd 21 | - platform-name: amazon 22 | - platform-name: oracle 23 | - platform-name: arch 24 | - platform-name: gentoo 25 | - platform-name: almalinux 26 | - platform-name: rocky 27 | - platform-name: mac_os_x 28 | - platform: windows 29 | -------------------------------------------------------------------------------- /test/integration/share/README.md: -------------------------------------------------------------------------------- 1 | # InSpec Profile: `share` 2 | 3 | This shows the implementation of the `share` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). 4 | 5 | Its goal is to share the libraries between all profiles. 6 | 7 | ## Libraries 8 | 9 | ### `system` 10 | 11 | The `system` library provides easy access to system dependent information: 12 | 13 | - `system.platform`: based on `inspec.platform`, modify to values that are more consistent from a SaltStack perspective 14 | - `system.platform[:family]` provide a family name for Arch and Gentoo 15 | - `system.platform[:name]` append `linux` to both `amazon` and `oracle`; ensure Windows platforms are resolved as simply `windows` 16 | - `system.platform[:release]` tweak Arch, Amazon Linux, Gentoo, openSUSE and Windows: 17 | - `Arch` is always `base-latest` 18 | - `Amazon Linux` release `2018` is resolved as `1` 19 | - `Gentoo` release is trimmed to its major version number and then the init system is appended (i.e. `sysv` or `sysd`) 20 | - `openSUSE` is resolved as `tumbleweed` if the `platform[:release]` is in date format 21 | - `Windows` uses the widely-used release number (e.g. `8.1` or `2019-server`) in place of the actual system release version 22 | - `system.platform[:finger]` is the concatenation of the name and the major release number (except for Ubuntu, which gives `ubuntu-20.04` for example) 23 | -------------------------------------------------------------------------------- /test/integration/share/inspec.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: share 5 | title: InSpec shared resources 6 | maintainer: SaltStack Formulas 7 | license: Apache-2.0 8 | summary: shared resources 9 | supports: 10 | - platform-name: debian 11 | - platform-name: ubuntu 12 | - platform-name: centos 13 | - platform-name: fedora 14 | - platform-name: opensuse 15 | - platform-name: suse 16 | - platform-name: freebsd 17 | - platform-name: openbsd 18 | - platform-name: amazon 19 | - platform-name: oracle 20 | - platform-name: arch 21 | - platform-name: gentoo 22 | - platform-name: almalinux 23 | - platform-name: rocky 24 | - platform-name: mac_os_x 25 | - platform: windows 26 | -------------------------------------------------------------------------------- /test/integration/share/libraries/system.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # system.rb -- InSpec resources for system values 4 | # Author: Daniel Dehennin 5 | # Copyright (C) 2020 Daniel Dehennin 6 | 7 | # rubocop:disable Metrics/ClassLength 8 | class SystemResource < Inspec.resource(1) 9 | name 'system' 10 | 11 | attr_reader :platform 12 | 13 | def initialize 14 | super 15 | @platform = build_platform 16 | end 17 | 18 | private 19 | 20 | def build_platform 21 | { 22 | family: build_platform_family, 23 | name: build_platform_name, 24 | release: build_platform_release, 25 | finger: build_platform_finger, 26 | codename: build_platform_codename 27 | } 28 | end 29 | 30 | def build_platform_family 31 | case inspec.platform[:name] 32 | when 'arch', 'gentoo' 33 | inspec.platform[:name] 34 | else 35 | inspec.platform[:family] 36 | end 37 | end 38 | 39 | def build_platform_name 40 | case inspec.platform[:name] 41 | when 'amazon', 'oracle', 'rocky' 42 | "#{inspec.platform[:name]}linux" 43 | when /^windows_/ 44 | inspec.platform[:family] 45 | else 46 | inspec.platform[:name] 47 | end 48 | end 49 | 50 | # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity 51 | def build_platform_release 52 | case inspec.platform[:name] 53 | when 'amazon' 54 | # `2018` relase is named `1` in `kitchen.yml` 55 | inspec.platform[:release].gsub(/2018.*/, '1') 56 | when 'arch' 57 | 'base-latest' 58 | when 'gentoo' 59 | "#{inspec.platform[:release].split('.')[0]}-#{derive_gentoo_init_system}" 60 | when 'mac_os_x' 61 | inspec.command('sw_vers -productVersion').stdout.to_s 62 | when 'opensuse' 63 | # rubocop:disable Style/NumericLiterals,Layout/LineLength 64 | inspec.platform[:release].to_i > 20210101 ? 'tumbleweed' : inspec.platform[:release] 65 | # rubocop:enable Style/NumericLiterals,Layout/LineLength 66 | when 'windows_8.1_pro' 67 | '8.1' 68 | when 'windows_server_2022_datacenter' 69 | '2022-server' 70 | when 'windows_server_2019_datacenter' 71 | '2019-server' 72 | when 'windows_server_2016_datacenter' 73 | '2016-server' 74 | else 75 | inspec.platform[:release] 76 | end 77 | end 78 | # rubocop:enable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity 79 | 80 | def derive_gentoo_init_system 81 | inspec.command('systemctl').exist? ? 'sysd' : 'sysv' 82 | end 83 | 84 | def build_platform_finger 85 | "#{build_platform_name}-#{build_finger_release}" 86 | end 87 | 88 | def build_finger_release 89 | case inspec.platform[:name] 90 | when 'ubuntu' 91 | build_platform_release.split('.').slice(0, 2).join('.') 92 | else 93 | build_platform_release.split('.')[0] 94 | end 95 | end 96 | 97 | # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity 98 | def build_platform_codename 99 | case build_platform_finger 100 | when 'ubuntu-22.04' 101 | 'jammy' 102 | when 'ubuntu-20.04' 103 | 'focal' 104 | when 'ubuntu-18.04' 105 | 'bionic' 106 | when 'debian-11' 107 | 'bullseye' 108 | when 'debian-10' 109 | 'buster' 110 | when 'debian-9' 111 | 'stretch' 112 | when 'almalinux-8' 113 | "AlmaLinux #{build_platform_release} (Arctic Sphynx)" 114 | when 'amazonlinux-2' 115 | 'Amazon Linux 2' 116 | when 'arch-base-latest' 117 | 'Arch Linux' 118 | when 'centos-7' 119 | 'CentOS Linux 7 (Core)' 120 | when 'centos-8' 121 | 'CentOS Stream 8' 122 | when 'opensuse-tumbleweed' 123 | 'openSUSE Tumbleweed' 124 | when 'opensuse-15' 125 | "openSUSE Leap #{build_platform_release}" 126 | when 'oraclelinux-8', 'oraclelinux-7' 127 | "Oracle Linux Server #{build_platform_release}" 128 | when 'gentoo-2-sysd', 'gentoo-2-sysv' 129 | 'Gentoo/Linux' 130 | when 'rockylinux-8' 131 | "Rocky Linux #{build_platform_release} (Green Obsidian)" 132 | else 133 | '' 134 | end 135 | end 136 | # rubocop:enable Metrics/MethodLength,Metrics/CyclomaticComplexity 137 | end 138 | # rubocop:enable Metrics/ClassLength 139 | -------------------------------------------------------------------------------- /test/integration/source/README.md: -------------------------------------------------------------------------------- 1 | # InSpec Profile: `source` 2 | 3 | This shows the implementation of the `source` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). 4 | 5 | ## Verify a profile 6 | 7 | InSpec ships with built-in features to verify a profile structure. 8 | 9 | ```bash 10 | $ inspec check source 11 | Summary 12 | ------- 13 | Location: source 14 | Profile: profile 15 | Controls: 4 16 | Timestamp: 2019-06-24T23:09:01+00:00 17 | Valid: true 18 | 19 | Errors 20 | ------ 21 | 22 | Warnings 23 | -------- 24 | ``` 25 | 26 | ## Execute a profile 27 | 28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. 29 | 30 | ```bash 31 | $ inspec exec source 32 | .. 33 | 34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load) 35 | 8 examples, 0 failures 36 | ``` 37 | 38 | ## Execute a specific control from a profile 39 | 40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`. 41 | 42 | ```bash 43 | $ inspec exec source --controls package 44 | . 45 | 46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load) 47 | 1 examples, 0 failures 48 | ``` 49 | 50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). 51 | -------------------------------------------------------------------------------- /test/integration/source/controls/config_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'node configuration' do 4 | title 'should match desired lines' 5 | 6 | describe file('/etc/npmrc') do 7 | it { should be_file } 8 | it { should be_owned_by 'root' } 9 | it { should be_grouped_into 'root' } 10 | its('mode') { should cmp '0640' } 11 | its('content') { should include 'prefix = /home/vagrant/.npm-packages' } 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/integration/source/controls/environ_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'node configuration environment' do 4 | title 'should match desired lines' 5 | 6 | describe file('/etc/default/node.sh') do 7 | it { should be_file } 8 | it { should be_owned_by 'root' } 9 | it { should be_grouped_into 'root' } 10 | its('mode') { should cmp '0640' } 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/integration/source/controls/source_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | title 'node archives profile' 4 | 5 | control 'node source archive' do 6 | impact 1.0 7 | title 'should be installed' 8 | 9 | describe file('/opt/local/bin/node') do 10 | it { should be_owned_by 'root' } 11 | it { should be_grouped_into 'root' } 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/integration/source/inspec.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: source 5 | title: node formula 6 | maintainer: SaltStack Formulas 7 | license: Apache-2.0 8 | summary: Verify that the node formula is setup and configured correctly 9 | depends: 10 | - name: share 11 | path: test/integration/share 12 | supports: 13 | - platform-name: debian 14 | - platform-name: ubuntu 15 | - platform-name: centos 16 | - platform-name: fedora 17 | - platform-name: opensuse 18 | - platform-name: suse 19 | - platform-name: freebsd 20 | - platform-name: openbsd 21 | - platform-name: amazon 22 | - platform-name: oracle 23 | - platform-name: arch 24 | - platform-name: gentoo 25 | - platform-name: almalinux 26 | - platform-name: rocky 27 | - platform-name: mac_os_x 28 | - platform: windows 29 | -------------------------------------------------------------------------------- /test/salt/pillar/archive.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | node: 5 | version: 16.13.0 6 | pkg: 7 | use_upstream_archive: true # from NodeSource 8 | archive: 9 | uri: https://nodejs.org/dist 10 | source_hash: 9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f 11 | 12 | config: 13 | prefix: '/home/vagrant/.npm-packages' 14 | environ: 15 | a: b 16 | -------------------------------------------------------------------------------- /test/salt/pillar/default.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | node: 5 | version: 16.13.0 6 | config: 7 | # yamllint disable-line rule:line-length 8 | prefix: '{{ "${APPDATA}\\npm" if grains.os == "Windows" else "/home/vagrant/.npm-packages" }}' 9 | environ: 10 | a: b 11 | pkg: 12 | use_upstream_repo: false 13 | use_upstream_archive: false 14 | use_upstream_source: false 15 | archive: 16 | uri: https://nodejs.org/dist 17 | source_hash: 9c00e5b6024cfcbc9105f9c58cf160762e78659a345d100c5bd80a7fb38c684f 18 | source: 19 | uri: https://github.com/nodejs/node/archive 20 | source_hash: f0327e99f730bf2506a1f13dbd452ec80b33667a7ce1c77a2dacd6babc8643c7 21 | -------------------------------------------------------------------------------- /test/salt/pillar/repo.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | node: 5 | pkg: 6 | use_upstream_repo: true # Debian family only 7 | config: 8 | prefix: /home/vagrant/.npm-packages 9 | environ: 10 | a: b 11 | -------------------------------------------------------------------------------- /test/salt/pillar/source.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | node: 5 | version: 16.13.0 6 | pkg: 7 | use_upstream_source: true 8 | source: 9 | uri: https://github.com/nodejs/node/archive 10 | source_hash: f0327e99f730bf2506a1f13dbd452ec80b33667a7ce1c77a2dacd6babc8643c7 11 | 12 | config: 13 | prefix: '/home/vagrant/.npm-packages' 14 | environ: 15 | a: b 16 | --------------------------------------------------------------------------------