├── .github └── workflows │ └── commitlint.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 ├── keepalived ├── _mapdata │ ├── _mapdata.jinja │ └── init.sls ├── config │ ├── file.sls │ └── init.sls ├── defaults.yaml ├── files │ └── default │ │ └── keepalived.conf.tmpl.jinja ├── init.sls ├── libtofs.jinja ├── macro.jinja ├── map.jinja ├── osarchmap.yaml ├── osfamilymap.yaml ├── osfingermap.yaml ├── osmap.yaml ├── package │ ├── init.sls │ └── install.sls ├── scripts │ ├── init.sls │ └── manage.sls └── service │ ├── init.sls │ └── running.sls ├── kitchen.yml ├── pillar.example ├── pre-commit_semantic-release.sh ├── release-rules.js ├── release.config.js └── test └── integration ├── default ├── README.md ├── controls │ ├── config_spec.rb │ ├── package_spec.rb │ └── service_spec.rb └── inspec.yml └── share ├── README.md ├── inspec.yml └── libraries └── system.rb /.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 | -------------------------------------------------------------------------------- /.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/keepalived-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/keepalived-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 | - 'apk --no-cache add ipvsadm' 113 | - 'modprobe ip_vs || true' 114 | # TODO: This should work from the env vars above automatically 115 | - 'bundle config set path "${BUNDLE_CACHE_PATH}"' 116 | - 'bundle config set without "${BUNDLE_WITHOUT}"' 117 | - 'bundle install' 118 | script: 119 | # Alternative value to consider: `${CI_JOB_NAME}` 120 | - 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"' 121 | 122 | ############################################################################### 123 | # Define `test` template (`allow_failure: true`) 124 | ############################################################################### 125 | .test_instance_failure_permitted: 126 | <<: *test_instance 127 | allow_failure: true 128 | 129 | ############################################################################### 130 | # `test` stage: each instance below uses the `test` template above 131 | ############################################################################### 132 | ## Define the rest of the matrix based on Kitchen testing 133 | # Make sure the instances listed below match up with 134 | # the `platforms` defined in `kitchen.yml` 135 | # yamllint disable rule:line-length 136 | # default-debian-11-tiamat-py3: {extends: '.test_instance'} 137 | # default-debian-10-tiamat-py3: {extends: '.test_instance'} 138 | # default-debian-9-tiamat-py3: {extends: '.test_instance'} 139 | # default-ubuntu-2204-tiamat-py3: {extends: '.test_instance_failure_permitted'} 140 | # default-ubuntu-2004-tiamat-py3: {extends: '.test_instance'} 141 | # default-ubuntu-1804-tiamat-py3: {extends: '.test_instance'} 142 | # default-centos-stream8-tiamat-py3: {extends: '.test_instance_failure_permitted'} 143 | # default-centos-7-tiamat-py3: {extends: '.test_instance'} 144 | # default-amazonlinux-2-tiamat-py3: {extends: '.test_instance'} 145 | # default-oraclelinux-8-tiamat-py3: {extends: '.test_instance'} 146 | # default-oraclelinux-7-tiamat-py3: {extends: '.test_instance'} 147 | # default-almalinux-8-tiamat-py3: {extends: '.test_instance'} 148 | # default-rockylinux-8-tiamat-py3: {extends: '.test_instance'} 149 | default-debian-11-master-py3: {extends: '.test_instance'} 150 | default-debian-10-master-py3: {extends: '.test_instance'} 151 | default-debian-9-master-py3: {extends: '.test_instance'} 152 | default-ubuntu-2204-master-py3: {extends: '.test_instance_failure_permitted'} 153 | default-ubuntu-2004-master-py3: {extends: '.test_instance'} 154 | default-ubuntu-1804-master-py3: {extends: '.test_instance'} 155 | default-centos-stream8-master-py3: {extends: '.test_instance_failure_permitted'} 156 | default-centos-7-master-py3: {extends: '.test_instance'} 157 | default-fedora-36-master-py3: {extends: '.test_instance_failure_permitted'} 158 | default-fedora-35-master-py3: {extends: '.test_instance'} 159 | default-opensuse-leap-153-master-py3: {extends: '.test_instance'} 160 | # default-opensuse-tmbl-latest-master-py3: {extends: '.test_instance_failure_permitted'} 161 | default-amazonlinux-2-master-py3: {extends: '.test_instance'} 162 | default-oraclelinux-8-master-py3: {extends: '.test_instance'} 163 | default-oraclelinux-7-master-py3: {extends: '.test_instance'} 164 | # default-arch-base-latest-master-py3: {extends: '.test_instance'} 165 | default-gentoo-stage3-latest-master-py3: {extends: '.test_instance'} 166 | default-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'} 167 | default-almalinux-8-master-py3: {extends: '.test_instance'} 168 | default-rockylinux-8-master-py3: {extends: '.test_instance'} 169 | # default-debian-11-3004-1-py3: {extends: '.test_instance'} 170 | # default-debian-10-3004-1-py3: {extends: '.test_instance'} 171 | # default-debian-9-3004-1-py3: {extends: '.test_instance'} 172 | # default-ubuntu-2204-3004-1-py3: {extends: '.test_instance_failure_permitted'} 173 | # default-ubuntu-2004-3004-1-py3: {extends: '.test_instance'} 174 | # default-ubuntu-1804-3004-1-py3: {extends: '.test_instance'} 175 | # default-centos-stream8-3004-1-py3: {extends: '.test_instance_failure_permitted'} 176 | # default-centos-7-3004-1-py3: {extends: '.test_instance'} 177 | # default-fedora-36-3004-1-py3: {extends: '.test_instance_failure_permitted'} 178 | # default-fedora-35-3004-1-py3: {extends: '.test_instance'} 179 | # default-amazonlinux-2-3004-1-py3: {extends: '.test_instance'} 180 | # default-oraclelinux-8-3004-1-py3: {extends: '.test_instance'} 181 | # default-oraclelinux-7-3004-1-py3: {extends: '.test_instance'} 182 | # default-arch-base-latest-3004-1-py3: {extends: '.test_instance'} 183 | # default-gentoo-stage3-latest-3004-1-py3: {extends: '.test_instance'} 184 | # default-gentoo-stage3-systemd-3004-1-py3: {extends: '.test_instance'} 185 | # default-almalinux-8-3004-1-py3: {extends: '.test_instance'} 186 | # default-rockylinux-8-3004-1-py3: {extends: '.test_instance'} 187 | # default-opensuse-leap-153-3004-0-py3: {extends: '.test_instance'} 188 | # default-opensuse-tmbl-latest-3004-0-py3: {extends: '.test_instance_failure_permitted'} 189 | # default-debian-10-3003-4-py3: {extends: '.test_instance'} 190 | # default-debian-9-3003-4-py3: {extends: '.test_instance'} 191 | # default-ubuntu-2004-3003-4-py3: {extends: '.test_instance'} 192 | # default-ubuntu-1804-3003-4-py3: {extends: '.test_instance'} 193 | # default-centos-stream8-3003-4-py3: {extends: '.test_instance_failure_permitted'} 194 | # default-centos-7-3003-4-py3: {extends: '.test_instance'} 195 | # default-amazonlinux-2-3003-4-py3: {extends: '.test_instance'} 196 | # default-oraclelinux-8-3003-4-py3: {extends: '.test_instance'} 197 | # default-oraclelinux-7-3003-4-py3: {extends: '.test_instance'} 198 | # default-almalinux-8-3003-4-py3: {extends: '.test_instance'} 199 | # yamllint enable rule:line-length 200 | 201 | ############################################################################### 202 | # `release` stage: `semantic-release` 203 | ############################################################################### 204 | semantic-release: 205 | only: *only_branch_master_parent_repo 206 | stage: *stage_release 207 | image: *image_semanticrelease 208 | variables: 209 | MAINTAINER_TOKEN: '${GH_TOKEN}' 210 | script: 211 | # Update `AUTHORS.md` 212 | - '${HOME}/go/bin/maintainer contributor' 213 | # Run `semantic-release` 214 | - 'semantic-release' 215 | -------------------------------------------------------------------------------- /.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 | ## Addons config 28 | # yamllint disable rule:indentation 29 | addons: 30 | apt: 31 | packages: 32 | - ipvsadm 33 | # yamllint enable rule:indentation 34 | 35 | ## Script to run for the test stage 36 | script: 37 | - sudo modprobe ip_vs 38 | - bin/kitchen verify "${INSTANCE}" 39 | 40 | ## Stages and jobs matrix 41 | stages: 42 | - test 43 | # # As part of the switch away from Travis CI, ensure that the `release` stage 44 | # # is not run inadvertently 45 | # - name: 'release' 46 | # if: 'branch = master AND type != pull_request' 47 | jobs: 48 | include: 49 | ## Define the test stage that runs the linters (and testing matrix, if applicable) 50 | 51 | # Run all of the linters in a single job 52 | - language: 'node_js' 53 | node_js: 'lts/*' 54 | env: 'Lint' 55 | name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint' 56 | before_install: 'skip' 57 | script: 58 | # Install and run `salt-lint` 59 | - pip install --user salt-lint 60 | - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst' 61 | | xargs salt-lint 62 | # Install and run `yamllint` 63 | # Need at least `v1.17.0` for the `yaml-files` setting 64 | - pip install --user yamllint>=1.17.0 65 | - yamllint -s . 66 | # Install and run `rubocop` 67 | - gem install rubocop 68 | - rubocop -d 69 | # Run `shellcheck` (already pre-installed in Travis) 70 | - shellcheck --version 71 | - git ls-files -- '*.sh' '*.bash' '*.ksh' 72 | | xargs shellcheck 73 | # Install and run `commitlint` 74 | - npm i -D @commitlint/config-conventional 75 | @commitlint/travis-cli 76 | - commitlint-travis 77 | 78 | # Run `pre-commit` linters in a single job 79 | - language: 'python' 80 | env: 'Lint_pre-commit' 81 | name: 'Lint: pre-commit' 82 | before_install: 'skip' 83 | cache: 84 | directories: 85 | - $HOME/.cache/pre-commit 86 | script: 87 | # Install and run `pre-commit` 88 | - pip install pre-commit==2.7.1 89 | - pre-commit run --all-files --color always --verbose 90 | - pre-commit run --color always --hook-stage manual --verbose commitlint-travis 91 | 92 | ## Define the rest of the matrix based on Kitchen testing 93 | # Make sure the instances listed below match up with 94 | # the `platforms` defined in `kitchen.yml` 95 | # - env: INSTANCE=default-debian-11-tiamat-py3 96 | # - env: INSTANCE=default-debian-10-tiamat-py3 97 | # - env: INSTANCE=default-debian-9-tiamat-py3 98 | # - env: INSTANCE=default-ubuntu-2204-tiamat-py3 99 | # - env: INSTANCE=default-ubuntu-2004-tiamat-py3 100 | # - env: INSTANCE=default-ubuntu-1804-tiamat-py3 101 | # - env: INSTANCE=default-centos-stream8-tiamat-py3 102 | # - env: INSTANCE=default-centos-7-tiamat-py3 103 | # - env: INSTANCE=default-amazonlinux-2-tiamat-py3 104 | # - env: INSTANCE=default-oraclelinux-8-tiamat-py3 105 | # - env: INSTANCE=default-oraclelinux-7-tiamat-py3 106 | # - env: INSTANCE=default-almalinux-8-tiamat-py3 107 | # - env: INSTANCE=default-rockylinux-8-tiamat-py3 108 | - env: INSTANCE=default-debian-11-master-py3 109 | - env: INSTANCE=default-debian-10-master-py3 110 | - env: INSTANCE=default-debian-9-master-py3 111 | - env: INSTANCE=default-ubuntu-2204-master-py3 112 | - env: INSTANCE=default-ubuntu-2004-master-py3 113 | - env: INSTANCE=default-ubuntu-1804-master-py3 114 | - env: INSTANCE=default-centos-stream8-master-py3 115 | - env: INSTANCE=default-centos-7-master-py3 116 | - env: INSTANCE=default-fedora-36-master-py3 117 | - env: INSTANCE=default-fedora-35-master-py3 118 | - env: INSTANCE=default-opensuse-leap-153-master-py3 119 | # - env: INSTANCE=default-opensuse-tmbl-latest-master-py3 120 | - env: INSTANCE=default-amazonlinux-2-master-py3 121 | - env: INSTANCE=default-oraclelinux-8-master-py3 122 | - env: INSTANCE=default-oraclelinux-7-master-py3 123 | # - env: INSTANCE=default-arch-base-latest-master-py3 124 | - env: INSTANCE=default-gentoo-stage3-latest-master-py3 125 | - env: INSTANCE=default-gentoo-stage3-systemd-master-py3 126 | - env: INSTANCE=default-almalinux-8-master-py3 127 | - env: INSTANCE=default-rockylinux-8-master-py3 128 | # - env: INSTANCE=default-debian-11-3004-1-py3 129 | # - env: INSTANCE=default-debian-10-3004-1-py3 130 | # - env: INSTANCE=default-debian-9-3004-1-py3 131 | # - env: INSTANCE=default-ubuntu-2204-3004-1-py3 132 | # - env: INSTANCE=default-ubuntu-2004-3004-1-py3 133 | # - env: INSTANCE=default-ubuntu-1804-3004-1-py3 134 | # - env: INSTANCE=default-centos-stream8-3004-1-py3 135 | # - env: INSTANCE=default-centos-7-3004-1-py3 136 | # - env: INSTANCE=default-fedora-36-3004-1-py3 137 | # - env: INSTANCE=default-fedora-35-3004-1-py3 138 | # - env: INSTANCE=default-amazonlinux-2-3004-1-py3 139 | # - env: INSTANCE=default-oraclelinux-8-3004-1-py3 140 | # - env: INSTANCE=default-oraclelinux-7-3004-1-py3 141 | # - env: INSTANCE=default-arch-base-latest-3004-1-py3 142 | # - env: INSTANCE=default-gentoo-stage3-latest-3004-1-py3 143 | # - env: INSTANCE=default-gentoo-stage3-systemd-3004-1-py3 144 | # - env: INSTANCE=default-almalinux-8-3004-1-py3 145 | # - env: INSTANCE=default-rockylinux-8-3004-1-py3 146 | # - env: INSTANCE=default-opensuse-leap-153-3004-0-py3 147 | # - env: INSTANCE=default-opensuse-tmbl-latest-3004-0-py3 148 | # - env: INSTANCE=default-debian-10-3003-4-py3 149 | # - env: INSTANCE=default-debian-9-3003-4-py3 150 | # - env: INSTANCE=default-ubuntu-2004-3003-4-py3 151 | # - env: INSTANCE=default-ubuntu-1804-3003-4-py3 152 | # - env: INSTANCE=default-centos-stream8-3003-4-py3 153 | # - env: INSTANCE=default-centos-7-3003-4-py3 154 | # - env: INSTANCE=default-amazonlinux-2-3003-4-py3 155 | # - env: INSTANCE=default-oraclelinux-8-3003-4-py3 156 | # - env: INSTANCE=default-oraclelinux-7-3003-4-py3 157 | # - env: INSTANCE=default-almalinux-8-3003-4-py3 158 | 159 | ## Define the release stage that runs `semantic-release` 160 | - stage: 'release' 161 | language: 'node_js' 162 | node_js: 'lts/*' 163 | env: 'Release' 164 | name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' 165 | before_install: 'skip' 166 | script: 167 | # Update `AUTHORS.md` 168 | - export MAINTAINER_TOKEN=${GH_TOKEN} 169 | - go get github.com/myii/maintainer 170 | - maintainer contributor 171 | 172 | # Install all dependencies required for `semantic-release` 173 | - npm i -D @semantic-release/changelog@3 174 | @semantic-release/exec@3 175 | @semantic-release/git@7 176 | deploy: 177 | provider: 'script' 178 | # Opt-in to `dpl v2` to complete the Travis build config validation (beta) 179 | # * https://docs.travis-ci.com/user/build-config-validation 180 | # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default 181 | edge: true 182 | # Run `semantic-release` 183 | script: 'npx semantic-release@15.14' 184 | 185 | # Notification options: `always`, `never` or `change` 186 | notifications: 187 | webhooks: 188 | if: 'repo = saltstack-formulas/keepalived-formula' 189 | urls: 190 | - https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=saltstack-formulas%2Fkeepalived-formula&ignore_pull_requests=true 191 | on_success: always # default: always 192 | on_failure: always # default: always 193 | on_start: always # default: never 194 | on_cancel: always # default: always 195 | on_error: always # default: always 196 | -------------------------------------------------------------------------------- /.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 | 24 | yaml-files: 25 | # Default settings 26 | - '*.yaml' 27 | - '*.yml' 28 | - .salt-lint 29 | - .yamllint 30 | # SaltStack Formulas additional settings 31 | - '*.example' 32 | - test/**/*.sls 33 | 34 | rules: 35 | empty-values: 36 | forbid-in-block-mappings: true 37 | forbid-in-flow-mappings: true 38 | line-length: 39 | # Increase from default of `80` 40 | # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) 41 | max: 88 42 | octal-values: 43 | forbid-implicit-octal: true 44 | forbid-explicit-octal: true 45 | -------------------------------------------------------------------------------- /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)|82 8 | @jebas|[@jebas](https://github.com/jebas)|22 9 | @gravyboat|[@gravyboat](https://github.com/gravyboat)|12 10 | @n-rodriguez|[@n-rodriguez](https://github.com/n-rodriguez)|7 11 | @aboe76|[@aboe76](https://github.com/aboe76)|7 12 | @hatifnatt|[@hatifnatt](https://github.com/hatifnatt)|4 13 | @dafyddj|[@dafyddj](https://github.com/dafyddj)|3 14 | @whiteinge|[@whiteinge](https://github.com/whiteinge)|3 15 | @ricardoklein|[@ricardoklein](https://github.com/ricardoklein)|2 16 | @asenci|[@asenci](https://github.com/asenci)|1 17 | @dglloyd|[@dglloyd](https://github.com/dglloyd)|1 18 | @baby-gnu|[@baby-gnu](https://github.com/baby-gnu)|1 19 | @danrodrig|[@danrodrig](https://github.com/danrodrig)|1 20 | @kpostrup|[@kpostrup](https://github.com/kpostrup)|1 21 | @mpawlack|[@mpawlack](https://github.com/mpawlack)|1 22 | @tampakrap|[@tampakrap](https://github.com/tampakrap)|1 23 | @bigbosst|[@bigbosst](https://github.com/bigbosst)|1 24 | 25 | --- 26 | 27 | Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2021-06-04. 28 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [0.6.1](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.6.0...v0.6.1) (2021-06-04) 4 | 5 | 6 | ### Bug Fixes 7 | 8 | * **osfamilymap:** add package for Gentoo ([f07212d](https://github.com/saltstack-formulas/keepalived-formula/commit/f07212dfbb3256170f2982145b6bed31af42527a)) 9 | * **service:** service restart handling with watch requisite ([1ae8918](https://github.com/saltstack-formulas/keepalived-formula/commit/1ae8918f1efee2764fbfe5fd0ba69993d81fce58)) 10 | 11 | 12 | ### Continuous Integration 13 | 14 | * add `arch-master` to matrix and update `.travis.yml` [skip ci] ([fbc97db](https://github.com/saltstack-formulas/keepalived-formula/commit/fbc97db9404b0b8d0397eb7e4e84d8465c30be22)) 15 | * **commitlint:** ensure `upstream/master` uses main repo URL [skip ci] ([7bc7b0d](https://github.com/saltstack-formulas/keepalived-formula/commit/7bc7b0d002ae3932f9f8fc4b394ee9e8ab383129)) 16 | * **gemfile+lock:** use `ssf` customised `kitchen-docker` repo [skip ci] ([5eb060c](https://github.com/saltstack-formulas/keepalived-formula/commit/5eb060cde7db66ec5f3ce8ab7f636f69e6cbdc30)) 17 | * **gitlab-ci:** add `rubocop` linter (with `allow_failure`) [skip ci] ([b4ec26c](https://github.com/saltstack-formulas/keepalived-formula/commit/b4ec26cffb829c2dcea071105c8e2f722ff37aa9)) 18 | * **kitchen+ci:** use latest pre-salted images (after CVE) [skip ci] ([d8bce5f](https://github.com/saltstack-formulas/keepalived-formula/commit/d8bce5ff94610fbcb4ee68e74eda49cbaf2cf534)) 19 | * **kitchen+gitlab:** adjust matrix to add `3003` [skip ci] ([7732d92](https://github.com/saltstack-formulas/keepalived-formula/commit/7732d9245776673ec7b193ebf92ef5b6a3e08b1c)) 20 | * **kitchen+gitlab-ci:** use latest pre-salted images [skip ci] ([bbb13d1](https://github.com/saltstack-formulas/keepalived-formula/commit/bbb13d1b18adf8991d67b84c418cece78db1eb0b)) 21 | * **pre-commit:** update hook for `rubocop` [skip ci] ([afb12f1](https://github.com/saltstack-formulas/keepalived-formula/commit/afb12f1fa82bf44ec723b34a5d8f22d2242af197)) 22 | 23 | 24 | ### Tests 25 | 26 | * standardise use of `share` suite & `_mapdata` state [skip ci] ([89986bf](https://github.com/saltstack-formulas/keepalived-formula/commit/89986bfe5ff40cebc69a1edc3e9ad1a4132543e6)) 27 | 28 | # [0.6.0](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.5.1...v0.6.0) (2020-12-16) 29 | 30 | 31 | ### Continuous Integration 32 | 33 | * **gemfile.lock:** add to repo with updated `Gemfile` [skip ci] ([eebb7e0](https://github.com/saltstack-formulas/keepalived-formula/commit/eebb7e0ea6b09bf2e9f4b53924842933f1c94fff)) 34 | * **gitlab-ci:** use GitLab CI as Travis CI replacement ([15e3cdb](https://github.com/saltstack-formulas/keepalived-formula/commit/15e3cdb6a2318f5e9bcb47c885162079013dcaf6)) 35 | * **kitchen:** use `saltimages` Docker Hub where available [skip ci] ([02347ad](https://github.com/saltstack-formulas/keepalived-formula/commit/02347adaac42522fb27bb50dc0211703abfcf7e5)) 36 | * **kitchen+travis:** remove `master-py2-arch-base-latest` [skip ci] ([161c6a6](https://github.com/saltstack-formulas/keepalived-formula/commit/161c6a615602ec14923e3bfaa05577de3a0adbac)) 37 | * **pre-commit:** add to formula [skip ci] ([6d36686](https://github.com/saltstack-formulas/keepalived-formula/commit/6d366861bf53960cb0a6adbee14a06232aaee67e)) 38 | * **pre-commit:** enable/disable `rstcheck` as relevant [skip ci] ([ec4fa7b](https://github.com/saltstack-formulas/keepalived-formula/commit/ec4fa7bc11a1bf050a127cb43b59334d70e04902)) 39 | * **pre-commit:** finalise `rstcheck` configuration [skip ci] ([635902d](https://github.com/saltstack-formulas/keepalived-formula/commit/635902dd4d2eb0e4e003a314520eca4ab9acd75e)) 40 | * **travis:** add notifications => zulip [skip ci] ([3ae2959](https://github.com/saltstack-formulas/keepalived-formula/commit/3ae2959f1305a6da1120f5c8e1cbcc7fd7422d70)) 41 | * **workflows/commitlint:** add to repo [skip ci] ([80bdb6c](https://github.com/saltstack-formulas/keepalived-formula/commit/80bdb6cac4f381441975df7765dab6c0cb690975)) 42 | 43 | 44 | ### Features 45 | 46 | * **config:** add support for switch type parameters ([20d67c1](https://github.com/saltstack-formulas/keepalived-formula/commit/20d67c13a17377ef59df9fcd0970354d90aec772)) 47 | * **scripts:** deploy helper scripts ([5fc37fa](https://github.com/saltstack-formulas/keepalived-formula/commit/5fc37fa6fb319ef8c718b1e8e4979bce77282021)) 48 | 49 | 50 | ### Styles 51 | 52 | * **libtofs.jinja:** use Black-inspired Jinja formatting [skip ci] ([16d6742](https://github.com/saltstack-formulas/keepalived-formula/commit/16d674294900317db54e8133a35a5871553d4afb)) 53 | 54 | ## [0.5.1](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.5.0...v0.5.1) (2020-04-07) 55 | 56 | 57 | ### Bug Fixes 58 | 59 | * **service:** restart service if config changes ([0490489](https://github.com/saltstack-formulas/keepalived-formula/commit/0490489614ef1374dadce88c734b8dadfe701f5f)), closes [#37](https://github.com/saltstack-formulas/keepalived-formula/issues/37) 60 | 61 | # [0.5.0](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.4.5...v0.5.0) (2020-04-06) 62 | 63 | 64 | ### Bug Fixes 65 | 66 | * **libtofs:** “files_switch” mess up the variable exported by “map.jinja” [skip ci] ([e01cd28](https://github.com/saltstack-formulas/keepalived-formula/commit/e01cd28115d1e0c282dd6d8f68cdf8c514abbe16)) 67 | 68 | 69 | ### Continuous Integration 70 | 71 | * **kitchen:** avoid using bootstrap for `master` instances [skip ci] ([05a0959](https://github.com/saltstack-formulas/keepalived-formula/commit/05a095954d5195d28af6c8b467ef28eb9e1b18d0)) 72 | 73 | 74 | ### Features 75 | 76 | * **vrrp_sync_group:** added option for vrrp_sync_group ([45e3261](https://github.com/saltstack-formulas/keepalived-formula/commit/45e3261e53b42e611d2d2ec92135bf554f6500f8)) 77 | 78 | ## [0.4.5](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.4.4...v0.4.5) (2020-01-27) 79 | 80 | 81 | ### Bug Fixes 82 | 83 | * **keepalived.conf.tmpl.jinja:** fix `has no attribute` error ([4391459](https://github.com/saltstack-formulas/keepalived-formula/commit/4391459df8cabb4818e54f54b92d5ca067671956)), closes [/freenode.logbot.info/saltstack-formulas/20200122#c3126298-c3126299](https://github.com//freenode.logbot.info/saltstack-formulas/20200122/issues/c3126298-c3126299) 84 | * **release.config.js:** use full commit hash in commit link [skip ci] ([e9f7b11](https://github.com/saltstack-formulas/keepalived-formula/commit/e9f7b11db30e370d37059e599f35130e1137dd0a)) 85 | 86 | 87 | ### Continuous Integration 88 | 89 | * **gemfile:** restrict `train` gem version until upstream fix [skip ci] ([a1a51d5](https://github.com/saltstack-formulas/keepalived-formula/commit/a1a51d58421ed65f56703a5b011178fc5122e26f)) 90 | * **kitchen:** use `debian-10-master-py3` instead of `develop` [skip ci] ([0bb4271](https://github.com/saltstack-formulas/keepalived-formula/commit/0bb4271c89b2a64ae536e08047eb835c121dac90)) 91 | * **kitchen:** use `develop` image until `master` is ready (`amazonlinux`) [skip ci] ([2758e8e](https://github.com/saltstack-formulas/keepalived-formula/commit/2758e8ebf360be54682ee09b59a5f2767f721bbd)) 92 | * **kitchen+travis:** upgrade matrix after `2019.2.2` release [skip ci] ([e638158](https://github.com/saltstack-formulas/keepalived-formula/commit/e6381581fad1568e7f21f34776ca46a6cd137d36)) 93 | * **travis:** apply changes from build config validation [skip ci] ([4f492da](https://github.com/saltstack-formulas/keepalived-formula/commit/4f492dafff1da17a180e63181ab5c509e65cb189)) 94 | * **travis:** opt-in to `dpl v2` to complete build config validation [skip ci] ([cc7542a](https://github.com/saltstack-formulas/keepalived-formula/commit/cc7542a93f03dc8bedb5bb7ac54c2bf17d30cd02)) 95 | * **travis:** quote pathspecs used with `git ls-files` [skip ci] ([5e42eaa](https://github.com/saltstack-formulas/keepalived-formula/commit/5e42eaaa56f45a1b4c2f60fa9087f7006c865bcc)) 96 | * **travis:** run `shellcheck` during lint job [skip ci] ([47b3bce](https://github.com/saltstack-formulas/keepalived-formula/commit/47b3bce96b50f5059db0c7011497ca0a0406bcf8)) 97 | * **travis:** update `salt-lint` config for `v0.0.10` [skip ci] ([4d40216](https://github.com/saltstack-formulas/keepalived-formula/commit/4d4021675480cb44e6084a5b91ec5c9963ce831f)) 98 | * **travis:** use `major.minor` for `semantic-release` version [skip ci] ([3e9bc91](https://github.com/saltstack-formulas/keepalived-formula/commit/3e9bc91558ade2614f8de256092bfad8179feb4e)) 99 | * **travis:** use build config validation (beta) [skip ci] ([2d42d93](https://github.com/saltstack-formulas/keepalived-formula/commit/2d42d932463df75931a721ab9c7f3dbe6a584767)) 100 | 101 | 102 | ### Documentation 103 | 104 | * **contributing:** remove to use org-level file instead [skip ci] ([603176e](https://github.com/saltstack-formulas/keepalived-formula/commit/603176eec75d8602944904e2c389d483d8d34a52)) 105 | * **readme:** update link to `CONTRIBUTING` [skip ci] ([01df0d0](https://github.com/saltstack-formulas/keepalived-formula/commit/01df0d0097457cc28fbde9fd5a542848c37804f2)) 106 | 107 | 108 | ### Performance Improvements 109 | 110 | * **travis:** improve `salt-lint` invocation [skip ci] ([45a87c6](https://github.com/saltstack-formulas/keepalived-formula/commit/45a87c67fd28e8f78a887a0a7453dd7d7c9b43d7)) 111 | 112 | ## [0.4.4](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.4.3...v0.4.4) (2019-10-12) 113 | 114 | 115 | ### Bug Fixes 116 | 117 | * **rubocop:** add fixes using `rubocop --safe-auto-correct` ([](https://github.com/saltstack-formulas/keepalived-formula/commit/ce52e09)) 118 | 119 | 120 | ### Continuous Integration 121 | 122 | * **kitchen:** change `log_level` to `debug` instead of `info` ([](https://github.com/saltstack-formulas/keepalived-formula/commit/676b623)) 123 | * **kitchen:** install required packages to bootstrapped `opensuse` [skip ci] ([](https://github.com/saltstack-formulas/keepalived-formula/commit/eaaaf9e)) 124 | * **kitchen:** use bootstrapped `opensuse` images until `2019.2.2` [skip ci] ([](https://github.com/saltstack-formulas/keepalived-formula/commit/3419a72)) 125 | * **kitchen+travis:** replace EOL pre-salted images ([](https://github.com/saltstack-formulas/keepalived-formula/commit/2de0ca2)) 126 | * **platform:** add `arch-base-latest` ([](https://github.com/saltstack-formulas/keepalived-formula/commit/39f1205)) 127 | * merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([](https://github.com/saltstack-formulas/keepalived-formula/commit/ff62d0b)) 128 | * merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([](https://github.com/saltstack-formulas/keepalived-formula/commit/0645ea6)) 129 | * use `dist: bionic` & apply `opensuse-leap-15` SCP error workaround ([](https://github.com/saltstack-formulas/keepalived-formula/commit/2cb407f)) 130 | * **travis:** merge `rubocop` linter into main `lint` job ([](https://github.com/saltstack-formulas/keepalived-formula/commit/49892c0)) 131 | * **yamllint:** add rule `empty-values` & use new `yaml-files` setting ([](https://github.com/saltstack-formulas/keepalived-formula/commit/0b782d6)) 132 | 133 | ## [0.4.3](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.4.2...v0.4.3) (2019-08-27) 134 | 135 | 136 | ### Code Refactoring 137 | 138 | * **pillar:** sync map.jinja with template-formula ([96fe445](https://github.com/saltstack-formulas/keepalived-formula/commit/96fe445)) 139 | 140 | ## [0.4.2](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.4.1...v0.4.2) (2019-08-25) 141 | 142 | 143 | ### Documentation 144 | 145 | * **readme:** fix indentation ([52c1359](https://github.com/saltstack-formulas/keepalived-formula/commit/52c1359)) 146 | 147 | ## [0.4.1](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.4.0...v0.4.1) (2019-08-25) 148 | 149 | 150 | ### Documentation 151 | 152 | * **readme:** add testing section ([bbc0f7b](https://github.com/saltstack-formulas/keepalived-formula/commit/bbc0f7b)) 153 | 154 | # [0.4.0](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.3.0...v0.4.0) (2019-08-10) 155 | 156 | 157 | ### Continuous Integration 158 | 159 | * **kitchen+travis:** modify matrix to include `develop` platform ([a9cadb3](https://github.com/saltstack-formulas/keepalived-formula/commit/a9cadb3)) 160 | 161 | 162 | ### Features 163 | 164 | * **yamllint:** include for this repo and apply rules throughout ([9e29ffa](https://github.com/saltstack-formulas/keepalived-formula/commit/9e29ffa)) 165 | 166 | # [0.3.0](https://github.com/saltstack-formulas/keepalived-formula/compare/v0.2.0...v0.3.0) (2019-05-13) 167 | 168 | 169 | ### Features 170 | 171 | * **semantic-release:** implement an automated changelog ([51f872e](https://github.com/saltstack-formulas/keepalived-formula/commit/51f872e)) 172 | -------------------------------------------------------------------------------- /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: keepalived 2 | os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, MacOS 3 | os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, MacOS 4 | version: 0.6.1 5 | release: 0 6 | minimum_version: 2016.11 7 | summary: keepalived formula 8 | description: Formula to use to install and configure keepalived 9 | top_level_dir: keepalived 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 | -------------------------------------------------------------------------------- /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 | license-acceptance (2.1.13) 392 | pastel (~> 0.7) 393 | tomlrb (>= 1.2, < 3.0) 394 | tty-box (~> 0.6) 395 | tty-prompt (~> 0.20) 396 | little-plugger (1.1.4) 397 | logging (2.3.1) 398 | little-plugger (~> 1.1) 399 | multi_json (~> 1.14) 400 | memoist (0.16.2) 401 | method_source (1.0.0) 402 | mini_mime (1.1.2) 403 | minitest (5.16.2) 404 | mixlib-config (3.0.27) 405 | tomlrb 406 | mixlib-install (3.12.19) 407 | mixlib-shellout 408 | mixlib-versioning 409 | thor 410 | mixlib-log (3.0.9) 411 | mixlib-shellout (3.2.7) 412 | chef-utils 413 | mixlib-versioning (1.2.12) 414 | mongo (2.13.2) 415 | bson (>= 4.8.2, < 5.0.0) 416 | ms_rest (0.7.6) 417 | concurrent-ruby (~> 1.0) 418 | faraday (>= 0.9, < 2.0.0) 419 | timeliness (~> 0.3.10) 420 | ms_rest_azure (0.12.0) 421 | concurrent-ruby (~> 1.0) 422 | faraday (>= 0.9, < 2.0.0) 423 | faraday-cookie_jar (~> 0.0.6) 424 | ms_rest (~> 0.7.6) 425 | multi_json (1.15.0) 426 | multipart-post (2.2.3) 427 | net-scp (3.0.0) 428 | net-ssh (>= 2.6.5, < 7.0.0) 429 | net-ssh (6.1.0) 430 | net-ssh-gateway (2.0.0) 431 | net-ssh (>= 4.0.0) 432 | nori (2.6.0) 433 | options (2.3.2) 434 | os (1.1.4) 435 | parallel (1.22.1) 436 | parser (3.1.2.0) 437 | ast (~> 2.4.1) 438 | parslet (1.8.2) 439 | pastel (0.8.0) 440 | tty-color (~> 0.5) 441 | progress_bar (1.3.3) 442 | highline (>= 1.6, < 3) 443 | options (~> 2.3.0) 444 | pry (0.14.1) 445 | coderay (~> 1.1) 446 | method_source (~> 1.0) 447 | public_suffix (4.0.7) 448 | rainbow (3.1.1) 449 | rake (13.0.6) 450 | regexp_parser (2.5.0) 451 | representable (3.2.0) 452 | declarative (< 0.1.0) 453 | trailblazer-option (>= 0.1.1, < 0.2.0) 454 | uber (< 0.2.0) 455 | retriable (3.1.2) 456 | rexml (3.2.5) 457 | rspec (3.11.0) 458 | rspec-core (~> 3.11.0) 459 | rspec-expectations (~> 3.11.0) 460 | rspec-mocks (~> 3.11.0) 461 | rspec-core (3.11.0) 462 | rspec-support (~> 3.11.0) 463 | rspec-expectations (3.11.0) 464 | diff-lcs (>= 1.2.0, < 2.0) 465 | rspec-support (~> 3.11.0) 466 | rspec-its (1.3.0) 467 | rspec-core (>= 3.0.0) 468 | rspec-expectations (>= 3.0.0) 469 | rspec-mocks (3.11.1) 470 | diff-lcs (>= 1.2.0, < 2.0) 471 | rspec-support (~> 3.11.0) 472 | rspec-support (3.11.0) 473 | rubocop (1.25.1) 474 | parallel (~> 1.10) 475 | parser (>= 3.1.0.0) 476 | rainbow (>= 2.2.2, < 4.0) 477 | regexp_parser (>= 1.8, < 3.0) 478 | rexml 479 | rubocop-ast (>= 1.15.1, < 2.0) 480 | ruby-progressbar (~> 1.7) 481 | unicode-display_width (>= 1.4.0, < 3.0) 482 | rubocop-ast (1.19.1) 483 | parser (>= 3.1.1.0) 484 | ruby-progressbar (1.11.0) 485 | ruby2_keywords (0.0.5) 486 | rubyntlm (0.6.3) 487 | rubyzip (2.3.2) 488 | semverse (3.0.2) 489 | signet (0.17.0) 490 | addressable (~> 2.8) 491 | faraday (>= 0.17.5, < 3.a) 492 | jwt (>= 1.5, < 3.0) 493 | multi_json (~> 1.10) 494 | sslshake (1.3.1) 495 | strings (0.2.1) 496 | strings-ansi (~> 0.2) 497 | unicode-display_width (>= 1.5, < 3.0) 498 | unicode_utils (~> 1.4) 499 | strings-ansi (0.2.0) 500 | test-kitchen (3.3.1) 501 | bcrypt_pbkdf (~> 1.0) 502 | chef-utils (>= 16.4.35) 503 | ed25519 (~> 1.2) 504 | license-acceptance (>= 1.0.11, < 3.0) 505 | mixlib-install (~> 3.6) 506 | mixlib-shellout (>= 1.2, < 4.0) 507 | net-scp (>= 1.1, < 4.0) 508 | net-ssh (>= 2.9, < 7.0) 509 | net-ssh-gateway (>= 1.2, < 3.0) 510 | thor (>= 0.19, < 2.0) 511 | winrm (~> 2.0) 512 | winrm-elevated (~> 1.0) 513 | winrm-fs (~> 1.1) 514 | thor (1.2.1) 515 | timeliness (0.3.10) 516 | tomlrb (1.3.0) 517 | trailblazer-option (0.1.2) 518 | train (3.10.1) 519 | activesupport (>= 6.0.3.1) 520 | azure_graph_rbac (~> 0.16) 521 | azure_mgmt_key_vault (~> 0.17) 522 | azure_mgmt_resources (~> 0.15) 523 | azure_mgmt_security (~> 0.18) 524 | azure_mgmt_storage (~> 0.18) 525 | docker-api (>= 1.26, < 3.0) 526 | google-api-client (>= 0.23.9, <= 0.52.0) 527 | googleauth (>= 0.6.6, <= 0.14.0) 528 | inifile (~> 3.0) 529 | train-core (= 3.10.1) 530 | train-winrm (~> 0.2) 531 | train-aws (0.2.24) 532 | aws-sdk-alexaforbusiness (~> 1.0) 533 | aws-sdk-amplify (~> 1.32.0) 534 | aws-sdk-apigateway (~> 1.0) 535 | aws-sdk-apigatewayv2 (~> 1.0) 536 | aws-sdk-applicationautoscaling (>= 1.46, < 1.52) 537 | aws-sdk-athena (~> 1.0) 538 | aws-sdk-autoscaling (>= 1.22, < 1.64) 539 | aws-sdk-batch (>= 1.36, < 1.48) 540 | aws-sdk-budgets (~> 1.0) 541 | aws-sdk-cloudformation (~> 1.0) 542 | aws-sdk-cloudfront (~> 1.0) 543 | aws-sdk-cloudhsm (~> 1.0) 544 | aws-sdk-cloudhsmv2 (~> 1.0) 545 | aws-sdk-cloudtrail (~> 1.8) 546 | aws-sdk-cloudwatch (~> 1.13) 547 | aws-sdk-cloudwatchevents (>= 1.36, < 1.47) 548 | aws-sdk-cloudwatchlogs (~> 1.13) 549 | aws-sdk-codecommit (~> 1.0) 550 | aws-sdk-codedeploy (~> 1.0) 551 | aws-sdk-codepipeline (~> 1.0) 552 | aws-sdk-cognitoidentity (>= 1.26, < 1.32) 553 | aws-sdk-cognitoidentityprovider (>= 1.46, < 1.54) 554 | aws-sdk-configservice (~> 1.21) 555 | aws-sdk-core (~> 3.0) 556 | aws-sdk-costandusagereportservice (~> 1.6) 557 | aws-sdk-databasemigrationservice (>= 1.42, < 1.54) 558 | aws-sdk-dynamodb (~> 1.31) 559 | aws-sdk-ec2 (~> 1.70) 560 | aws-sdk-ecr (~> 1.18) 561 | aws-sdk-ecrpublic (~> 1.3) 562 | aws-sdk-ecs (~> 1.30) 563 | aws-sdk-efs (~> 1.0) 564 | aws-sdk-eks (~> 1.9) 565 | aws-sdk-elasticache (~> 1.0) 566 | aws-sdk-elasticbeanstalk (~> 1.0) 567 | aws-sdk-elasticloadbalancing (~> 1.8) 568 | aws-sdk-elasticloadbalancingv2 (~> 1.0) 569 | aws-sdk-elasticsearchservice (~> 1.0) 570 | aws-sdk-emr (~> 1.53.0) 571 | aws-sdk-eventbridge (~> 1.24.0) 572 | aws-sdk-firehose (~> 1.0) 573 | aws-sdk-glue (>= 1.71, < 1.89) 574 | aws-sdk-guardduty (~> 1.31) 575 | aws-sdk-iam (~> 1.13) 576 | aws-sdk-kafka (~> 1.0) 577 | aws-sdk-kinesis (~> 1.0) 578 | aws-sdk-kms (~> 1.13) 579 | aws-sdk-lambda (~> 1.0) 580 | aws-sdk-mq (~> 1.40.0) 581 | aws-sdk-networkfirewall (>= 1.6.0) 582 | aws-sdk-networkmanager (>= 1.13.0) 583 | aws-sdk-organizations (>= 1.17, < 1.60) 584 | aws-sdk-ram (>= 1.21, < 1.27) 585 | aws-sdk-rds (~> 1.43) 586 | aws-sdk-redshift (~> 1.0) 587 | aws-sdk-route53 (~> 1.0) 588 | aws-sdk-route53domains (~> 1.0) 589 | aws-sdk-route53resolver (~> 1.0) 590 | aws-sdk-s3 (~> 1.30) 591 | aws-sdk-s3control (~> 1.43.0) 592 | aws-sdk-secretsmanager (>= 1.42, < 1.47) 593 | aws-sdk-securityhub (~> 1.0) 594 | aws-sdk-servicecatalog (>= 1.48, < 1.61) 595 | aws-sdk-ses (~> 1.41.0) 596 | aws-sdk-shield (~> 1.30) 597 | aws-sdk-signer (~> 1.32.0) 598 | aws-sdk-simpledb (~> 1.29.0) 599 | aws-sdk-sms (~> 1.0) 600 | aws-sdk-sns (~> 1.9) 601 | aws-sdk-sqs (~> 1.10) 602 | aws-sdk-ssm (~> 1.0) 603 | aws-sdk-states (>= 1.35, < 1.40) 604 | aws-sdk-synthetics (~> 1.19.0) 605 | aws-sdk-transfer (>= 1.26, < 1.35) 606 | aws-sdk-waf (~> 1.43.0) 607 | train-core (3.10.1) 608 | addressable (~> 2.5) 609 | ffi (!= 1.13.0) 610 | json (>= 1.8, < 3.0) 611 | mixlib-shellout (>= 2.0, < 4.0) 612 | net-scp (>= 1.2, < 4.0) 613 | net-ssh (>= 2.9, < 7.0) 614 | train-habitat (0.2.22) 615 | train-winrm (0.2.13) 616 | winrm (>= 2.3.6, < 3.0) 617 | winrm-elevated (~> 1.2.2) 618 | winrm-fs (~> 1.0) 619 | tty-box (0.7.0) 620 | pastel (~> 0.8) 621 | strings (~> 0.2.0) 622 | tty-cursor (~> 0.7) 623 | tty-color (0.6.0) 624 | tty-cursor (0.7.1) 625 | tty-prompt (0.23.1) 626 | pastel (~> 0.8) 627 | tty-reader (~> 0.8) 628 | tty-reader (0.9.0) 629 | tty-cursor (~> 0.7) 630 | tty-screen (~> 0.8) 631 | wisper (~> 2.0) 632 | tty-screen (0.8.1) 633 | tty-table (0.12.0) 634 | pastel (~> 0.8) 635 | strings (~> 0.2.0) 636 | tty-screen (~> 0.8) 637 | tzinfo (2.0.4) 638 | concurrent-ruby (~> 1.0) 639 | uber (0.1.0) 640 | unf (0.1.4) 641 | unf_ext 642 | unf_ext (0.0.8.2) 643 | unicode-display_width (2.2.0) 644 | unicode_utils (1.4.0) 645 | winrm (2.3.6) 646 | builder (>= 2.1.2) 647 | erubi (~> 1.8) 648 | gssapi (~> 1.2) 649 | gyoku (~> 1.0) 650 | httpclient (~> 2.2, >= 2.2.0.2) 651 | logging (>= 1.6.1, < 3.0) 652 | nori (~> 2.0) 653 | rubyntlm (~> 0.6.0, >= 0.6.3) 654 | winrm-elevated (1.2.3) 655 | erubi (~> 1.8) 656 | winrm (~> 2.0) 657 | winrm-fs (~> 1.0) 658 | winrm-fs (1.3.5) 659 | erubi (~> 1.8) 660 | logging (>= 1.6.1, < 3.0) 661 | rubyzip (~> 2.0) 662 | winrm (~> 2.0) 663 | wisper (2.0.1) 664 | 665 | PLATFORMS 666 | ruby 667 | 668 | DEPENDENCIES 669 | inspec! 670 | kitchen-docker! 671 | kitchen-inspec (>= 2.5.0) 672 | kitchen-salt (>= 0.7.2) 673 | 674 | BUNDLED WITH 675 | 2.1.2 676 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /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 | - 82 19 | * - :raw-html-m2r:`@jebas` 20 | - `@jebas `_ 21 | - 22 22 | * - :raw-html-m2r:`@gravyboat` 23 | - `@gravyboat `_ 24 | - 12 25 | * - :raw-html-m2r:`@n-rodriguez` 26 | - `@n-rodriguez `_ 27 | - 7 28 | * - :raw-html-m2r:`@aboe76` 29 | - `@aboe76 `_ 30 | - 7 31 | * - :raw-html-m2r:`@hatifnatt` 32 | - `@hatifnatt `_ 33 | - 4 34 | * - :raw-html-m2r:`@dafyddj` 35 | - `@dafyddj `_ 36 | - 3 37 | * - :raw-html-m2r:`@whiteinge` 38 | - `@whiteinge `_ 39 | - 3 40 | * - :raw-html-m2r:`@ricardoklein` 41 | - `@ricardoklein `_ 42 | - 2 43 | * - :raw-html-m2r:`@asenci` 44 | - `@asenci `_ 45 | - 1 46 | * - :raw-html-m2r:`@dglloyd` 47 | - `@dglloyd `_ 48 | - 1 49 | * - :raw-html-m2r:`@baby-gnu` 50 | - `@baby-gnu `_ 51 | - 1 52 | * - :raw-html-m2r:`@danrodrig` 53 | - `@danrodrig `_ 54 | - 1 55 | * - :raw-html-m2r:`@kpostrup` 56 | - `@kpostrup `_ 57 | - 1 58 | * - :raw-html-m2r:`@mpawlack` 59 | - `@mpawlack `_ 60 | - 1 61 | * - :raw-html-m2r:`@tampakrap` 62 | - `@tampakrap `_ 63 | - 1 64 | * - :raw-html-m2r:`@bigbosst` 65 | - `@bigbosst `_ 66 | - 1 67 | 68 | 69 | ---- 70 | 71 | Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2021-06-04. 72 | -------------------------------------------------------------------------------- /docs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | 2 | Changelog 3 | ========= 4 | 5 | `0.6.1 `_ (2021-06-04) 6 | ------------------------------------------------------------------------------------------------------------ 7 | 8 | Bug Fixes 9 | ^^^^^^^^^ 10 | 11 | 12 | * **osfamilymap:** add package for Gentoo (\ `f07212d `_\ ) 13 | * **service:** service restart handling with watch requisite (\ `1ae8918 `_\ ) 14 | 15 | Continuous Integration 16 | ^^^^^^^^^^^^^^^^^^^^^^ 17 | 18 | 19 | * add ``arch-master`` to matrix and update ``.travis.yml`` [skip ci] (\ `fbc97db `_\ ) 20 | * **commitlint:** ensure ``upstream/master`` uses main repo URL [skip ci] (\ `7bc7b0d `_\ ) 21 | * **gemfile+lock:** use ``ssf`` customised ``kitchen-docker`` repo [skip ci] (\ `5eb060c `_\ ) 22 | * **gitlab-ci:** add ``rubocop`` linter (with ``allow_failure``\ ) [skip ci] (\ `b4ec26c `_\ ) 23 | * **kitchen+ci:** use latest pre-salted images (after CVE) [skip ci] (\ `d8bce5f `_\ ) 24 | * **kitchen+gitlab:** adjust matrix to add ``3003`` [skip ci] (\ `7732d92 `_\ ) 25 | * **kitchen+gitlab-ci:** use latest pre-salted images [skip ci] (\ `bbb13d1 `_\ ) 26 | * **pre-commit:** update hook for ``rubocop`` [skip ci] (\ `afb12f1 `_\ ) 27 | 28 | Tests 29 | ^^^^^ 30 | 31 | 32 | * standardise use of ``share`` suite & ``_mapdata`` state [skip ci] (\ `89986bf `_\ ) 33 | 34 | `0.6.0 `_ (2020-12-16) 35 | ------------------------------------------------------------------------------------------------------------ 36 | 37 | Continuous Integration 38 | ^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | 41 | * **gemfile.lock:** add to repo with updated ``Gemfile`` [skip ci] (\ `eebb7e0 `_\ ) 42 | * **gitlab-ci:** use GitLab CI as Travis CI replacement (\ `15e3cdb `_\ ) 43 | * **kitchen:** use ``saltimages`` Docker Hub where available [skip ci] (\ `02347ad `_\ ) 44 | * **kitchen+travis:** remove ``master-py2-arch-base-latest`` [skip ci] (\ `161c6a6 `_\ ) 45 | * **pre-commit:** add to formula [skip ci] (\ `6d36686 `_\ ) 46 | * **pre-commit:** enable/disable ``rstcheck`` as relevant [skip ci] (\ `ec4fa7b `_\ ) 47 | * **pre-commit:** finalise ``rstcheck`` configuration [skip ci] (\ `635902d `_\ ) 48 | * **travis:** add notifications => zulip [skip ci] (\ `3ae2959 `_\ ) 49 | * **workflows/commitlint:** add to repo [skip ci] (\ `80bdb6c `_\ ) 50 | 51 | Features 52 | ^^^^^^^^ 53 | 54 | 55 | * **config:** add support for switch type parameters (\ `20d67c1 `_\ ) 56 | * **scripts:** deploy helper scripts (\ `5fc37fa `_\ ) 57 | 58 | Styles 59 | ^^^^^^ 60 | 61 | 62 | * **libtofs.jinja:** use Black-inspired Jinja formatting [skip ci] (\ `16d6742 `_\ ) 63 | 64 | `0.5.1 `_ (2020-04-07) 65 | ------------------------------------------------------------------------------------------------------------ 66 | 67 | Bug Fixes 68 | ^^^^^^^^^ 69 | 70 | 71 | * **service:** restart service if config changes (\ `0490489 `_\ ), closes `#37 `_ 72 | 73 | `0.5.0 `_ (2020-04-06) 74 | ------------------------------------------------------------------------------------------------------------ 75 | 76 | Bug Fixes 77 | ^^^^^^^^^ 78 | 79 | 80 | * **libtofs:** “files_switch” mess up the variable exported by “map.jinja” [skip ci] (\ `e01cd28 `_\ ) 81 | 82 | Continuous Integration 83 | ^^^^^^^^^^^^^^^^^^^^^^ 84 | 85 | 86 | * **kitchen:** avoid using bootstrap for ``master`` instances [skip ci] (\ `05a0959 `_\ ) 87 | 88 | Features 89 | ^^^^^^^^ 90 | 91 | 92 | * **vrrp_sync_group:** added option for vrrp_sync_group (\ `45e3261 `_\ ) 93 | 94 | `0.4.5 `_ (2020-01-27) 95 | ------------------------------------------------------------------------------------------------------------ 96 | 97 | Bug Fixes 98 | ^^^^^^^^^ 99 | 100 | 101 | * **keepalived.conf.tmpl.jinja:** fix ``has no attribute`` error (\ `4391459 `_\ ), closes `/freenode.logbot.info/saltstack-formulas/20200122#c3126298-c3126299 `_ 102 | * **release.config.js:** use full commit hash in commit link [skip ci] (\ `e9f7b11 `_\ ) 103 | 104 | Continuous Integration 105 | ^^^^^^^^^^^^^^^^^^^^^^ 106 | 107 | 108 | * **gemfile:** restrict ``train`` gem version until upstream fix [skip ci] (\ `a1a51d5 `_\ ) 109 | * **kitchen:** use ``debian-10-master-py3`` instead of ``develop`` [skip ci] (\ `0bb4271 `_\ ) 110 | * **kitchen:** use ``develop`` image until ``master`` is ready (\ ``amazonlinux``\ ) [skip ci] (\ `2758e8e `_\ ) 111 | * **kitchen+travis:** upgrade matrix after ``2019.2.2`` release [skip ci] (\ `e638158 `_\ ) 112 | * **travis:** apply changes from build config validation [skip ci] (\ `4f492da `_\ ) 113 | * **travis:** opt-in to ``dpl v2`` to complete build config validation [skip ci] (\ `cc7542a `_\ ) 114 | * **travis:** quote pathspecs used with ``git ls-files`` [skip ci] (\ `5e42eaa `_\ ) 115 | * **travis:** run ``shellcheck`` during lint job [skip ci] (\ `47b3bce `_\ ) 116 | * **travis:** update ``salt-lint`` config for ``v0.0.10`` [skip ci] (\ `4d40216 `_\ ) 117 | * **travis:** use ``major.minor`` for ``semantic-release`` version [skip ci] (\ `3e9bc91 `_\ ) 118 | * **travis:** use build config validation (beta) [skip ci] (\ `2d42d93 `_\ ) 119 | 120 | Documentation 121 | ^^^^^^^^^^^^^ 122 | 123 | 124 | * **contributing:** remove to use org-level file instead [skip ci] (\ `603176e `_\ ) 125 | * **readme:** update link to ``CONTRIBUTING`` [skip ci] (\ `01df0d0 `_\ ) 126 | 127 | Performance Improvements 128 | ^^^^^^^^^^^^^^^^^^^^^^^^ 129 | 130 | 131 | * **travis:** improve ``salt-lint`` invocation [skip ci] (\ `45a87c6 `_\ ) 132 | 133 | `0.4.4 `_ (2019-10-12) 134 | ------------------------------------------------------------------------------------------------------------ 135 | 136 | Bug Fixes 137 | ^^^^^^^^^ 138 | 139 | 140 | * **rubocop:** add fixes using ``rubocop --safe-auto-correct`` (\ ` `_\ ) 141 | 142 | Continuous Integration 143 | ^^^^^^^^^^^^^^^^^^^^^^ 144 | 145 | 146 | * **kitchen:** change ``log_level`` to ``debug`` instead of ``info`` (\ ` `_\ ) 147 | * **kitchen:** install required packages to bootstrapped ``opensuse`` [skip ci] (\ ` `_\ ) 148 | * **kitchen:** use bootstrapped ``opensuse`` images until ``2019.2.2`` [skip ci] (\ ` `_\ ) 149 | * **kitchen+travis:** replace EOL pre-salted images (\ ` `_\ ) 150 | * **platform:** add ``arch-base-latest`` (\ ` `_\ ) 151 | * merge travis matrix, add ``salt-lint`` & ``rubocop`` to ``lint`` job (\ ` `_\ ) 152 | * merge travis matrix, add ``salt-lint`` & ``rubocop`` to ``lint`` job (\ ` `_\ ) 153 | * use ``dist: bionic`` & apply ``opensuse-leap-15`` SCP error workaround (\ ` `_\ ) 154 | * **travis:** merge ``rubocop`` linter into main ``lint`` job (\ ` `_\ ) 155 | * **yamllint:** add rule ``empty-values`` & use new ``yaml-files`` setting (\ ` `_\ ) 156 | 157 | `0.4.3 `_ (2019-08-27) 158 | ------------------------------------------------------------------------------------------------------------ 159 | 160 | Code Refactoring 161 | ^^^^^^^^^^^^^^^^ 162 | 163 | 164 | * **pillar:** sync map.jinja with template-formula (\ `96fe445 `_\ ) 165 | 166 | `0.4.2 `_ (2019-08-25) 167 | ------------------------------------------------------------------------------------------------------------ 168 | 169 | Documentation 170 | ^^^^^^^^^^^^^ 171 | 172 | 173 | * **readme:** fix indentation (\ `52c1359 `_\ ) 174 | 175 | `0.4.1 `_ (2019-08-25) 176 | ------------------------------------------------------------------------------------------------------------ 177 | 178 | Documentation 179 | ^^^^^^^^^^^^^ 180 | 181 | 182 | * **readme:** add testing section (\ `bbc0f7b `_\ ) 183 | 184 | `0.4.0 `_ (2019-08-10) 185 | ------------------------------------------------------------------------------------------------------------ 186 | 187 | Continuous Integration 188 | ^^^^^^^^^^^^^^^^^^^^^^ 189 | 190 | 191 | * **kitchen+travis:** modify matrix to include ``develop`` platform (\ `a9cadb3 `_\ ) 192 | 193 | Features 194 | ^^^^^^^^ 195 | 196 | 197 | * **yamllint:** include for this repo and apply rules throughout (\ `9e29ffa `_\ ) 198 | 199 | `0.3.0 `_ (2019-05-13) 200 | ------------------------------------------------------------------------------------------------------------ 201 | 202 | Features 203 | ^^^^^^^^ 204 | 205 | 206 | * **semantic-release:** implement an automated changelog (\ `51f872e `_\ ) 207 | -------------------------------------------------------------------------------- /docs/README.rst: -------------------------------------------------------------------------------- 1 | .. _readme: 2 | 3 | keepalived-formula 4 | ================== 5 | 6 | |img_travis| |img_sr| 7 | 8 | .. |img_travis| image:: https://travis-ci.com/saltstack-formulas/keepalived-formula.svg?branch=master 9 | :alt: Travis CI Build Status 10 | :scale: 100% 11 | :target: https://travis-ci.com/saltstack-formulas/keepalived-formula 12 | .. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg 13 | :alt: Semantic Release 14 | :scale: 100% 15 | :target: https://github.com/semantic-release/semantic-release 16 | 17 | Formula to set up and configure keepalived 18 | 19 | .. contents:: **Table of Contents** 20 | 21 | General notes 22 | ------------- 23 | 24 | See the full `SaltStack Formulas installation and usage instructions 25 | `_. 26 | 27 | If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section 28 | `_. 29 | 30 | If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``, 31 | which contains the currently released version. This formula is versioned according to `Semantic Versioning `_. 32 | 33 | See `Formula Versioning Section `_ for more details. 34 | 35 | Contributing to this repo 36 | ------------------------- 37 | 38 | **Commit message formatting is significant!!** 39 | 40 | Please see `How to contribute `_ for more details. 41 | 42 | Available states 43 | ---------------- 44 | 45 | .. contents:: 46 | :local: 47 | 48 | ``keepalived`` 49 | ^^^^^^^^^^^^^^ 50 | Installs and configures the keepalived package. 51 | 52 | ``keepalived.package`` 53 | ^^^^^^^^^^^^^^^^^^^^^^ 54 | Installs the keepalived package. 55 | 56 | ``keepalived.config`` 57 | ^^^^^^^^^^^^^^^^^^^^^ 58 | This state manages the file ``keepalived.conf`` under ``/etc/keepalived`` (template found in "keepalived/files"). The configuration is populated by values in "keepalived/map.jinja" based on the package's default values (and RedHat, Debian, Suse and Arch family distribution specific values), which can then be overridden by values of the same name in pillar. 59 | 60 | ``keepalived.scripts`` 61 | ^^^^^^^^^^^^^^^^^^^^^^ 62 | Put arbitrary helper scripts on the minion. Default scripts location: ``/etc/keepalived`` 63 | This state can deploy script, set its permissions like file mode, user and group, but it won't create new user / group if they do not exist. 64 | 65 | ``keepalived.service`` 66 | ^^^^^^^^^^^^^^^^^^^^^^ 67 | This state ensures that keepalived service is running. 68 | 69 | Testing 70 | ------- 71 | 72 | Linux testing is done with ``kitchen-salt``. 73 | 74 | Requirements 75 | ^^^^^^^^^^^^ 76 | 77 | * Ruby 78 | * Docker 79 | 80 | .. code-block:: bash 81 | 82 | $ gem install bundler 83 | $ bundle install 84 | $ bin/kitchen test [platform] 85 | 86 | Where ``[platform]`` is the platform name defined in ``kitchen.yml``, 87 | e.g. ``debian-9-2019-2-py3``. 88 | 89 | ``bin/kitchen converge`` 90 | ^^^^^^^^^^^^^^^^^^^^^^^^ 91 | 92 | Creates the docker instance and runs the ``keepalived`` main state, ready for testing. 93 | 94 | ``bin/kitchen verify`` 95 | ^^^^^^^^^^^^^^^^^^^^^^ 96 | 97 | Runs the ``inspec`` tests on the actual instance. 98 | 99 | ``bin/kitchen destroy`` 100 | ^^^^^^^^^^^^^^^^^^^^^^^ 101 | 102 | Removes the docker instance. 103 | 104 | ``bin/kitchen test`` 105 | ^^^^^^^^^^^^^^^^^^^^ 106 | 107 | Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``. 108 | 109 | ``bin/kitchen login`` 110 | ^^^^^^^^^^^^^^^^^^^^^ 111 | 112 | Gives you SSH access to the instance for manual testing. 113 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /keepalived/_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 | -------------------------------------------------------------------------------- /keepalived/_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 keepalived with context %} 7 | 8 | {%- set _mapdata = { 9 | "values": keepalived, 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 | -------------------------------------------------------------------------------- /keepalived/config/file.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- set sls_package_install = tplroot ~ '.package.install' %} 7 | {%- set sls_scripts_manage = tplroot ~ '.scripts.manage' %} 8 | {%- from tplroot ~ "/map.jinja" import keepalived with context %} 9 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} 10 | 11 | include: 12 | - {{ sls_package_install }} 13 | - {{ sls_scripts_manage }} 14 | 15 | keepalived-config-file-file-managed: 16 | file.managed: 17 | - name: {{ keepalived.config_file }} 18 | - user: root 19 | - group: root 20 | - template: jinja 21 | - source: {{ files_switch(['keepalived.conf.tmpl', 'keepalived.conf.tmpl.jinja'], 22 | lookup='keepalived-config-file-file-managed' 23 | ) 24 | }} 25 | - require: 26 | - sls: {{ sls_package_install }} 27 | - context: 28 | config: {{ keepalived.config | json }} 29 | -------------------------------------------------------------------------------- /keepalived/config/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .file 6 | -------------------------------------------------------------------------------- /keepalived/defaults.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | keepalived: 5 | package: keepalived 6 | config_file: /etc/keepalived/keepalived.conf 7 | service: 8 | name: keepalived 9 | config: 10 | global_defs: 11 | smtp_server: localhost 12 | scripts_dir: /etc/keepalived 13 | scripts: {} 14 | -------------------------------------------------------------------------------- /keepalived/files/default/keepalived.conf.tmpl.jinja: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # File managed by Salt at <{{ source }}>. 3 | # Your changes will be overwritten. 4 | ######################################################################## 5 | 6 | {%- from "keepalived/macro.jinja" import print_config %} 7 | {%- set sections = ['global_defs', 'vrrp_sync_group', 'vrrp_script', 'vrrp_instance', 'virtual_server'] %} 8 | {%- for section in sections %} 9 | {{ print_config({ section: config[section]|d({}) }) }} 10 | {%- endfor %} 11 | -------------------------------------------------------------------------------- /keepalived/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .package 6 | - .scripts 7 | - .config 8 | - .service 9 | -------------------------------------------------------------------------------- /keepalived/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 | -------------------------------------------------------------------------------- /keepalived/macro.jinja: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=jinja 3 | 4 | {%- set key = 0 -%} 5 | {%- set value = 1 -%} 6 | {%- set carryovers = ['real_server', 'virtual_server', 'virtual_server_group', 'vrrp_instance', 'vrrp_script', 'vrrp_sync_group'] -%} 7 | 8 | {%- macro print_config(data, carryover='', recurse=-1, indent=0) -%} 9 | {%- set recurse = recurse + 1 -%} 10 | {%- if data is none -%} 11 | {{- '\n' -}} 12 | {%- elif data is string or data is number -%} 13 | {{- data|string|indent(indent, True) }}{{ '\n' -}} 14 | {%- else -%} 15 | {%- if recurse > 0 -%} 16 | {{- '{\n' -}} 17 | {%- set indent = indent + 2 -%} 18 | {%- endif -%} 19 | {%- if data is mapping -%} 20 | {%- for item in data|dictsort -%} 21 | {%- if item[key] in carryovers -%} 22 | {{- print_config(item[value], carryover=item[key], indent=indent) -}} 23 | {%- else -%} 24 | {%- set carryIndent = indent -%} 25 | {%- set forwardIndent = indent -%} 26 | {%- if carryover -%} 27 | {{- carryover|indent(indent, True) }}{{ ' ' -}} 28 | {%- set carryIndent = 0 -%} 29 | {%- endif -%} 30 | {%- if item[value] is string or item[value] is not iterable -%} 31 | {%- set forwardIndent = 0 -%} 32 | {%- endif -%} 33 | {%- if item[value] is sameas true %} 34 | {#- If curent parameter is boolen type like nopreempt, dont_track_primary, etc. just print its name -#} 35 | {{- item[key]|indent(carryIndent, True) }}{{ '\n' -}} 36 | {%- else %} 37 | {{- item[key]|indent(carryIndent, True) }} {{ print_config(item[value], recurse=recurse, indent=forwardIndent) -}} 38 | {%- endif %} 39 | {%- endif -%} 40 | {%- endfor -%} 41 | {%- else -%} 42 | {%- for item in data -%} 43 | {{- print_config(item, indent=indent) -}} 44 | {%- endfor -%} 45 | {%- endif -%} 46 | {%- if recurse > 0 -%} 47 | {{- '}'|indent(indent - 2, True) -}}{{ '\n' }} 48 | {%- endif -%} 49 | {%- endif -%} 50 | {%- endmacro -%} 51 | -------------------------------------------------------------------------------- /keepalived/map.jinja: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=jinja 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {#- Start imports as #} 7 | {%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %} 8 | {%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %} 9 | {%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %} 10 | {%- import_yaml tplroot ~ "/osmap.yaml" as osmap %} 11 | {%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %} 12 | 13 | {#- Retrieve the config dict only once #} 14 | {%- set _config = salt['config.get'](tplroot, default={}) %} 15 | 16 | {%- set defaults = salt['grains.filter_by']( 17 | default_settings, 18 | default=tplroot, 19 | merge=salt['grains.filter_by']( 20 | osarchmap, 21 | grain='osarch', 22 | merge=salt['grains.filter_by']( 23 | osfamilymap, 24 | grain='os_family', 25 | merge=salt['grains.filter_by']( 26 | osmap, 27 | grain='os', 28 | merge=salt['grains.filter_by']( 29 | osfingermap, 30 | grain='osfinger', 31 | merge=salt['grains.filter_by']( 32 | _config, 33 | default='lookup' 34 | ) 35 | ) 36 | ) 37 | ) 38 | ) 39 | ) 40 | %} 41 | 42 | {%- set config = salt['grains.filter_by']( 43 | {'defaults': defaults}, 44 | default='defaults', 45 | merge=_config 46 | ) 47 | %} 48 | 49 | {%- set keepalived = config %} 50 | -------------------------------------------------------------------------------- /keepalived/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: amd64 15 | 16 | x86_64: 17 | arch: amd64 18 | 19 | 386: 20 | arch: 386 21 | 22 | arm64: 23 | arch: arm64 24 | 25 | armv6l: 26 | arch: armv6l 27 | 28 | armv7l: 29 | arch: armv7l 30 | 31 | ppc64le: 32 | arch: ppc64le 33 | 34 | s390x: 35 | arch: s390x 36 | -------------------------------------------------------------------------------- /keepalived/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` + `osarch.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 | Gentoo: 14 | package: sys-cluster/keepalived 15 | -------------------------------------------------------------------------------- /keepalived/osfingermap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | # 4 | # Setup variables using grains['osfinger'] based logic. 5 | # You just need to add the key:values for an `osfinger` that differ 6 | # from `defaults.yaml` + `osarch.yaml` + `os_family.yaml` + `osmap.yaml`. 7 | # Only add an `osfinger` which is/will be supported by the formula. 8 | # 9 | # If you do not need to provide defaults via the `os_finger` grain, 10 | # you will need to provide at least an empty dict in this file, e.g. 11 | # osfingermap: {} 12 | --- 13 | osfingermap: {} 14 | -------------------------------------------------------------------------------- /keepalived/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 | osmap: {} 14 | -------------------------------------------------------------------------------- /keepalived/package/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .install 6 | -------------------------------------------------------------------------------- /keepalived/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 keepalived with context %} 7 | 8 | keepalived-package-install-pkg-installed: 9 | pkg.installed: 10 | - name: {{ keepalived.package }} 11 | -------------------------------------------------------------------------------- /keepalived/scripts/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .manage 6 | -------------------------------------------------------------------------------- /keepalived/scripts/manage.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- set sls_package_install = tplroot ~ '.package.install' %} 7 | {%- from tplroot ~ "/map.jinja" import keepalived with context %} 8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} 9 | 10 | include: 11 | - {{ sls_package_install }} 12 | 13 | {#- Don't create scripts_dir if no scripts defined #} 14 | {%- if 'scripts' in keepalived and keepalived.scripts %} 15 | keepalived-scripts-manage-file-directory: 16 | file.directory: 17 | - name: {{ keepalived.scripts_dir }} 18 | - makedirs: true 19 | - require: 20 | - sls: {{ sls_package_install }} 21 | {%- endif %} 22 | 23 | {%- for script,data in keepalived.scripts|dictsort %} 24 | {%- set ensure = data.get('ensure', 'present') %} 25 | {%- if ensure == 'present' %} 26 | keepalived-scripts-manage-file-managed-{{ script }}: 27 | file.managed: 28 | - name: {{ data.get('dst_file', keepalived.scripts_dir ~ '/' ~ script) }} 29 | - user: {{ data.get('user', 'root') }} 30 | - group: {{ data.get('group', 'root') }} 31 | - mode: {{ data.get('mode', '755') }} 32 | - template: {{ data.get('template_engine', 'jinja') }} 33 | {%- if 'contents' in data %} 34 | - contents: | 35 | {{ data.contents|indent(width=8) }} 36 | {%- elif 'template_file' in data %} 37 | - source: {{ files_switch([data.template_file]) }} 38 | - context: 39 | data: {{ data.context|tojson }} 40 | {%- endif %} 41 | - require: 42 | - sls: {{ sls_package_install }} 43 | {%- elif ensure == 'absent' %} 44 | keepalived-scripts-manage-file-absent-{{ script }}: 45 | file.absent: 46 | - name: {{ data.get('dst_file', keepalived.scripts_dir ~ '/' ~ script) }} 47 | {%- endif %} 48 | {%- endfor %} 49 | -------------------------------------------------------------------------------- /keepalived/service/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .running 6 | -------------------------------------------------------------------------------- /keepalived/service/running.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | {#- Get the `tplroot` from `tpldir` #} 5 | {%- set tplroot = tpldir.split('/')[0] %} 6 | {%- set sls_config_file = tplroot ~ '.config.file' %} 7 | {%- from tplroot ~ "/map.jinja" import keepalived with context %} 8 | 9 | include: 10 | - {{ sls_config_file }} 11 | 12 | keepalived-service-running-service-running: 13 | service.running: 14 | - name: {{ keepalived.service.name }} 15 | - watch: 16 | - sls: {{ sls_config_file }} 17 | 18 | keepalived-service-running-service-enabled: 19 | service.enabled: 20 | - name: {{ keepalived.service.name }} 21 | -------------------------------------------------------------------------------- /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: keepalived 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 | - keepalived._mapdata 276 | - keepalived 277 | pillars: 278 | top.sls: 279 | base: 280 | '*': 281 | - keepalived 282 | pillars_from_files: 283 | keepalived.sls: pillar.example 284 | verifier: 285 | inspec_tests: 286 | - path: test/integration/default 287 | -------------------------------------------------------------------------------- /pillar.example: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # 5 | # Example pillar configuration 6 | # 7 | # Boolean entries must be placed stored as strings, otherwise it will show 8 | # up as 1 or 0 in the config file. 9 | # 10 | # Anything that needs to be in quotes in the configuration file needs to 11 | # be escaped in the yaml file. Otherwise the quotes will not appear in 12 | # the config file. 13 | # 14 | # When order is important, put the entries into a yaml array or list. This 15 | # could be used to place vrrp_script before vrrp_instance entries. 16 | 17 | # The following would generate the example file in RedHat based systems. 18 | 19 | keepalived: 20 | config: 21 | global_defs: 22 | notification_email: 23 | - acassen@firewall.loc 24 | - failover@firewall.loc 25 | - sysadmin@firewall.loc 26 | notification_email_from: Alexandre.Cassen@firewall.loc 27 | smtp_server: 192.168.200.1 28 | smtp_connect_timeout: 30 29 | router_id: LVS_DEVEL 30 | vrrp_sync_group: 31 | EXAMPLE_GROUP: 32 | group: 33 | - VI_IPV4 34 | - VI_IPV6 35 | vrrp_instance: 36 | VI_1: 37 | state: MASTER 38 | interface: eth0 39 | virtual_router_id: 51 40 | priority: 100 41 | advert_int: 1 42 | # switch type parameters must be defined as boolean: true / false 43 | # 1 / 0 values will be treated as numbers 44 | # nopreempt: true 45 | # dont_track_primary: true 46 | authentication: 47 | auth_type: PASS 48 | auth_pass: 1111 49 | virtual_ipaddress: 50 | - 192.168.200.16 51 | - 192.168.200.17 52 | - 192.168.200.18 53 | virtual_server: 54 | # Virtual and real servers include the port as part of the ID. 55 | 192.168.200.100 443: 56 | delay_loop: 6 57 | lb_algo: rr 58 | lb_kind: NAT 59 | nat_mask: 255.255.255.0 60 | persistence_timeout: 50 61 | protocol: TCP 62 | real_server: 63 | 192.168.201.100 443: 64 | weight: 1 65 | SSL_GET: 66 | # Must be a list because of multiple URL entries. 67 | - url: 68 | path: / 69 | digest: ff20ad2481f97b1754ef3e12ecd3a9cc 70 | - url: 71 | path: /mrtg/ 72 | digest: 9b3a0c85a887a256d6939da88aabd8cd 73 | - connect_timeout: 3 74 | - nb_get_retry: 3 75 | - delay_before_retry: 3 76 | 10.10.10.2 1358: 77 | delay_loop: 6 78 | lb_algo: rr 79 | lb_kind: NAT 80 | persistence_timeout: 50 81 | protocol: TCP 82 | sorry_server: 192.168.200.200 1358 83 | real_server: 84 | 192.168.200.2 1358: 85 | weight: 1 86 | HTTP_GET: 87 | # Must be a list because of multiple URL entries. 88 | - url: 89 | path: /testurl/test.jsp 90 | digest: 640205b7b0fc66c1ea91c463fac6334d 91 | - url: 92 | path: /testurl2/test.jsp 93 | digest: 640205b7b0fc66c1ea91c463fac6334d 94 | - url: 95 | path: /testurl3/test.jsp 96 | digest: 640205b7b0fc66c1ea91c463fac6334d 97 | - connect_timeout: 3 98 | - nb_get_retry: 3 99 | - delay_before_retry: 3 100 | 192.168.200.3 1358: 101 | weight: 1 102 | HTTP_GET: 103 | - url: 104 | path: /testurl/test.jsp 105 | digest: 640205b7b0fc66c1ea91c463fac6334c 106 | - url: 107 | path: /testurl2/test.jsp 108 | digest: 640205b7b0fc66c1ea91c463fac6334c 109 | - connect_timeout: 3 110 | - nb_get_retry: 3 111 | - delay_before_retry: 3 112 | 10.10.10.3 1358: 113 | delay_loop: 3 114 | lb_algo: rr 115 | lb_kind: NAT 116 | nat_mask: 255.255.255.0 117 | persistence_timeout: 50 118 | protocol: TCP 119 | real_server: 120 | 192.168.200.4 1358: 121 | weight: 1 122 | HTTP_GET: 123 | - url: 124 | path: /testurl/test.jsp 125 | digest: 640205b7b0fc66c1ea91c463fac6334d 126 | - url: 127 | path: /testurl2/test.jsp 128 | digest: 640205b7b0fc66c1ea91c463fac6334d 129 | - url: 130 | path: /testurl3/test.jsp 131 | digest: 640205b7b0fc66c1ea91c463fac6334d 132 | - connect_timeout: 3 133 | - nb_get_retry: 3 134 | - delay_before_retry: 3 135 | 192.168.200.5 1358: 136 | weight: 1 137 | HTTP_GET: 138 | - url: 139 | path: /testurl/test.jsp 140 | digest: 640205b7b0fc66c1ea91c463fac6334d 141 | - url: 142 | path: /testurl2/test.jsp 143 | digest: 640205b7b0fc66c1ea91c463fac6334d 144 | - url: 145 | path: /testurl3/test.jsp 146 | digest: 640205b7b0fc66c1ea91c463fac6334d 147 | - connect_timeout: 3 148 | - nb_get_retry: 3 149 | - delay_before_retry: 3 150 | vrrp_script: 151 | check_apache: 152 | script: '"killall -0 apache"' 153 | interval: 2 154 | weight: 10 155 | # put helper scripts on the minon 156 | # defaut directory where scripts will be saved if full path not specified 157 | scripts_dir: /etc/keepalived 158 | scripts: 159 | # item name, will be used as file name if full path not specified 160 | check_sshd.sh: 161 | # present - create script 162 | # absent - remove file 163 | ensure: present 164 | # user and group for script file, default is root:root 165 | # note: it's required to use existing user and group 166 | user: root 167 | group: root 168 | # file mode, default is 755 169 | mode: '755' 170 | # full path for script, optional 171 | # if not defined "scripts_dir + '/' + script" will be used as file name 172 | dst_file: /etc/keepalived/check_sshd.sh 173 | # 'contents' have more priority than 'template_file', 174 | # if 'contents' present, 'template_file' won't be used, 175 | # but one of them is mandatory 176 | contents: | 177 | #!/usr/bin/env bash 178 | pidof sshd 179 | # source template for script 180 | template_file: check_sshd.sh 181 | # template engine to use for rendering, default is jinja 182 | template_engine: jinja 183 | # dict with arbitrary data that will be passed to template as 'data' variable 184 | context: 185 | foo: bar 186 | -------------------------------------------------------------------------------- /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/keepalived-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/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 | control 'Keepalived configuration' do 4 | title 'should match desired lines' 5 | 6 | describe file('/etc/keepalived/keepalived.conf') do 7 | # Default config 8 | its('content') { should include 'smtp_server 192.168.200.1' } 9 | 10 | # Custom config from pillar 11 | its('content') { should include 'acassen@firewall.loc' } 12 | 13 | # Check config from example pillar -- example vrrp sync group 14 | its('content') { should include 'EXAMPLE_GROUP' } 15 | 16 | # Check config from example pillar -- vrrp sync group item 17 | its('content') { should include 'VI_IPV6' } 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /test/integration/default/controls/package_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'Keepalived package' do 4 | title 'should be installed' 5 | 6 | describe package('keepalived') do 7 | it { should be_installed } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/integration/default/controls/service_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'Keepalived service' do 4 | title 'should be installed' 5 | 6 | describe service('keepalived') do 7 | it { should be_installed } 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /test/integration/default/inspec.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: default 5 | title: keepalived formula 6 | maintainer: SaltStack Formulas 7 | license: Apache-2.0 8 | summary: Verify that the keepalived 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 | --------------------------------------------------------------------------------