├── syslog_ng ├── config │ ├── init.sls │ └── file.sls ├── package │ ├── init.sls │ └── install.sls ├── service │ ├── init.sls │ └── running.sls ├── init.sls ├── defaults.yaml ├── osfamilymap.yaml ├── _mapdata │ ├── _mapdata.jinja │ └── init.sls ├── osmap.yaml ├── osarchmap.yaml ├── macro.jinja ├── files │ └── default │ │ └── syslog-ng.conf ├── map.jinja ├── osfingermap.yaml └── libtofs.jinja ├── test ├── integration │ ├── default │ │ ├── controls │ │ │ ├── package_spec.rb │ │ │ ├── service_spec.rb │ │ │ └── config_spec.rb │ │ ├── inspec.yml │ │ └── README.md │ └── share │ │ ├── inspec.yml │ │ ├── README.md │ │ └── libraries │ │ └── system.rb └── salt │ └── pillar │ └── syslog_ng.sls ├── .github ├── settings.yml ├── workflows │ ├── commitlint.yml │ └── main.yml └── renovate.json5 ├── FORMULA ├── .rstcheck.cfg ├── commitlint.config.js ├── bin ├── install-hooks └── kitchen ├── .salt-lint ├── .yamllint ├── .rubocop.yml ├── .copier-answers.ssf-ci.yml ├── release-rules.js ├── release.config.js ├── Gemfile ├── pre-commit_semantic-release.sh ├── .gitignore ├── pillar.example ├── AUTHORS.md ├── CODEOWNERS ├── docs ├── README.rst ├── AUTHORS.rst ├── CHANGELOG.rst └── TOFS_pattern.rst ├── .pre-commit-config.yaml ├── pillar.debian.example ├── .travis.yml ├── kitchen.yml ├── .gitlab-ci.yml ├── LICENSE ├── CHANGELOG.md └── Gemfile.lock /syslog_ng/config/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .file 6 | -------------------------------------------------------------------------------- /syslog_ng/package/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .install 6 | -------------------------------------------------------------------------------- /syslog_ng/service/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .running 6 | -------------------------------------------------------------------------------- /syslog_ng/init.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=sls 3 | 4 | include: 5 | - .package 6 | - .config 7 | - .service 8 | -------------------------------------------------------------------------------- /syslog_ng/defaults.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | syslog_ng: 5 | rootgroup: root 6 | package: syslog-ng 7 | service: syslog-ng 8 | syslog_ng_config: /etc/syslog-ng/syslog-ng.conf 9 | -------------------------------------------------------------------------------- /syslog_ng/osfamilymap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | Arch: 5 | service: syslog-ng@default.service 6 | 7 | FreeBSD: 8 | rootgroup: wheel 9 | syslog_ng_config: /usr/local/etc/syslog-ng/syslog-ng.conf 10 | -------------------------------------------------------------------------------- /test/integration/default/controls/package_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'SyslogNG package' do 4 | title 'should be installed' 5 | 6 | describe package('syslog-ng') do 7 | it { should be_installed } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # These settings are synced to GitHub by https://probot.github.io/apps/settings/ 3 | 4 | repository: 5 | # See https://docs.github.com/en/rest/reference/repos#update-a-repository 6 | # for all available settings 7 | 8 | allow_squash_merge: false 9 | -------------------------------------------------------------------------------- /FORMULA: -------------------------------------------------------------------------------- 1 | name: syslog_ng 2 | os: Debian, Ubuntu, RedHat, Fedora, CentOS, Suse, openSUSE 3 | os_family: Debian, RedHat, Suse 4 | version: 0.6.1 5 | release: 1 6 | minimum_version: 2017.7 7 | summary: Syslog-NG formula 8 | description: Formula to use to install and configure syslog_ng 9 | top_level_dir: syslog_ng 10 | -------------------------------------------------------------------------------- /.rstcheck.cfg: -------------------------------------------------------------------------------- 1 | [rstcheck] 2 | report=info 3 | ignore_language=rst 4 | # salt['config.get']('roles') is misidentified as a Markdown link. 5 | # Ignore for now, but perhaps try to submit a fix upstream in rstcheck 6 | ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$|\(rst\) Link is formatted in Markdown style\.) 7 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /syslog_ng/_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 | -------------------------------------------------------------------------------- /test/integration/default/controls/service_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | syslogng_service = 4 | case platform[:name] 5 | when 'arch' 6 | 'syslog-ng@default.service' 7 | else 8 | 'syslog-ng' 9 | end 10 | control 'SyslogNG service' do 11 | title 'should be running and enabled' 12 | 13 | describe service(syslogng_service) do 14 | it { should be_enabled } 15 | it { should be_running } 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /.github/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | $schema: 'https://docs.renovatebot.com/renovate-schema.json', 3 | extends: [ 4 | "github>saltstack-formulas/.github", 5 | "github>saltstack-formulas/.github:copier" 6 | ], 7 | /********************************************************** 8 | * This file is managed as part of a Copier template. * 9 | * Please make your own changes below this comment. * 10 | *********************************************************/ 11 | } 12 | -------------------------------------------------------------------------------- /syslog_ng/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 | -------------------------------------------------------------------------------- /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 | ignores: [ 9 | (commit) => commit.startsWith('chore(copier):'), 10 | (commit) => commit.startsWith('chore(deps):'), 11 | (commit) => commit.startsWith('ci(pre-commit.ci):'), 12 | (commit) => commit.startsWith('[CI merge]') 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /syslog_ng/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 syslog_ng with context %} 8 | 9 | include: 10 | - {{ sls_config_file }} 11 | 12 | syslog_ng/service/running: 13 | service.running: 14 | - name: {{ syslog_ng.service }} 15 | - enable: true 16 | - watch: 17 | - sls: {{ sls_config_file }} 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # Extend the `default` configuration provided by `yamllint` 5 | extends: 'default' 6 | 7 | rules: 8 | comments: 9 | min-spaces-from-content: 1 10 | empty-values: 11 | forbid-in-block-mappings: true 12 | forbid-in-flow-mappings: true 13 | line-length: 14 | # Increase from default of `80` 15 | # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) 16 | max: 88 17 | allow-non-breakable-inline-mappings: true 18 | octal-values: 19 | forbid-implicit-octal: true 20 | forbid-explicit-octal: true 21 | -------------------------------------------------------------------------------- /test/integration/default/controls/config_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | control 'SyslogNG configuration' do 4 | title 'should match desired lines' 5 | 6 | str = 7 | ' 8 | source s_src { 9 | internal(); 10 | }; 11 | 12 | destination d_syslog { 13 | file("/var/log/syslog"); 14 | }; 15 | 16 | filter f_syslog3 { 17 | not level(debug); 18 | }; 19 | 20 | log { 21 | source(s_src); 22 | filter(f_syslog3); 23 | destination(d_syslog); 24 | }; 25 | ' 26 | 27 | describe file('/etc/syslog-ng/syslog-ng.conf') do 28 | it { should exist } 29 | 30 | # Custom config from pillar 31 | its('content') { should include str } 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /.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 | AllowedMethods: 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 | -------------------------------------------------------------------------------- /.copier-answers.ssf-ci.yml: -------------------------------------------------------------------------------- 1 | # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY 2 | _commit: v2.8.0 3 | _src_path: https://github.com/dafyddj/copier-ssf-ci 4 | failure_permitted_ignored: [] 5 | failure_permitted_patterns: 6 | - ^amazonlinux- 7 | - ^almalinux- 8 | - ^oraclelinux- 9 | - ^rockylinux- 10 | - ^centos- 11 | formula_name: syslog-ng 12 | release_using_gha: false 13 | renovate_extend_presets: 14 | - github>saltstack-formulas/.github 15 | - github>saltstack-formulas/.github:copier 16 | renovate_ignore_presets: [] 17 | supported_oses: 18 | - AlmaLinux OS 19 | - Amazon Linux 20 | - CentOS 21 | - Debian 22 | - Fedora Linux 23 | - openSUSE 24 | - Oracle Linux 25 | - Rocky Linux 26 | - Ubuntu 27 | -------------------------------------------------------------------------------- /test/salt/pillar/syslog_ng.sls: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | syslog_ng: 5 | options: 6 | - chain_hostnames: false 7 | - flush_lines: 0 8 | - use_dns: false 9 | - use_fqdn: false 10 | - owner: root 11 | - group: adm 12 | - perm: =0640 13 | - stats_freq: 0 14 | - bad_hostname: "^gconfd$" 15 | 16 | source: 17 | - s_src: 18 | - internal: null 19 | 20 | destination: 21 | - d_syslog: 22 | - file: 23 | - /var/log/syslog 24 | 25 | filter: 26 | - f_syslog3: 27 | - =not level(debug) 28 | 29 | log: 30 | - 31 | - source: =s_src 32 | - filter: =f_syslog3 33 | - destination: =d_syslog 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /syslog_ng/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /syslog_ng/macro.jinja: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=jinja 3 | 4 | {%- macro rule_builder(rule) -%} 5 | {%- if rule is none -%} 6 | {%- elif rule is sameas true -%} 7 | yes 8 | {%- elif rule is sameas false -%} 9 | no 10 | {%- elif rule is number -%} 11 | {{ rule }} 12 | {%- elif rule is mapping -%} 13 | {%- for k, v in rule.items() -%} 14 | {{ k }}({{ rule_builder(v) }}) 15 | {%- endfor -%} 16 | {%- elif rule is iterable and rule is not string -%} 17 | {%- for v in rule -%} 18 | {{ rule_builder(v) }} 19 | {%- endfor -%} 20 | {%- else -%} 21 | {%- if rule[0] == '=' -%} 22 | {{ rule[1:] }} 23 | {%- else -%} 24 | "{{ rule }}" 25 | {%- endif -%} 26 | {%- endif -%} 27 | {%- endmacro -%} 28 | -------------------------------------------------------------------------------- /syslog_ng/_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 syslog_ng with context %} 7 | 8 | {%- set _mapdata = { 9 | "values": syslog_ng, 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 | -------------------------------------------------------------------------------- /test/integration/default/inspec.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | name: default 5 | title: syslog_ng formula 6 | maintainer: SaltStack Formulas 7 | license: Apache-2.0 8 | summary: Verify that the syslog_ng 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 | -------------------------------------------------------------------------------- /syslog_ng/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 | {%- from tplroot ~ "/map.jinja" import syslog_ng with context %} 8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} 9 | 10 | include: 11 | - {{ sls_package_install }} 12 | 13 | syslog_ng/config/install: 14 | file.managed: 15 | - name: {{ syslog_ng.syslog_ng_config }} 16 | - source: {{ files_switch(['syslog-ng.conf'], 17 | lookup='syslog_ng/config/install' 18 | ) 19 | }} 20 | - template: jinja 21 | - user: root 22 | - group: {{ syslog_ng.rootgroup }} 23 | - mode: 644 24 | - require: 25 | - sls: {{ sls_package_install }} 26 | - context: 27 | syslog_ng: {{ syslog_ng | json }} 28 | -------------------------------------------------------------------------------- /release.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // TODO: remove this when we no longer process releases on GitLab CI 3 | repositoryUrl: 'https://github.com/saltstack-formulas/syslog-ng-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 | // eslint-disable-next-line no-template-curly-in-string 16 | prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}' 17 | }], 18 | ['@semantic-release/git', { 19 | assets: ['*.md', 'docs/*.rst', 'FORMULA'] 20 | }], 21 | '@semantic-release/github' 22 | ], 23 | generateNotes: { 24 | preset: 'angular' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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', '3.0.0' 19 | gem 'kitchen-salt', '0.7.2' 20 | 21 | # Avoid the error 'pkeys are immutable on OpenSSL 3.0' 22 | gem 'net-ssh', '>= 7.0.0' 23 | 24 | gem 'test-kitchen', '3.7.0' 25 | -------------------------------------------------------------------------------- /syslog_ng/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 syslog_ng with context %} 7 | 8 | {#- Simulating `grains.osfinger`, which is avoided since not available in all distros #} 9 | {%- if [grains.os, grains.osrelease] == ['Amazon', '2'] %} 10 | syslog_ng/package/repo: 11 | pkgrepo.managed: 12 | - name: epel 13 | - humanname: Extra Packages for Enterprise Linux 7 - $basearch 14 | - mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch 15 | - enabled: 1 16 | - gpgcheck: 1 17 | - gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 18 | - failovermethod: priority 19 | - require_in: 20 | - pkg: syslog_ng/package/install 21 | {%- endif %} 22 | 23 | syslog_ng/package/install: 24 | pkg.installed: 25 | - name: {{ syslog_ng.package }} 26 | 27 | {%- if syslog_ng.packages is defined and syslog_ng.packages %} 28 | syslog_ng/packages/install: 29 | pkg.installed: 30 | - pkgs: 31 | {%- for pkg in syslog_ng.packages %} 32 | - {{ pkg.name }}{% if pkg.version is defined and pkg.version %}: '{{ pkg.version }}' {% endif %} 33 | {%- endfor %} 34 | {%- endif %} 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pre-commit_semantic-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ############################################################################### 4 | # (A) Update `FORMULA` with `${nextRelease.version}` 5 | ############################################################################### 6 | 7 | sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA 8 | 9 | 10 | ############################################################################### 11 | # (B) Update `AUTHORS.md` 12 | ############################################################################### 13 | 14 | maintainer contributor \ 15 | --ignore-contributors dependabot[bot],renovate[bot],semantic-release-bot 16 | 17 | ############################################################################### 18 | # (C) Use `m2r` to convert automatically produced `.md` docs to `.rst` 19 | ############################################################################### 20 | 21 | # Copy and then convert the `.md` docs 22 | cp ./*.md docs/ 23 | cd docs/ || exit 24 | m2r --overwrite ./*.md 25 | 26 | # Change excess `H1` headings to `H2` in converted `CHANGELOG.rst` 27 | sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst 28 | sed -i -e '1,4s/-/=/g' CHANGELOG.rst 29 | 30 | # Use for debugging output, when required 31 | # cat AUTHORS.rst 32 | # cat CHANGELOG.rst 33 | 34 | # Return back to the main directory 35 | cd .. 36 | -------------------------------------------------------------------------------- /syslog_ng/files/default/syslog-ng.conf: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # File managed by Salt at <{{ source }}>. 3 | # Your changes will be overwritten. 4 | ######################################################################## 5 | 6 | {%- from "syslog_ng/macro.jinja" import rule_builder %} 7 | 8 | @version: {{ syslog_ng.get('version', '3.3') }} 9 | 10 | {%- for module in syslog_ng.get('module', []) %} 11 | @module {{ rule_builder(module) }} 12 | {%- endfor %} 13 | 14 | {%- for inc in syslog_ng.get('include', []) %} 15 | @include {{ rule_builder(inc) }} 16 | {%- endfor %} 17 | 18 | options { 19 | {%- for rule in syslog_ng.get('options', []) %} 20 | {{ rule_builder(rule) }}; 21 | {%- endfor %} 22 | }; 23 | 24 | {%- for obj in ('source', 'destination', 'filter', 'parser', 'rewrite', 'template') %} 25 | {%- for params in syslog_ng.get(obj, []) %} 26 | {% for name, rules in params.items() %} 27 | {{ obj }} {{ name }} { 28 | {%- for rule in rules %} 29 | {{ rule_builder(rule) }}; 30 | {%- endfor %} 31 | }; 32 | {%- endfor %} 33 | {%- endfor %} 34 | {%- endfor %} 35 | 36 | {% for loggers in syslog_ng.get('log', []) -%} 37 | log { 38 | {%- for rule in loggers %} 39 | {{ rule_builder(rule) }}; 40 | {%- endfor %} 41 | }; 42 | 43 | {% endfor %} 44 | 45 | {%- for inc in syslog_ng.get('last_include', []) %} 46 | @include {{ rule_builder(inc) }} 47 | {%- endfor %} 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /syslog_ng/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 syslog_ng = config %} 50 | -------------------------------------------------------------------------------- /syslog_ng/osfingermap.yaml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | # Debian 5 | Debian-7: 6 | version: 3.3 7 | include: 8 | - scl.conf 9 | - '`scl-root`/system/tty10.conf' 10 | last_include: 11 | - /etc/syslog-ng/conf.d/ 12 | 13 | Debian-8: 14 | version: 3.5 15 | include: 16 | - scl.conf 17 | - '`scl-root`/system/tty10.conf' 18 | last_include: 19 | - /etc/syslog-ng/conf.d/*.conf 20 | 21 | Debian-9: 22 | version: 3.8 23 | include: 24 | - scl.conf 25 | last_include: 26 | - /etc/syslog-ng/conf.d/*.conf 27 | 28 | Debian-10: 29 | version: 3.12 30 | include: 31 | - scl.conf 32 | last_include: 33 | - /etc/syslog-ng/conf.d/*.conf 34 | 35 | Debian-11: 36 | version: 3.28 37 | include: 38 | - scl.conf 39 | last_include: 40 | - /etc/syslog-ng/conf.d/*.conf 41 | 42 | Debian-12: 43 | version: 3.38 44 | include: 45 | - scl.conf 46 | last_include: 47 | - /etc/syslog-ng/conf.d/*.conf 48 | 49 | Debian-13: 50 | version: 4.8 51 | include: 52 | - scl.conf 53 | last_include: 54 | - /etc/syslog-ng/conf.d/*.conf 55 | 56 | # Ubuntu 57 | Ubuntu-16.04: 58 | version: 3.5 59 | include: 60 | - scl.conf 61 | - '`scl-root`/system/tty10.conf' 62 | last_include: 63 | - /etc/syslog-ng/conf.d/*.conf 64 | 65 | Ubuntu-18.04: 66 | version: 3.13 67 | include: 68 | - scl.conf 69 | last_include: 70 | - /etc/syslog-ng/conf.d/*.conf 71 | 72 | # Suse 73 | Leap-15: 74 | version: 3.19 75 | include: 76 | - scl.conf 77 | last_include: 78 | - /etc/syslog-ng/conf.d/ 79 | 80 | # CentOS 81 | CentOS-6: 82 | version: 3.2 83 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /pillar.example: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | syslog_ng: 5 | module: 6 | - tfson 7 | include: 8 | - scl.conf 9 | last_include: 10 | - /etc/syslog-ng/conf.d/*.conf 11 | version: 3.5 12 | options: 13 | - threaded: true 14 | - use_dns: false 15 | - use_fqdn: true 16 | - keep_hostname: true 17 | - chain_hostnames: false 18 | - check_hostname: false 19 | source: 20 | - s_internal: 21 | - internal: null 22 | - s_local: 23 | - unix-stream: /dev/log 24 | - file: 25 | - /proc/kmsg 26 | - program_override: kernel 27 | destination: 28 | - df_messages: 29 | - file: 30 | - /var/log/messages 31 | - df_secure: 32 | - file: /var/log/secure 33 | - df_console: 34 | - usertty: root 35 | - dp_devnull: 36 | - program: /bin/cat >/dev/null 37 | - dr_central: 38 | - syslog: my-remote.example.com 39 | filter: 40 | - f_messages: 41 | - level: =info..emerg 42 | - f_secure: 43 | - facility: =authpriv 44 | - f_emerg: 45 | - level: =emerg 46 | - facility: =uucp, news 47 | log: 48 | - 49 | - source: =s_internal 50 | - source: =s_local 51 | - destination: =dr_central 52 | - 53 | - source: =s_local 54 | - filter: =f_emerg 55 | - destination: =df_console 56 | - 57 | - source: =s_local 58 | - filter: =f_secure 59 | - destination: =df_secure 60 | - flags: =final 61 | - 62 | - source: =s_local 63 | - filter: =f_messages 64 | - destination: =df_messages 65 | 66 | tofs: 67 | # # The files_switch key serves as a selector for alternative 68 | # # directories under the formula files directory. See TOFS pattern 69 | # # doc for more info. 70 | # # Note: Any value not evaluated by `config.get` will be used literally. 71 | # # This can be used to set custom paths, as many levels deep as required. 72 | # files_switch: 73 | # - any/path/can/be/used/here 74 | # - id 75 | # - roles 76 | # - osfinger 77 | # - os 78 | # - os_family 79 | # # All aspects of path/file resolution are customisable using the options below. 80 | # # This is unnecessary in most cases; there are sensible defaults. 81 | # path_prefix: template_alt 82 | # dirs: 83 | # files: files_alt 84 | # default: default_alt 85 | # # The entries under `source_files` are prepended to the default source files 86 | # # given for the state 87 | source_files: 88 | syslog_ng/config/install: 89 | - 'alt_syslog-ng.conf' 90 | -------------------------------------------------------------------------------- /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)|146 8 | @n-rodriguez|[@n-rodriguez](https://github.com/n-rodriguez)|52 9 | @dafyddj|[@dafyddj](https://github.com/dafyddj)|8 10 | @aboe76|[@aboe76](https://github.com/aboe76)|7 11 | @genuss|[@genuss](https://github.com/genuss)|6 12 | @sylvainfaivre|[@sylvainfaivre](https://github.com/sylvainfaivre)|4 13 | @puneetk|[@puneetk](https://github.com/puneetk)|3 14 | @daks|[@daks](https://github.com/daks)|3 15 | @nmadhok|[@nmadhok](https://github.com/nmadhok)|2 16 | @EvaSDK|[@EvaSDK](https://github.com/EvaSDK)|2 17 | @gravyboat|[@gravyboat](https://github.com/gravyboat)|2 18 | @alxwr|[@alxwr](https://github.com/alxwr)|1 19 | @iggy|[@iggy](https://github.com/iggy)|1 20 | @baby-gnu|[@baby-gnu](https://github.com/baby-gnu)|1 21 | @do3meli|[@do3meli](https://github.com/do3meli)|1 22 | @noelmcloughlin|[@noelmcloughlin](https://github.com/noelmcloughlin)|1 23 | 24 | --- 25 | 26 | Auto-generated by [gaocegege/maintainer](https://github.com/maintainer-org/maintainer) on 2025-09-04. 27 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Test & release 3 | 4 | 'on': 5 | - pull_request 6 | - push 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: ${{ github.ref != format('refs/heads/{0}', 11 | github.event.repository.default_branch) }} 12 | 13 | jobs: 14 | should-run: 15 | name: Prep / Should run 16 | runs-on: ubuntu-latest 17 | timeout-minutes: 5 18 | outputs: 19 | should-run: ${{ steps.action.outputs.should-run }} 20 | steps: 21 | - id: action 22 | # yamllint disable-line rule:line-length 23 | uses: techneg-it/should-workflow-run@eff19348eb884f57e05bc6f05ae48ece3af14714 # v1.0.1 24 | pre-commit: 25 | name: Lint / `pre-commit` 26 | needs: should-run 27 | if: fromJSON(needs.should-run.outputs.should-run) 28 | container: techneg/ci-pre-commit:v2.5.5@sha256:9d92b83a64378da3f9363668b0da244d9f12039d86579881d649ddb40ce261f3 29 | runs-on: ubuntu-latest 30 | timeout-minutes: 10 31 | steps: 32 | - run: | # Needed because of bug #2031 in `actions/checkout` 33 | git config --global --add safe.directory "$GITHUB_WORKSPACE" 34 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 35 | with: 36 | fetch-depth: 0 37 | fetch-tags: true 38 | filter: tree:0 39 | - name: Export `CI_CACHE_ID` from container 40 | run: echo "CI_CACHE_ID=$(cat /.ci_cache_id)" >> $GITHUB_ENV 41 | - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 42 | with: 43 | path: ~/.cache/pre-commit 44 | key: "${{ env.CI_CACHE_ID }}|\ 45 | ${{ hashFiles('.pre-commit-config.yaml') }}" 46 | restore-keys: | 47 | ${{ env.CI_CACHE_ID }}| 48 | - name: Build cache 49 | run: | 50 | pre-commit gc 51 | echo "Installing hook environments..." 52 | time -f "Hook installation took %E" pre-commit install-hooks 53 | - name: Run `pre-commit` 54 | run: | 55 | pre-commit run --all-files --color always --verbose 56 | pre-commit run --color always --hook-stage manual --verbose commitlint-ci 57 | results: 58 | name: Release / Collect results 59 | permissions: 60 | contents: write 61 | issues: write 62 | pull-requests: write 63 | checks: read 64 | container: techneg/ci-semantic-release:v1.2.4@sha256:e7cfe36054a56382568c0824d2539a67a956711d7b674093db320815e928ee27 65 | runs-on: ubuntu-latest 66 | timeout-minutes: 15 67 | steps: 68 | - run: | # Needed due to bug actions/checkout#2031 69 | git config --global --add safe.directory "$GITHUB_WORKSPACE" 70 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 71 | # yamllint disable-line rule:line-length 72 | - uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0 73 | with: 74 | ignore: > 75 | Release / Collect results 76 | ignore_pattern: ^GitLab CI 77 | token: ${{ secrets.GITHUB_TOKEN }} 78 | - name: Run `semantic-release` 79 | env: 80 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 81 | MAINTAINER_TOKEN: ${{ secrets.GITHUB_TOKEN }} 82 | run: | 83 | semantic-release --dry-run 84 | - run: echo "::notice ::Workflow success!" 85 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/README.rst: -------------------------------------------------------------------------------- 1 | syslog-ng-formula 2 | ================= 3 | 4 | |img_travis| |img_sr| 5 | 6 | .. |img_travis| image:: https://travis-ci.com/saltstack-formulas/syslog-ng-formula.svg?branch=master 7 | :alt: Travis CI Build Status 8 | :scale: 100% 9 | :target: https://travis-ci.com/saltstack-formulas/syslog-ng-formula 10 | .. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg 11 | :alt: Semantic Release 12 | :scale: 100% 13 | :target: https://github.com/semantic-release/semantic-release 14 | 15 | Formula to set up and configure syslog_ng 16 | 17 | .. contents:: **Table of Contents** 18 | 19 | General notes 20 | ------------- 21 | 22 | See the full `SaltStack Formulas installation and usage instructions 23 | `_. 24 | 25 | If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section 26 | `_. 27 | 28 | If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``, 29 | which contains the currently released version. This formula is versioned according to `Semantic Versioning `_. 30 | 31 | See `Formula Versioning Section `_ for more details. 32 | 33 | Contributing to this repo 34 | ------------------------- 35 | 36 | **Commit message formatting is significant!!** 37 | 38 | Please see `How to contribute `_ for more details. 39 | 40 | Available states 41 | ---------------- 42 | 43 | .. contents:: 44 | :local: 45 | 46 | ``syslog_ng`` 47 | ^^^^^^^^^^^^^ 48 | Installs and configures the syslog_ng package. 49 | 50 | ``syslog_ng.package`` 51 | ^^^^^^^^^^^^^^^^^^^^^ 52 | Installs the syslog_ng package and optional packages which may provide additional functionalities. 53 | 54 | ``syslog_ng.config`` 55 | ^^^^^^^^^^^^^^^^^^^^ 56 | This state manages the file ``syslog_ng.conf`` under ``/etc/syslog-ng`` (template found in "syslog_ng/files"). The configuration is populated by values in "syslog_ng/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. 57 | 58 | ``syslog_ng.service`` 59 | ^^^^^^^^^^^^^^^^^^^^^ 60 | Manages the startup and running state of the syslog_ng service. 61 | 62 | Testing 63 | ------- 64 | 65 | Linux testing is done with ``kitchen-salt``. 66 | 67 | Requirements 68 | ^^^^^^^^^^^^ 69 | 70 | * Ruby 71 | * Docker 72 | 73 | .. code-block:: bash 74 | 75 | $ gem install bundler 76 | $ bundle install 77 | $ bin/kitchen test [platform] 78 | 79 | Where ``[platform]`` is the platform name defined in ``kitchen.yml``, 80 | e.g. ``debian-9-2019-2-py3``. 81 | 82 | ``bin/kitchen converge`` 83 | ^^^^^^^^^^^^^^^^^^^^^^^^ 84 | 85 | Creates the docker instance and runs the ``syslog_ng`` main state, ready for testing. 86 | 87 | ``bin/kitchen verify`` 88 | ^^^^^^^^^^^^^^^^^^^^^^ 89 | 90 | Runs the ``inspec`` tests on the actual instance. 91 | 92 | ``bin/kitchen destroy`` 93 | ^^^^^^^^^^^^^^^^^^^^^^^ 94 | 95 | Removes the docker instance. 96 | 97 | ``bin/kitchen test`` 98 | ^^^^^^^^^^^^^^^^^^^^ 99 | 100 | Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``. 101 | 102 | ``bin/kitchen login`` 103 | ^^^^^^^^^^^^^^^^^^^^^ 104 | 105 | Gives you SSH access to the instance for manual testing. 106 | -------------------------------------------------------------------------------- /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 | - 146 19 | * - :raw-html-m2r:`@n-rodriguez` 20 | - `@n-rodriguez `_ 21 | - 52 22 | * - :raw-html-m2r:`@dafyddj` 23 | - `@dafyddj `_ 24 | - 8 25 | * - :raw-html-m2r:`@aboe76` 26 | - `@aboe76 `_ 27 | - 7 28 | * - :raw-html-m2r:`@genuss` 29 | - `@genuss `_ 30 | - 6 31 | * - :raw-html-m2r:`@sylvainfaivre` 32 | - `@sylvainfaivre `_ 33 | - 4 34 | * - :raw-html-m2r:`@puneetk` 35 | - `@puneetk `_ 36 | - 3 37 | * - :raw-html-m2r:`@daks` 38 | - `@daks `_ 39 | - 3 40 | * - :raw-html-m2r:`@nmadhok` 41 | - `@nmadhok `_ 42 | - 2 43 | * - :raw-html-m2r:`@EvaSDK` 44 | - `@EvaSDK `_ 45 | - 2 46 | * - :raw-html-m2r:`@gravyboat` 47 | - `@gravyboat `_ 48 | - 2 49 | * - :raw-html-m2r:`@alxwr` 50 | - `@alxwr `_ 51 | - 1 52 | * - :raw-html-m2r:`@iggy` 53 | - `@iggy `_ 54 | - 1 55 | * - :raw-html-m2r:`@baby-gnu` 56 | - `@baby-gnu `_ 57 | - 1 58 | * - :raw-html-m2r:`@do3meli` 59 | - `@do3meli `_ 60 | - 1 61 | * - :raw-html-m2r:`@noelmcloughlin` 62 | - `@noelmcloughlin `_ 63 | - 1 64 | 65 | 66 | ---- 67 | 68 | Auto-generated by `gaocegege/maintainer `_ on 2025-09-04. 69 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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: [pre-commit] 19 | repos: 20 | - repo: https://github.com/pre-commit/pre-commit-hooks 21 | rev: v6.0.0 22 | hooks: 23 | - id: check-merge-conflict 24 | name: Check for Git merge conflicts 25 | args: [--assume-in-merge] 26 | exclude: ^docs/AUTHORS.rst$ 27 | - repo: https://github.com/dafyddj/mirrors-commitlint 28 | rev: v19.8.1 29 | hooks: 30 | - id: commitlint 31 | - id: commitlint-ci 32 | - repo: https://github.com/rubocop-hq/rubocop 33 | rev: v1.80.1 34 | hooks: 35 | - id: rubocop 36 | name: Check Ruby files with rubocop 37 | args: [--debug] 38 | - repo: https://github.com/shellcheck-py/shellcheck-py 39 | rev: v0.9.0.6 40 | hooks: 41 | - id: shellcheck 42 | name: Check shell scripts with shellcheck 43 | files: ^.*\.(sh|bash|ksh)$ 44 | types: [] 45 | - repo: https://github.com/adrienverge/yamllint 46 | rev: v1.37.1 47 | hooks: 48 | - id: yamllint 49 | name: Check YAML syntax with yamllint 50 | args: [--strict] 51 | types: [file] 52 | # Files to include 53 | # 1. Obvious YAML files 54 | # 2. `pillar.example` and similar files 55 | # 3. SLS files under directory `test/` which are pillar files 56 | # Files to exclude 57 | # 1. SLS files under directory `test/` which are state files 58 | # 2. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax 59 | # 3. YAML files heavily reliant on Jinja 60 | # 4. `.copier-answers.yml` and its variants which are auto-generated 61 | files: | 62 | (?x)^( 63 | .*\.yaml| 64 | .*\.yml| 65 | \.salt-lint| 66 | \.yamllint| 67 | .*\.example| 68 | test/.*\.sls 69 | )$ 70 | exclude: | 71 | (?x)^( 72 | \.copier-answers(\..+)?\.ya?ml| 73 | kitchen.vagrant.yml| 74 | test/.*/states/.*\.sls 75 | )$ 76 | - repo: https://github.com/warpnet/salt-lint 77 | rev: v0.9.2 78 | hooks: 79 | - id: salt-lint 80 | name: Check Salt files using salt-lint 81 | files: ^.*\.(sls|jinja|j2|tmpl|tst)$ 82 | - repo: https://github.com/rstcheck/rstcheck 83 | rev: v6.2.5 84 | hooks: 85 | - id: rstcheck 86 | name: Check reST files using rstcheck 87 | exclude: 'docs/CHANGELOG.rst' 88 | additional_dependencies: [sphinx==7.2.6] 89 | - repo: https://github.com/saltstack-formulas/mirrors-rst-lint 90 | rev: v1.4.0 91 | hooks: 92 | - id: rst-lint 93 | name: Check reST files using rst-lint 94 | exclude: | 95 | (?x)^( 96 | docs/CHANGELOG.rst| 97 | docs/TOFS_pattern.rst| 98 | docs/CONTRIBUTING_DOCS.rst| 99 | docs/index.rst| 100 | )$ 101 | additional_dependencies: [pygments==2.16.1] 102 | - repo: https://github.com/renovatebot/pre-commit-hooks 103 | rev: 41.93.2 104 | hooks: 105 | - id: renovate-config-validator 106 | name: Check Renovate config with renovate-config-validator 107 | - repo: https://github.com/python-jsonschema/check-jsonschema 108 | rev: 0.33.3 109 | hooks: 110 | - id: check-github-workflows 111 | name: Check GitHub workflows with check-jsonschema 112 | args: [--verbose] 113 | - id: check-gitlab-ci 114 | name: Check GitLab CI config with check-jsonschema 115 | args: [--verbose] 116 | - repo: https://github.com/standard/standard 117 | rev: v17.1.2 118 | hooks: 119 | - id: standard 120 | name: Check JavaScript files using standardJS 121 | -------------------------------------------------------------------------------- /syslog_ng/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 | -------------------------------------------------------------------------------- /pillar.debian.example: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | syslog_ng: 5 | options: 6 | - chain_hostnames: false 7 | - flush_lines: 0 8 | - use_dns: false 9 | - use_fqdn: false 10 | - owner: root 11 | - group: adm 12 | - perm: =0640 13 | - stats_freq: 0 14 | - bad_hostname: "^gconfd$" 15 | 16 | source: 17 | - s_src: 18 | - system: null 19 | - internal: null 20 | 21 | destination: 22 | # First some standard logfile 23 | - d_auth: 24 | - file: 25 | - /var/log/auth.log 26 | - d_cron: 27 | - file: 28 | - /var/log/cron.log 29 | - d_daemon: 30 | - file: 31 | - /var/log/daemon.log 32 | - d_kern: 33 | - file: 34 | - /var/log/kern.log 35 | - d_lpr: 36 | - file: 37 | - /var/log/lpr.log 38 | - d_mail: 39 | - file: 40 | - /var/log/mail.log 41 | - d_syslog: 42 | - file: 43 | - /var/log/syslog 44 | - d_user: 45 | - file: 46 | - /var/log/user.log 47 | - d_uucp: 48 | - file: 49 | - /var/log/uucp.log 50 | 51 | # This files are the log come from the mail subsystem. 52 | - d_mailinfo: 53 | - file: 54 | - /var/log/mail.info 55 | - d_mailwarn: 56 | - file: 57 | - /var/log/mail.warn 58 | - d_mailerr: 59 | - file: 60 | - /var/log/mail.err 61 | 62 | # Logging for INN news system 63 | - d_newscrit: 64 | - file: 65 | - /var/log/news/news.crit 66 | - d_newserr: 67 | - file: 68 | - /var/log/news/news.err 69 | - d_newsnotice: 70 | - file: 71 | - /var/log/news/news.notice 72 | 73 | # Some 'catch-all' logfiles 74 | - d_debug: 75 | - file: 76 | - /var/log/debug 77 | - d_error: 78 | - file: 79 | - /var/log/error 80 | - d_messages: 81 | - file: 82 | - /var/log/messages 83 | 84 | # The root's console. 85 | - d_console: 86 | - usertty: 87 | - root 88 | 89 | # Virtual console. 90 | - d_console_all: 91 | - file: 92 | - '`tty10`' 93 | 94 | # The named pipe /dev/xconsole is for the nsole' utility. 95 | - d_xconsole: 96 | - pipe: 97 | - /dev/xconsole 98 | 99 | # Debian only 100 | - d_ppp: 101 | - file: 102 | - /var/log/ppp.log 103 | 104 | filter: 105 | - f_dbg: 106 | - level: =debug 107 | - f_info: 108 | - level: =info 109 | - f_notice: 110 | - level: =notice 111 | - f_warn: 112 | - level: =warn 113 | - f_err: 114 | - level: =err 115 | - f_crit: 116 | - level: =crit .. emerg 117 | - f_error: 118 | - level: =err .. emerg 119 | - f_console: 120 | - level: =warn .. emerg 121 | 122 | - f_debug: 123 | - =level(debug) and not facility(auth, authpriv, news, mail) 124 | - f_messages: 125 | - =level(info,notice,warn) and not facility(auth,authpriv,cron,daemon,mail,news) 126 | 127 | - f_auth: 128 | - =facility(auth, authpriv) and not filter(f_debug) 129 | - f_cron: 130 | - =facility(cron) and not filter(f_debug) 131 | - f_daemon: 132 | - =facility(daemon) and not filter(f_debug) 133 | - f_kern: 134 | - =facility(kern) and not filter(f_debug) 135 | - f_lpr: 136 | - =facility(lpr) and not filter(f_debug) 137 | - f_local: 138 | # yamllint disable-line rule:line-length 139 | - =facility(local0, local1, local3, local4, local5, local6, local7) and not filter(f_debug) 140 | - f_mail: 141 | - =facility(mail) and not filter(f_debug) 142 | - f_news: 143 | - =facility(news) and not filter(f_debug) 144 | - f_syslog3: 145 | - =not facility(auth, authpriv, mail) and not filter(f_debug) 146 | - f_user: 147 | - =facility(user) and not filter(f_debug) 148 | - f_uucp: 149 | - =facility(uucp) and not filter(f_debug) 150 | - f_cnews: 151 | - =level(notice, err, crit) and facility(news) 152 | - f_cother: 153 | - =level(debug, info, notice, warn) or facility(daemon, mail) 154 | - f_ppp: 155 | - =facility(local2) and not filter(f_debug) 156 | 157 | log: 158 | - 159 | - source: =s_src 160 | - filter: =f_auth 161 | - destination: =d_auth 162 | - 163 | - source: =s_src 164 | - filter: =f_cron 165 | - destination: =d_cron 166 | - 167 | - source: =s_src 168 | - filter: =f_daemon 169 | - destination: =d_daemon 170 | - 171 | - source: =s_src 172 | - filter: =f_kern 173 | - destination: =d_kern 174 | - 175 | - source: =s_src 176 | - filter: =f_lpr 177 | - destination: =d_lpr 178 | - 179 | - source: =s_src 180 | - filter: =f_syslog3 181 | - destination: =d_syslog 182 | - 183 | - source: =s_src 184 | - filter: =f_user 185 | - destination: =d_user 186 | - 187 | - source: =s_src 188 | - filter: =f_uucp 189 | - destination: =d_uucp 190 | - 191 | - source: =s_src 192 | - filter: =f_mail 193 | - destination: =d_mail 194 | - 195 | - source: =s_src 196 | - filter: =f_news 197 | - filter: =f_crit 198 | - destination: =d_newscrit 199 | - 200 | - source: =s_src 201 | - filter: =f_news 202 | - filter: =f_err 203 | - destination: =d_newserr 204 | - 205 | - source: =s_src 206 | - filter: =f_news 207 | - filter: =f_notice 208 | - destination: =d_newsnotice 209 | - 210 | - source: =s_src 211 | - filter: =f_debug 212 | - destination: =d_debug 213 | - 214 | - source: =s_src 215 | - filter: =f_error 216 | - destination: =d_error 217 | - 218 | - source: =s_src 219 | - filter: =f_messages 220 | - destination: =d_messages 221 | - 222 | - source: =s_src 223 | - filter: =f_console 224 | - destination: =d_console_all 225 | - destination: =d_xconsole 226 | - 227 | - source: =s_src 228 | - filter: =f_crit 229 | - destination: =d_console 230 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim: ft=yaml 3 | --- 4 | ################################################################################ 5 | # NOTE: This file is UNMAINTAINED; it is provided for references purposes only. 6 | # No guarantees are tendered that this structure will work after 2020. 7 | ################################################################################ 8 | # * https://en.wikipedia.org/wiki/Travis_CI: 9 | # - "... free open-source plans were removed in [sic] the end of 2020" 10 | # - https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing 11 | # - https://ropensci.org/technotes/2020/11/19/moving-away-travis/ 12 | ################################################################################ 13 | ## Machine config 14 | os: 'linux' 15 | arch: 'amd64' 16 | dist: 'bionic' 17 | version: '~> 1.0' 18 | 19 | ## Language and cache config 20 | language: 'ruby' 21 | cache: 'bundler' 22 | 23 | ## Services config 24 | services: 25 | - docker 26 | 27 | ## Script to run for the test stage 28 | script: 29 | - bin/kitchen verify "${INSTANCE}" 30 | 31 | ## Stages and jobs matrix 32 | stages: 33 | - test 34 | # # As part of the switch away from Travis CI, ensure that the `release` stage 35 | # # is not run inadvertently 36 | # - name: 'release' 37 | # if: 'branch = master AND type != pull_request' 38 | jobs: 39 | include: 40 | ## Define the test stage that runs the linters (and testing matrix, if applicable) 41 | 42 | # Run all of the linters in a single job 43 | - language: 'node_js' 44 | node_js: 'lts/*' 45 | env: 'Lint' 46 | name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint' 47 | before_install: 'skip' 48 | script: 49 | # Install and run `salt-lint` 50 | - pip install --user salt-lint 51 | - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst' 52 | | xargs salt-lint 53 | # Install and run `yamllint` 54 | # Need at least `v1.17.0` for the `yaml-files` setting 55 | - pip install --user yamllint>=1.17.0 56 | - yamllint -s . 57 | # Install and run `rubocop` 58 | - gem install rubocop 59 | - rubocop -d 60 | # Run `shellcheck` (already pre-installed in Travis) 61 | - shellcheck --version 62 | - git ls-files -- '*.sh' '*.bash' '*.ksh' 63 | | xargs shellcheck 64 | # Install and run `commitlint` 65 | - npm i -D @commitlint/config-conventional 66 | @commitlint/travis-cli 67 | - commitlint-travis 68 | 69 | # Run `pre-commit` linters in a single job 70 | - language: 'python' 71 | env: 'Lint_pre-commit' 72 | name: 'Lint: pre-commit' 73 | before_install: 'skip' 74 | cache: 75 | directories: 76 | - $HOME/.cache/pre-commit 77 | script: 78 | # Install and run `pre-commit` 79 | - pip install pre-commit==2.7.1 80 | - pre-commit run --all-files --color always --verbose 81 | - pre-commit run --color always --hook-stage manual --verbose commitlint-travis 82 | 83 | ## Define the rest of the matrix based on Kitchen testing 84 | # Make sure the instances listed below match up with 85 | # the `platforms` defined in `kitchen.yml` 86 | # - env: INSTANCE=default-debian-11-tiamat-py3 87 | # - env: INSTANCE=default-debian-10-tiamat-py3 88 | # - env: INSTANCE=default-debian-9-tiamat-py3 89 | # - env: INSTANCE=default-ubuntu-2204-tiamat-py3 90 | # - env: INSTANCE=default-ubuntu-2004-tiamat-py3 91 | # - env: INSTANCE=default-ubuntu-1804-tiamat-py3 92 | # - env: INSTANCE=default-centos-stream8-tiamat-py3 93 | # - env: INSTANCE=default-centos-7-tiamat-py3 94 | # - env: INSTANCE=default-amazonlinux-2-tiamat-py3 95 | # - env: INSTANCE=default-oraclelinux-8-tiamat-py3 96 | # - env: INSTANCE=default-oraclelinux-7-tiamat-py3 97 | # - env: INSTANCE=default-almalinux-8-tiamat-py3 98 | # - env: INSTANCE=default-rockylinux-8-tiamat-py3 99 | - env: INSTANCE=default-debian-11-master-py3 100 | - env: INSTANCE=default-debian-10-master-py3 101 | - env: INSTANCE=default-debian-9-master-py3 102 | - env: INSTANCE=default-ubuntu-2204-master-py3 103 | - env: INSTANCE=default-ubuntu-2004-master-py3 104 | - env: INSTANCE=default-ubuntu-1804-master-py3 105 | - env: INSTANCE=default-centos-stream8-master-py3 106 | - env: INSTANCE=default-centos-7-master-py3 107 | - env: INSTANCE=default-fedora-36-master-py3 108 | - env: INSTANCE=default-fedora-35-master-py3 109 | - env: INSTANCE=default-opensuse-leap-153-master-py3 110 | - env: INSTANCE=default-opensuse-tmbl-latest-master-py3 111 | - env: INSTANCE=default-amazonlinux-2-master-py3 112 | - env: INSTANCE=default-oraclelinux-8-master-py3 113 | - env: INSTANCE=default-oraclelinux-7-master-py3 114 | - env: INSTANCE=default-arch-base-latest-master-py3 115 | - env: INSTANCE=default-gentoo-stage3-latest-master-py3 116 | - env: INSTANCE=default-gentoo-stage3-systemd-master-py3 117 | - env: INSTANCE=default-almalinux-8-master-py3 118 | - env: INSTANCE=default-rockylinux-8-master-py3 119 | # - env: INSTANCE=default-debian-11-3004-1-py3 120 | # - env: INSTANCE=default-debian-10-3004-1-py3 121 | # - env: INSTANCE=default-debian-9-3004-1-py3 122 | # - env: INSTANCE=default-ubuntu-2204-3004-1-py3 123 | # - env: INSTANCE=default-ubuntu-2004-3004-1-py3 124 | # - env: INSTANCE=default-ubuntu-1804-3004-1-py3 125 | # - env: INSTANCE=default-centos-stream8-3004-1-py3 126 | # - env: INSTANCE=default-centos-7-3004-1-py3 127 | # - env: INSTANCE=default-fedora-36-3004-1-py3 128 | # - env: INSTANCE=default-fedora-35-3004-1-py3 129 | # - env: INSTANCE=default-amazonlinux-2-3004-1-py3 130 | # - env: INSTANCE=default-oraclelinux-8-3004-1-py3 131 | # - env: INSTANCE=default-oraclelinux-7-3004-1-py3 132 | # - env: INSTANCE=default-arch-base-latest-3004-1-py3 133 | # - env: INSTANCE=default-gentoo-stage3-latest-3004-1-py3 134 | # - env: INSTANCE=default-gentoo-stage3-systemd-3004-1-py3 135 | # - env: INSTANCE=default-almalinux-8-3004-1-py3 136 | # - env: INSTANCE=default-rockylinux-8-3004-1-py3 137 | # - env: INSTANCE=default-opensuse-leap-153-3004-0-py3 138 | # - env: INSTANCE=default-opensuse-tmbl-latest-3004-0-py3 139 | # - env: INSTANCE=default-debian-10-3003-4-py3 140 | # - env: INSTANCE=default-debian-9-3003-4-py3 141 | # - env: INSTANCE=default-ubuntu-2004-3003-4-py3 142 | # - env: INSTANCE=default-ubuntu-1804-3003-4-py3 143 | # - env: INSTANCE=default-centos-stream8-3003-4-py3 144 | # - env: INSTANCE=default-centos-7-3003-4-py3 145 | # - env: INSTANCE=default-amazonlinux-2-3003-4-py3 146 | # - env: INSTANCE=default-oraclelinux-8-3003-4-py3 147 | # - env: INSTANCE=default-oraclelinux-7-3003-4-py3 148 | # - env: INSTANCE=default-almalinux-8-3003-4-py3 149 | 150 | ## Define the release stage that runs `semantic-release` 151 | - stage: 'release' 152 | language: 'node_js' 153 | node_js: 'lts/*' 154 | env: 'Release' 155 | name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' 156 | before_install: 'skip' 157 | script: 158 | # Update `AUTHORS.md` 159 | - export MAINTAINER_TOKEN=${GH_TOKEN} 160 | - go get github.com/myii/maintainer 161 | - maintainer contributor 162 | 163 | # Install all dependencies required for `semantic-release` 164 | - npm i -D @semantic-release/changelog@3 165 | @semantic-release/exec@3 166 | @semantic-release/git@7 167 | deploy: 168 | provider: 'script' 169 | # Opt-in to `dpl v2` to complete the Travis build config validation (beta) 170 | # * https://docs.travis-ci.com/user/build-config-validation 171 | # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default 172 | edge: true 173 | # Run `semantic-release` 174 | script: 'npx semantic-release@15.14' 175 | 176 | # Notification options: `always`, `never` or `change` 177 | notifications: 178 | webhooks: 179 | if: 'repo = saltstack-formulas/syslog-ng-formula' 180 | urls: 181 | - https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=saltstack-formulas%2Fsyslog-ng-formula&ignore_pull_requests=true 182 | on_success: always # default: always 183 | on_failure: always # default: always 184 | on_start: always # default: never 185 | on_cancel: always # default: always 186 | on_error: always # default: always 187 | -------------------------------------------------------------------------------- /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: syslog_ng 17 | salt_copy_filter: 18 | - .kitchen 19 | - .git 20 | pillars_from_directories: 21 | - test/salt/pillar 22 | 23 | transport: 24 | # Avoid lengthy waits when a container does not launch correctly 25 | max_wait_until_ready: 60 26 | 27 | platforms: 28 | ## SALT `master` 29 | - name: debian-12-master 30 | driver: 31 | image: saltimages/salt-master-py3:debian-12 32 | run_command: /lib/systemd/systemd 33 | - name: debian-11-master 34 | driver: 35 | image: saltimages/salt-master-py3:debian-11 36 | run_command: /lib/systemd/systemd 37 | - name: ubuntu-2404-master 38 | driver: 39 | image: saltimages/salt-master-py3:ubuntu-24.04 40 | run_command: /lib/systemd/systemd 41 | - name: ubuntu-2204-master 42 | driver: 43 | image: saltimages/salt-master-py3:ubuntu-22.04 44 | run_command: /lib/systemd/systemd 45 | - name: ubuntu-2004-master 46 | driver: 47 | image: saltimages/salt-master-py3:ubuntu-20.04 48 | run_command: /lib/systemd/systemd 49 | - name: centos-stream9-master 50 | driver: 51 | image: saltimages/salt-master-py3:centos-stream9 52 | - name: opensuse-leap-156-master 53 | driver: 54 | image: saltimages/salt-master-py3:opensuse-leap-15.6 55 | # Workaround to avoid intermittent failures on `opensuse-leap-15.6`: 56 | # => SCP did not finish successfully (255): (Net::SCP::Error) 57 | transport: 58 | max_ssh_sessions: 1 59 | - name: opensuse-tmbl-latest-master 60 | driver: 61 | image: saltimages/salt-master-py3:opensuse-tumbleweed-latest 62 | # Workaround to avoid intermittent failures on `opensuse-tumbleweed`: 63 | # => SCP did not finish successfully (255): (Net::SCP::Error) 64 | transport: 65 | max_ssh_sessions: 1 66 | - name: fedora-41-master 67 | driver: 68 | image: saltimages/salt-master-py3:fedora-41 69 | - name: fedora-40-master 70 | driver: 71 | image: saltimages/salt-master-py3:fedora-40 72 | - name: amazonlinux-2023-master 73 | driver: 74 | image: saltimages/salt-master-py3:amazonlinux-2023 75 | - name: oraclelinux-9-master 76 | driver: 77 | image: saltimages/salt-master-py3:oraclelinux-9 78 | - name: oraclelinux-8-master 79 | driver: 80 | image: saltimages/salt-master-py3:oraclelinux-8 81 | - name: almalinux-9-master 82 | driver: 83 | image: saltimages/salt-master-py3:almalinux-9 84 | - name: almalinux-8-master 85 | driver: 86 | image: saltimages/salt-master-py3:almalinux-8 87 | - name: rockylinux-9-master 88 | driver: 89 | image: saltimages/salt-master-py3:rockylinux-9 90 | - name: rockylinux-8-master 91 | driver: 92 | image: saltimages/salt-master-py3:rockylinux-8 93 | 94 | ## SALT `3007.7` 95 | - name: debian-12-3007-7 96 | driver: 97 | image: saltimages/salt-3007.7-py3:debian-12 98 | run_command: /lib/systemd/systemd 99 | - name: debian-11-3007-7 100 | driver: 101 | image: saltimages/salt-3007.7-py3:debian-11 102 | run_command: /lib/systemd/systemd 103 | - name: ubuntu-2404-3007-7 104 | driver: 105 | image: saltimages/salt-3007.7-py3:ubuntu-24.04 106 | run_command: /lib/systemd/systemd 107 | - name: ubuntu-2204-3007-7 108 | driver: 109 | image: saltimages/salt-3007.7-py3:ubuntu-22.04 110 | run_command: /lib/systemd/systemd 111 | - name: ubuntu-2004-3007-7 112 | driver: 113 | image: saltimages/salt-3007.7-py3:ubuntu-20.04 114 | run_command: /lib/systemd/systemd 115 | - name: centos-stream9-3007-7 116 | driver: 117 | image: saltimages/salt-3007.7-py3:centos-stream9 118 | - name: opensuse-leap-156-3007-7 119 | driver: 120 | image: saltimages/salt-3007.7-py3:opensuse-leap-15.6 121 | # Workaround to avoid intermittent failures on `opensuse-leap-15.6`: 122 | # => SCP did not finish successfully (255): (Net::SCP::Error) 123 | transport: 124 | max_ssh_sessions: 1 125 | - name: opensuse-tmbl-latest-3007-7 126 | driver: 127 | image: saltimages/salt-3007.7-py3:opensuse-tumbleweed-latest 128 | # Workaround to avoid intermittent failures on `opensuse-tumbleweed`: 129 | # => SCP did not finish successfully (255): (Net::SCP::Error) 130 | transport: 131 | max_ssh_sessions: 1 132 | - name: fedora-41-3007-7 133 | driver: 134 | image: saltimages/salt-3007.7-py3:fedora-41 135 | - name: fedora-40-3007-7 136 | driver: 137 | image: saltimages/salt-3007.7-py3:fedora-40 138 | - name: amazonlinux-2023-3007-7 139 | driver: 140 | image: saltimages/salt-3007.7-py3:amazonlinux-2023 141 | - name: amazonlinux-2-3007-7 142 | driver: 143 | image: saltimages/salt-3007.7-py3:amazonlinux-2 144 | - name: oraclelinux-9-3007-7 145 | driver: 146 | image: saltimages/salt-3007.7-py3:oraclelinux-9 147 | - name: oraclelinux-8-3007-7 148 | driver: 149 | image: saltimages/salt-3007.7-py3:oraclelinux-8 150 | - name: almalinux-9-3007-7 151 | driver: 152 | image: saltimages/salt-3007.7-py3:almalinux-9 153 | - name: almalinux-8-3007-7 154 | driver: 155 | image: saltimages/salt-3007.7-py3:almalinux-8 156 | - name: rockylinux-9-3007-7 157 | driver: 158 | image: saltimages/salt-3007.7-py3:rockylinux-9 159 | - name: rockylinux-8-3007-7 160 | driver: 161 | image: saltimages/salt-3007.7-py3:rockylinux-8 162 | 163 | ## SALT `3006.15` 164 | - name: debian-12-3006-15 165 | driver: 166 | image: saltimages/salt-3006.15-py3:debian-12 167 | run_command: /lib/systemd/systemd 168 | - name: debian-11-3006-15 169 | driver: 170 | image: saltimages/salt-3006.15-py3:debian-11 171 | run_command: /lib/systemd/systemd 172 | - name: ubuntu-2404-3006-15 173 | driver: 174 | image: saltimages/salt-3006.15-py3:ubuntu-24.04 175 | run_command: /lib/systemd/systemd 176 | - name: ubuntu-2204-3006-15 177 | driver: 178 | image: saltimages/salt-3006.15-py3:ubuntu-22.04 179 | run_command: /lib/systemd/systemd 180 | - name: ubuntu-2004-3006-15 181 | driver: 182 | image: saltimages/salt-3006.15-py3:ubuntu-20.04 183 | run_command: /lib/systemd/systemd 184 | - name: centos-stream9-3006-15 185 | driver: 186 | image: saltimages/salt-3006.15-py3:centos-stream9 187 | - name: opensuse-tmbl-latest-3006-15 188 | driver: 189 | image: saltimages/salt-3006.15-py3:opensuse-tumbleweed-latest 190 | # Workaround to avoid intermittent failures on `opensuse-tumbleweed`: 191 | # => SCP did not finish successfully (255): (Net::SCP::Error) 192 | transport: 193 | max_ssh_sessions: 1 194 | - name: opensuse-leap-156-3006-15 195 | driver: 196 | image: saltimages/salt-3006.15-py3:opensuse-leap-15.6 197 | # Workaround to avoid intermittent failures on `opensuse-leap-15.6`: 198 | # => SCP did not finish successfully (255): (Net::SCP::Error) 199 | transport: 200 | max_ssh_sessions: 1 201 | - name: fedora-41-3006-15 202 | driver: 203 | image: saltimages/salt-3006.15-py3:fedora-41 204 | - name: fedora-40-3006-15 205 | driver: 206 | image: saltimages/salt-3006.15-py3:fedora-40 207 | - name: amazonlinux-2023-3006-15 208 | driver: 209 | image: saltimages/salt-3006.15-py3:amazonlinux-2023 210 | - name: amazonlinux-2-3006-15 211 | driver: 212 | image: saltimages/salt-3006.15-py3:amazonlinux-2 213 | - name: oraclelinux-9-3006-15 214 | driver: 215 | image: saltimages/salt-3006.15-py3:oraclelinux-9 216 | - name: oraclelinux-8-3006-15 217 | driver: 218 | image: saltimages/salt-3006.15-py3:oraclelinux-8 219 | - name: almalinux-9-3006-15 220 | driver: 221 | image: saltimages/salt-3006.15-py3:almalinux-9 222 | - name: almalinux-8-3006-15 223 | driver: 224 | image: saltimages/salt-3006.15-py3:almalinux-8 225 | - name: rockylinux-9-3006-15 226 | driver: 227 | image: saltimages/salt-3006.15-py3:rockylinux-9 228 | - name: rockylinux-8-3006-15 229 | driver: 230 | image: saltimages/salt-3006.15-py3:rockylinux-8 231 | 232 | ########################################################## 233 | # This file is managed as part of a Copier template. # 234 | # Please make your own changes below this comment. # 235 | ########################################################## 236 | 237 | verifier: 238 | # https://www.inspec.io/ 239 | name: inspec 240 | sudo: true 241 | reporter: 242 | # cli, documentation, html, progress, json, json-min, json-rspec, junit 243 | - cli 244 | 245 | suites: 246 | - name: default 247 | provisioner: 248 | state_top: 249 | base: 250 | '*': 251 | - syslog_ng._mapdata 252 | - syslog_ng 253 | pillars: 254 | top.sls: 255 | base: 256 | '*': 257 | - syslog_ng 258 | verifier: 259 | inspec_tests: 260 | - path: test/integration/default 261 | -------------------------------------------------------------------------------- /.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/syslog-ng-formula' 11 | # `stage` 12 | stage_cache: &stage_cache 'cache' 13 | stage_lint: &stage_lint 'lint' 14 | stage_release: &stage_release 'release' 15 | stage_test: &stage_test 'test' 16 | # `image` 17 | # yamllint disable rule:line-length 18 | image_commitlint: &image_commitlint 'techneg/ci-commitlint:v1.1.103@sha256:3a2bf514e461769ed7b8880213e9637186bb7e17e0653b4a6ad3f249e4a60d33' 19 | image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.72@sha256:20873e73badc9d5ea93e20ef745f64fe957625a755a60c91e3dad600217e2c76' 20 | image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.72@sha256:20873e73badc9d5ea93e20ef745f64fe957625a755a60c91e3dad600217e2c76' 21 | image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.5.5@sha256:9d92b83a64378da3f9363668b0da244d9f12039d86579881d649ddb40ce261f3' 22 | image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest@sha256:fe69f9642c7edde46bbd78326d2c42c6e13fc73694efb142e92e206725479328' 23 | image_semantic-release: &image_semanticrelease 'techneg/ci-semantic-release:v1.2.4@sha256:e7cfe36054a56382568c0824d2539a67a956711d7b674093db320815e928ee27' 24 | # `services` 25 | services_docker_dind: &services_docker_dind 26 | - 'docker:28.3.3-dind@sha256:a56b3bdde89315ed2cc0e4906e582b5033d93bf20d9cb9510c2cdd4e7f7690b1' 27 | # yamllint enable rule:line-length 28 | # `variables` 29 | # https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3 30 | # https://bundler.io/v2.3/man/bundle-config.1.html 31 | variables_bundler: &variables_bundler 32 | BUNDLE_PATH: '${CI_PROJECT_DIR}/.cache/bundler' 33 | BUNDLE_DEPLOYMENT: 'true' 34 | bundle_install: &bundle_install 35 | - 'bundle version' 36 | - 'bundle config list' 37 | # `--no-cache` means don't bother caching the downloaded .gem files 38 | - 'time bundle install --no-cache' 39 | cache_bundler: &cache_bundler 40 | key: 41 | files: 42 | - 'Gemfile.lock' 43 | prefix: 'bundler' 44 | paths: 45 | - '${BUNDLE_PATH}' 46 | # https://pre-commit.com/#gitlab-ci-example 47 | variables_pre-commit: &variables_pre-commit 48 | PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit' 49 | cache_pre-commit: &cache_pre-commit 50 | key: 51 | files: 52 | - '.pre-commit-config.yaml' 53 | prefix: 'pre-commit' 54 | paths: 55 | - '${PRE_COMMIT_HOME}' 56 | 57 | ############################################################################### 58 | # Define stages and global variables 59 | ############################################################################### 60 | stages: 61 | - *stage_cache 62 | - *stage_lint 63 | - *stage_test 64 | - *stage_release 65 | variables: 66 | DOCKER_DRIVER: 'overlay2' 67 | 68 | 69 | ############################################################################### 70 | # `cache` stage: build up the bundler cache required before the `test` stage 71 | ############################################################################### 72 | build-cache: 73 | stage: *stage_cache 74 | image: *image_dindruby 75 | variables: *variables_bundler 76 | cache: *cache_bundler 77 | script: *bundle_install 78 | 79 | ############################################################################### 80 | # `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed) 81 | ############################################################################### 82 | .lint_job: 83 | stage: *stage_lint 84 | needs: [] 85 | 86 | commitlint: 87 | extends: '.lint_job' 88 | image: *image_commitlint 89 | script: 90 | # Add `upstream` remote to get access to `upstream/master` 91 | - 'git remote add upstream 92 | https://gitlab.com/saltstack-formulas/syslog-ng-formula.git' 93 | - 'git fetch --all' 94 | # Set default commit hashes for `--from` and `--to` 95 | - 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"' 96 | - 'export COMMITLINT_TO="${CI_COMMIT_SHA}"' 97 | # Run `commitlint` 98 | - 'commitlint --from "${COMMITLINT_FROM}" 99 | --to "${COMMITLINT_TO}" 100 | --verbose' 101 | 102 | pre-commit: 103 | extends: '.lint_job' 104 | image: *image_precommit 105 | # https://pre-commit.com/#gitlab-ci-example 106 | variables: *variables_pre-commit 107 | cache: *cache_pre-commit 108 | script: 109 | - 'pre-commit run --all-files --color always --verbose' 110 | - 'pre-commit run --color always --hook-stage manual commitlint-ci' 111 | 112 | # Use a separate job for `rubocop` other than the one potentially run by `pre-commit` 113 | # - The `pre-commit` check will only be available for formulas that pass the default 114 | # `rubocop` check -- and must continue to do so 115 | # - This job is allowed to fail, so can be used for all formulas 116 | # - Furthermore, this job uses all of the latest `rubocop` features & cops, 117 | # which will help when upgrading the `rubocop` linter used in `pre-commit` 118 | rubocop: 119 | extends: '.lint_job' 120 | allow_failure: true 121 | image: *image_rubocop 122 | script: 123 | - 'rubocop -d -P -S --enable-pending-cops' 124 | 125 | ############################################################################### 126 | # Define `test` template 127 | ############################################################################### 128 | .test_instance: &test_instance 129 | stage: *stage_test 130 | image: *image_dindruby 131 | services: *services_docker_dind 132 | variables: *variables_bundler 133 | cache: 134 | <<: *cache_bundler 135 | policy: 'pull' 136 | before_script: *bundle_install 137 | script: 138 | # Alternative value to consider: `${CI_JOB_NAME}` 139 | - 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"' 140 | 141 | ############################################################################### 142 | # Define `test` template (`allow_failure: true`) 143 | ############################################################################### 144 | .test_instance_failure_permitted: 145 | <<: *test_instance 146 | allow_failure: true 147 | 148 | ############################################################################### 149 | # `test` stage: each instance below uses the `test` template above 150 | ############################################################################### 151 | ## Define the rest of the matrix based on Kitchen testing 152 | # Make sure the instances listed below match up with 153 | # the `platforms` defined in `kitchen.yml` 154 | # yamllint disable rule:line-length 155 | # Fedora 41+ will permit failure until this PR is merged into kitchen-docker 156 | # https://github.com/test-kitchen/kitchen-docker/pull/427 is merged 157 | # OpenSUSE master branch will fail until zypperpkg module is back in salt core 158 | # https://github.com/saltstack/great-module-migration/issues/14 159 | # 160 | almalinux-9-master: {extends: '.test_instance_failure_permitted'} 161 | almalinux-8-master: {extends: '.test_instance_failure_permitted'} 162 | amazonlinux-2023-master: {extends: '.test_instance_failure_permitted'} 163 | amazonlinux-2-master: {extends: '.test_instance_failure_permitted'} 164 | centos-stream9-master: {extends: '.test_instance_failure_permitted'} 165 | debian-12-master: {extends: '.test_instance_failure_permitted'} 166 | debian-11-master: {extends: '.test_instance_failure_permitted'} 167 | fedora-41-master: {extends: '.test_instance_failure_permitted'} 168 | fedora-40-master: {extends: '.test_instance_failure_permitted'} 169 | opensuse-leap-156-master: {extends: '.test_instance_failure_permitted'} 170 | opensuse-tmbl-latest-master: {extends: '.test_instance_failure_permitted'} 171 | oraclelinux-9-master: {extends: '.test_instance_failure_permitted'} 172 | oraclelinux-8-master: {extends: '.test_instance_failure_permitted'} 173 | rockylinux-9-master: {extends: '.test_instance_failure_permitted'} 174 | rockylinux-8-master: {extends: '.test_instance_failure_permitted'} 175 | ubuntu-2404-master: {extends: '.test_instance_failure_permitted'} 176 | ubuntu-2204-master: {extends: '.test_instance_failure_permitted'} 177 | ubuntu-2004-master: {extends: '.test_instance_failure_permitted'} 178 | almalinux-9-3007-7: {extends: '.test_instance_failure_permitted'} 179 | almalinux-8-3007-7: {extends: '.test_instance_failure_permitted'} 180 | amazonlinux-2023-3007-7: {extends: '.test_instance_failure_permitted'} 181 | amazonlinux-2-3007-7: {extends: '.test_instance_failure_permitted'} 182 | centos-stream9-3007-7: {extends: '.test_instance_failure_permitted'} 183 | debian-12-3007-7: {extends: '.test_instance'} 184 | debian-11-3007-7: {extends: '.test_instance'} 185 | fedora-41-3007-7: {extends: '.test_instance_failure_permitted'} 186 | fedora-40-3007-7: {extends: '.test_instance'} 187 | opensuse-leap-156-3007-7: {extends: '.test_instance'} 188 | opensuse-tmbl-latest-3007-7: {extends: '.test_instance'} 189 | oraclelinux-9-3007-7: {extends: '.test_instance_failure_permitted'} 190 | oraclelinux-8-3007-7: {extends: '.test_instance_failure_permitted'} 191 | rockylinux-9-3007-7: {extends: '.test_instance_failure_permitted'} 192 | rockylinux-8-3007-7: {extends: '.test_instance_failure_permitted'} 193 | ubuntu-2404-3007-7: {extends: '.test_instance'} 194 | ubuntu-2204-3007-7: {extends: '.test_instance'} 195 | ubuntu-2004-3007-7: {extends: '.test_instance'} 196 | almalinux-9-3006-15: {extends: '.test_instance_failure_permitted'} 197 | almalinux-8-3006-15: {extends: '.test_instance_failure_permitted'} 198 | amazonlinux-2023-3006-15: {extends: '.test_instance_failure_permitted'} 199 | amazonlinux-2-3006-15: {extends: '.test_instance_failure_permitted'} 200 | centos-stream9-3006-15: {extends: '.test_instance_failure_permitted'} 201 | debian-12-3006-15: {extends: '.test_instance'} 202 | debian-11-3006-15: {extends: '.test_instance'} 203 | fedora-41-3006-15: {extends: '.test_instance_failure_permitted'} 204 | fedora-40-3006-15: {extends: '.test_instance'} 205 | opensuse-leap-156-3006-15: {extends: '.test_instance'} 206 | opensuse-tmbl-latest-3006-15: {extends: '.test_instance'} 207 | oraclelinux-9-3006-15: {extends: '.test_instance_failure_permitted'} 208 | oraclelinux-8-3006-15: {extends: '.test_instance_failure_permitted'} 209 | rockylinux-9-3006-15: {extends: '.test_instance_failure_permitted'} 210 | rockylinux-8-3006-15: {extends: '.test_instance_failure_permitted'} 211 | ubuntu-2404-3006-15: {extends: '.test_instance'} 212 | ubuntu-2204-3006-15: {extends: '.test_instance'} 213 | ubuntu-2004-3006-15: {extends: '.test_instance'} 214 | # yamllint enable rule:line-length 215 | 216 | ############################################################################### 217 | # `release` stage: `semantic-release` 218 | ############################################################################### 219 | semantic-release: 220 | stage: *stage_release 221 | image: *image_semanticrelease 222 | variables: 223 | MAINTAINER_TOKEN: '${GH_TOKEN}' 224 | script: 225 | # Run `semantic-release` 226 | - 'semantic-release' 227 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [0.6.1](https://github.com/saltstack-formulas/syslog-ng-formula/compare/v0.6.0...v0.6.1) (2025-09-04) 4 | 5 | 6 | ### Bug Fixes 7 | 8 | * **osfingermap.yaml:** set syslog-ng version for Debian Trixie ([45a3620](https://github.com/saltstack-formulas/syslog-ng-formula/commit/45a36204789baca3e6825b4f03babd82c073fa10)) 9 | 10 | # [0.6.0](https://github.com/saltstack-formulas/syslog-ng-formula/compare/v0.5.1...v0.6.0) (2025-06-16) 11 | 12 | 13 | ### Bug Fixes 14 | 15 | * **osfingermap.yaml:** set syslog-ng version for Debian Bookworm ([0988aba](https://github.com/saltstack-formulas/syslog-ng-formula/commit/0988abac33e3c6f90ea3108734c6403af97e0a95)) 16 | * **osfingermap.yaml:** set syslog-ng version for Debian Bullseye ([d9ef31a](https://github.com/saltstack-formulas/syslog-ng-formula/commit/d9ef31aa43a905dd778a760f85faec9b7f1423a9)) 17 | 18 | 19 | ### Continuous Integration 20 | 21 | * update `pre-commit` configuration inc. for pre-commit.ci [skip ci] ([c4adb02](https://github.com/saltstack-formulas/syslog-ng-formula/commit/c4adb02f9bf976549f475810b4005738635de9b3)) 22 | * update linters to latest versions [skip ci] ([2618873](https://github.com/saltstack-formulas/syslog-ng-formula/commit/2618873180addd537910ef342d0473a77a8fbc78)) 23 | * use latest test images ([d9514b0](https://github.com/saltstack-formulas/syslog-ng-formula/commit/d9514b0ce53465dd43daf08857e2cb109e368e79)) 24 | * **3003.1:** update inc. AlmaLinux, Rocky & `rst-lint` [skip ci] ([affc7fd](https://github.com/saltstack-formulas/syslog-ng-formula/commit/affc7fd0653ef63fa6b187aa3ca529f4c1926e4b)) 25 | * **commitlint:** ensure `upstream/master` uses main repo URL [skip ci] ([d5e555a](https://github.com/saltstack-formulas/syslog-ng-formula/commit/d5e555af6a0612d46ba30d510c25b1e26c0a5cf1)) 26 | * **gemfile:** allow rubygems proxy to be provided as an env var [skip ci] ([ad7d546](https://github.com/saltstack-formulas/syslog-ng-formula/commit/ad7d546bc07d1b32aa35e692dbc81ae19b863580)) 27 | * **gemfile+lock:** use `ssf` customised `inspec` repo [skip ci] ([4a16d6b](https://github.com/saltstack-formulas/syslog-ng-formula/commit/4a16d6b4ad48f4e108d286c02e7b316b4245e75c)) 28 | * **gemfile+lock:** use `ssf` customised `kitchen-docker` repo [skip ci] ([464135e](https://github.com/saltstack-formulas/syslog-ng-formula/commit/464135e991f26daf59f6d7cfd11c7ec6632f5b44)) 29 | * **gitlab-ci:** add `rubocop` linter (with `allow_failure`) [skip ci] ([c4bbce7](https://github.com/saltstack-formulas/syslog-ng-formula/commit/c4bbce71a42f22dee5fcb48ba65eec4b946cd94f)) 30 | * **gitlab-ci:** use GitLab CI as Travis CI replacement ([a09511d](https://github.com/saltstack-formulas/syslog-ng-formula/commit/a09511dd1e892a6d5a4069c67f0b3be053c8685f)) 31 | * **kitchen:** move `provisioner` block & update `run_command` [skip ci] ([c5c6142](https://github.com/saltstack-formulas/syslog-ng-formula/commit/c5c6142dff511ce1a87ec5bfd0a3f11f222fc2fc)) 32 | * **kitchen+ci:** update with `3004` pre-salted images/boxes [skip ci] ([edf5b9c](https://github.com/saltstack-formulas/syslog-ng-formula/commit/edf5b9c1dc518d50b3fc33a3136404f3fa0a46ef)) 33 | * **kitchen+ci:** update with latest `3003.2` pre-salted images [skip ci] ([8fc2589](https://github.com/saltstack-formulas/syslog-ng-formula/commit/8fc2589607fda2adf9bc9957f1c905767d73ef63)) 34 | * **kitchen+ci:** update with latest CVE pre-salted images [skip ci] ([72b19f3](https://github.com/saltstack-formulas/syslog-ng-formula/commit/72b19f39a949fd2fbb86cef903f3a6b387e98311)) 35 | * **kitchen+ci:** use latest pre-salted images (after CVE) [skip ci] ([a7dfcd4](https://github.com/saltstack-formulas/syslog-ng-formula/commit/a7dfcd43cc72c042516d8b0522d6900097961dbe)) 36 | * **kitchen+gitlab:** adjust matrix to add `3003` [skip ci] ([7ced1a7](https://github.com/saltstack-formulas/syslog-ng-formula/commit/7ced1a7684988e9a677951caa7e3edb9c0fcf58c)) 37 | * **kitchen+gitlab:** remove Ubuntu 16.04 & Fedora 32 (EOL) [skip ci] ([c2a64a5](https://github.com/saltstack-formulas/syslog-ng-formula/commit/c2a64a534ffdb00650016a66032615e27d90957c)) 38 | * **kitchen+gitlab:** update for new pre-salted images [skip ci] ([85ed779](https://github.com/saltstack-formulas/syslog-ng-formula/commit/85ed779e94b9882e070cedb27beadca907116603)) 39 | * **kitchen+gitlab:** update for new pre-salted images [skip ci] ([2a2dc5f](https://github.com/saltstack-formulas/syslog-ng-formula/commit/2a2dc5f3e50ea71678f73eb59f2d35ccad736a1c)) 40 | * add `arch-master` to matrix and update `.travis.yml` [skip ci] ([6869801](https://github.com/saltstack-formulas/syslog-ng-formula/commit/68698019fcd827784342f6aa4b0d5d49ccb4b64a)) 41 | * add Debian 11 Bullseye & update `yamllint` configuration [skip ci] ([99f2272](https://github.com/saltstack-formulas/syslog-ng-formula/commit/99f2272a7d75b2e8211ad59836c8393e716beaa0)) 42 | * **kitchen+gitlab-ci:** use latest pre-salted images [skip ci] ([f1c7151](https://github.com/saltstack-formulas/syslog-ng-formula/commit/f1c71513d12b73d3877b412f4c5e7d347089bf46)) 43 | * **pre-commit:** add to formula [skip ci] ([ffe3845](https://github.com/saltstack-formulas/syslog-ng-formula/commit/ffe3845746f21cb6c73709699c66a2df946b7d2c)) 44 | * **pre-commit:** enable/disable `rstcheck` as relevant [skip ci] ([1d77079](https://github.com/saltstack-formulas/syslog-ng-formula/commit/1d77079272dff8ddd1be1f555791c08b3ace8e49)) 45 | * **pre-commit:** finalise `rstcheck` configuration [skip ci] ([6c09627](https://github.com/saltstack-formulas/syslog-ng-formula/commit/6c09627324dca8cd3b911be9135746b11fee3764)) 46 | * **pre-commit:** update hook for `rubocop` [skip ci] ([8f11ae5](https://github.com/saltstack-formulas/syslog-ng-formula/commit/8f11ae5e5b81ef1b7e9e82244514084978831926)) 47 | 48 | 49 | ### Documentation 50 | 51 | * **readme:** fix headings [skip ci] ([99b4c29](https://github.com/saltstack-formulas/syslog-ng-formula/commit/99b4c293f807bfeb509902c327743fe85a807b42)) 52 | 53 | 54 | ### Features 55 | 56 | * **FreeBSD:** add support ([653201f](https://github.com/saltstack-formulas/syslog-ng-formula/commit/653201f788c40f8c149b0416380e9ba372cac9c5)) 57 | * **osfamilymap:** add support for Gentoo ([e39ec5e](https://github.com/saltstack-formulas/syslog-ng-formula/commit/e39ec5e0abd392c8dcf2361e74383ee52662d889)) 58 | 59 | 60 | ### Tests 61 | 62 | * **rubocop:** fix all violations ([afe8620](https://github.com/saltstack-formulas/syslog-ng-formula/commit/afe8620a55899bb0a713529c343e81580a4dba22)) 63 | * **system:** add `build_platform_codename` [skip ci] ([6450505](https://github.com/saltstack-formulas/syslog-ng-formula/commit/645050597f198cba7f68788798e2c47dfd995a19)) 64 | * **system.rb:** add support for `mac_os_x` [skip ci] ([d098cb6](https://github.com/saltstack-formulas/syslog-ng-formula/commit/d098cb6d4cec64e22a74dc9f8680365d2bb769e3)) 65 | * standardise use of `share` suite & `_mapdata` state [skip ci] ([9e67b07](https://github.com/saltstack-formulas/syslog-ng-formula/commit/9e67b07cabfd5ee785fc9cf3cdb74bc7c239326d)) 66 | 67 | ## [0.5.1](https://github.com/saltstack-formulas/syslog-ng-formula/compare/v0.5.0...v0.5.1) (2020-09-09) 68 | 69 | 70 | ### Bug Fixes 71 | 72 | * **libtofs:** “files_switch” mess up the variable exported by “map.jinja” [skip ci] ([e9c5153](https://github.com/saltstack-formulas/syslog-ng-formula/commit/e9c515371b39015d3606e9668663c207d6758f9e)) 73 | * **release.config.js:** use full commit hash in commit link [skip ci] ([4d6851d](https://github.com/saltstack-formulas/syslog-ng-formula/commit/4d6851dd78c532a012cb3fd983a9d49077605c37)) 74 | * **state:** restart service when configuration has changed ([a8100d0](https://github.com/saltstack-formulas/syslog-ng-formula/commit/a8100d0f325c8f8f792b6b9c9e342cf63e13ab3d)) 75 | 76 | 77 | ### Continuous Integration 78 | 79 | * **gemfile:** restrict `train` gem version until upstream fix [skip ci] ([b44bfb5](https://github.com/saltstack-formulas/syslog-ng-formula/commit/b44bfb5872050352cca6fe0d139da5b640764515)) 80 | * **gemfile.lock:** add to repo with updated `Gemfile` [skip ci] ([4af7a0f](https://github.com/saltstack-formulas/syslog-ng-formula/commit/4af7a0fdd620ff6128493a2222dcf752234b078f)) 81 | * **kitchen:** avoid using bootstrap for `master` instances [skip ci] ([b44b24e](https://github.com/saltstack-formulas/syslog-ng-formula/commit/b44b24ed5c5064003ae9c45056b836e186b5ab81)) 82 | * **kitchen:** install required packages to bootstrapped `opensuse` [skip ci] ([8fe499e](https://github.com/saltstack-formulas/syslog-ng-formula/commit/8fe499e72225ef4b0493d4fabde4188b4d08b66b)) 83 | * **kitchen:** use `debian-10-master-py3` instead of `develop` [skip ci] ([3ce84e4](https://github.com/saltstack-formulas/syslog-ng-formula/commit/3ce84e4cf0ec254b3a28cb850465da883f871725)) 84 | * **kitchen:** use `develop` image until `master` is ready (`amazonlinux`) [skip ci] ([68366d7](https://github.com/saltstack-formulas/syslog-ng-formula/commit/68366d70525cc184351a7d054ee36dd4fb2fc7a6)) 85 | * **kitchen:** use `saltimages` Docker Hub where available [skip ci] ([1762054](https://github.com/saltstack-formulas/syslog-ng-formula/commit/17620541caf56056e294301e88c85fa151cb7174)) 86 | * **kitchen:** use bootstrapped `opensuse` images until `2019.2.2` [skip ci] ([9b435f2](https://github.com/saltstack-formulas/syslog-ng-formula/commit/9b435f2b6081bff0e127006392cf420279a60ceb)) 87 | * **kitchen+travis:** remove `master-py2-arch-base-latest` [skip ci] ([766962a](https://github.com/saltstack-formulas/syslog-ng-formula/commit/766962a6b020e1061c1b6e3cdc91cd4e7fa41dc7)) 88 | * **kitchen+travis:** upgrade matrix after `2019.2.2` release [skip ci] ([b5ebab0](https://github.com/saltstack-formulas/syslog-ng-formula/commit/b5ebab04471f9501b58eaaf9efc7f89b18bdd5c7)) 89 | * **travis:** add notifications => zulip [skip ci] ([7cffd70](https://github.com/saltstack-formulas/syslog-ng-formula/commit/7cffd70d4812b65ca23a6abdea9a01f5ce710ec1)) 90 | * **travis:** apply changes from build config validation [skip ci] ([c3685b3](https://github.com/saltstack-formulas/syslog-ng-formula/commit/c3685b356d01ac5f033e10c0669587b443a3f3cf)) 91 | * **travis:** opt-in to `dpl v2` to complete build config validation [skip ci] ([3d5cd5c](https://github.com/saltstack-formulas/syslog-ng-formula/commit/3d5cd5ccf3183d6305cf3acebaea1183630b438e)) 92 | * **travis:** quote pathspecs used with `git ls-files` [skip ci] ([668926c](https://github.com/saltstack-formulas/syslog-ng-formula/commit/668926cbd8ccf7e15ee7a95641dac5aac0285782)) 93 | * **travis:** run `shellcheck` during lint job [skip ci] ([fd9aba2](https://github.com/saltstack-formulas/syslog-ng-formula/commit/fd9aba207ee8f041ad3b9f36a33a03160c555518)) 94 | * **travis:** update `salt-lint` config for `v0.0.10` [skip ci] ([ce2de8b](https://github.com/saltstack-formulas/syslog-ng-formula/commit/ce2de8b669d7792d416eab477279a8f7a8b157f7)) 95 | * **travis:** use `major.minor` for `semantic-release` version [skip ci] ([dcfa3d5](https://github.com/saltstack-formulas/syslog-ng-formula/commit/dcfa3d5c7de1c815667f4bbcb0f79de5c0ddab6e)) 96 | * **travis:** use build config validation (beta) [skip ci] ([9d34a63](https://github.com/saltstack-formulas/syslog-ng-formula/commit/9d34a6399fcebba85ce7901e37349cb518b098b5)) 97 | * **workflows/commitlint:** add to repo [skip ci] ([ff23c72](https://github.com/saltstack-formulas/syslog-ng-formula/commit/ff23c72345c244748226931fd8067e9877563b60)) 98 | * merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([a3fd56e](https://github.com/saltstack-formulas/syslog-ng-formula/commit/a3fd56e002f2013c08b94ec86b66c980ac0f6812)) 99 | * merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([2eb11ff](https://github.com/saltstack-formulas/syslog-ng-formula/commit/2eb11ff146bcf05b8082bfc1e312f1a464743f69)) 100 | 101 | 102 | ### Documentation 103 | 104 | * **contributing:** remove to use org-level file instead [skip ci] ([b44429d](https://github.com/saltstack-formulas/syslog-ng-formula/commit/b44429d6c43f9ab6a149ceb6b0c223d8d1af340b)) 105 | * **readme:** update link to `CONTRIBUTING` [skip ci] ([9231f3f](https://github.com/saltstack-formulas/syslog-ng-formula/commit/9231f3f1443d8da399299abdb414a5704590d101)) 106 | 107 | 108 | ### Performance Improvements 109 | 110 | * **travis:** improve `salt-lint` invocation [skip ci] ([1958610](https://github.com/saltstack-formulas/syslog-ng-formula/commit/19586109fa38eaa709a06cdcbb5fef83b4cd4ad5)) 111 | 112 | 113 | ### Styles 114 | 115 | * **libtofs.jinja:** use Black-inspired Jinja formatting [skip ci] ([3de8cb7](https://github.com/saltstack-formulas/syslog-ng-formula/commit/3de8cb74624825cc4f8ecc05fbc76b29f39f736c)) 116 | 117 | # [0.5.0](https://github.com/saltstack-formulas/syslog-ng-formula/compare/v0.4.0...v0.5.0) (2019-10-01) 118 | 119 | 120 | ### Bug Fixes 121 | 122 | * **pillar:** rearrange `tofs` block to avoid `yamllint` error ([7c4dd84](https://github.com/saltstack-formulas/syslog-ng-formula/commit/7c4dd84)) 123 | 124 | 125 | ### Features 126 | 127 | * **tofs:** add TOFS support ([6a6f255](https://github.com/saltstack-formulas/syslog-ng-formula/commit/6a6f255)) 128 | 129 | # [0.4.0](https://github.com/saltstack-formulas/syslog-ng-formula/compare/v0.3.0...v0.4.0) (2019-09-30) 130 | 131 | 132 | ### Bug Fixes 133 | 134 | * **syslog_ng.sls:** fix `yamllint` errors in test pillar ([8f6c57f](https://github.com/saltstack-formulas/syslog-ng-formula/commit/8f6c57f)), closes [/travis-ci.com/saltstack-formulas/syslog-ng-formula/builds/129135816#L210-L217](https://github.com//travis-ci.com/saltstack-formulas/syslog-ng-formula/builds/129135816/issues/L210-L217) 135 | 136 | 137 | ### Code Refactoring 138 | 139 | * **pillars:** dry default pillars ([2f169e2](https://github.com/saltstack-formulas/syslog-ng-formula/commit/2f169e2)) 140 | * **states:** switch to the new directory layout ([7ea12e3](https://github.com/saltstack-formulas/syslog-ng-formula/commit/7ea12e3)) 141 | 142 | 143 | ### Continuous Integration 144 | 145 | * use `dist: bionic` & apply `opensuse-leap-15` SCP error workaround ([9151f4e](https://github.com/saltstack-formulas/syslog-ng-formula/commit/9151f4e)) 146 | * **cirrus:** update test matrix ([7e3826b](https://github.com/saltstack-formulas/syslog-ng-formula/commit/7e3826b)) 147 | * **kitchen:** change `log_level` to `debug` instead of `info` ([8c7b3f0](https://github.com/saltstack-formulas/syslog-ng-formula/commit/8c7b3f0)) 148 | * **kitchen+travis:** replace EOL pre-salted images ([25f12ac](https://github.com/saltstack-formulas/syslog-ng-formula/commit/25f12ac)) 149 | * **travis:** fix CentOS instance name ([2a94fab](https://github.com/saltstack-formulas/syslog-ng-formula/commit/2a94fab)) 150 | * **travis:** test formula with Travis ([2049866](https://github.com/saltstack-formulas/syslog-ng-formula/commit/2049866)) 151 | * **yamllint:** add rule `empty-values` & use new `yaml-files` setting ([abd2920](https://github.com/saltstack-formulas/syslog-ng-formula/commit/abd2920)) 152 | 153 | 154 | ### Features 155 | 156 | * **distro:** add support for CentOS ([7311f10](https://github.com/saltstack-formulas/syslog-ng-formula/commit/7311f10)) 157 | * **distro:** add support for OpenSuse ([3258ee0](https://github.com/saltstack-formulas/syslog-ng-formula/commit/3258ee0)) 158 | * **install:** provide EPEL repo configuration for `Amazon Linux-2` ([4e46ea0](https://github.com/saltstack-formulas/syslog-ng-formula/commit/4e46ea0)) 159 | * **pillar:** update map.jinja from template-formula ([c027735](https://github.com/saltstack-formulas/syslog-ng-formula/commit/c027735)) 160 | * **platform:** add support for `Arch` ([2112711](https://github.com/saltstack-formulas/syslog-ng-formula/commit/2112711)) 161 | 162 | 163 | ### Tests 164 | 165 | * **inspec:** fix test on syslog-ng.conf file ([bd2506f](https://github.com/saltstack-formulas/syslog-ng-formula/commit/bd2506f)) 166 | * **pillar:** use custom pillar file to run tests ([5cb5bd4](https://github.com/saltstack-formulas/syslog-ng-formula/commit/5cb5bd4)) 167 | * **refactor:** split tests (config/package/service) ([b7fac62](https://github.com/saltstack-formulas/syslog-ng-formula/commit/b7fac62)) 168 | 169 | # [0.3.0](https://github.com/saltstack-formulas/syslog-ng-formula/compare/v0.2.2...v0.3.0) (2019-08-17) 170 | 171 | 172 | ### Continuous Integration 173 | 174 | * **cirrus:** use cirrus-ci alongisde travis-ci ([51271b6](https://github.com/saltstack-formulas/syslog-ng-formula/commit/51271b6)) 175 | * **kitchen+travis:** modify matrix to include `develop` platform ([b47b992](https://github.com/saltstack-formulas/syslog-ng-formula/commit/b47b992)) 176 | 177 | 178 | ### Features 179 | 180 | * **yamllint:** include for this repo and apply rules throughout ([a81ae52](https://github.com/saltstack-formulas/syslog-ng-formula/commit/a81ae52)) 181 | 182 | ## [0.2.2](https://github.com/saltstack-formulas/syslog-ng-formula/compare/v0.2.1...v0.2.2) (2019-05-26) 183 | 184 | 185 | ### Documentation 186 | 187 | * **readme:** add testing requirements section ([06de318](https://github.com/saltstack-formulas/syslog-ng-formula/commit/06de318)) 188 | 189 | ## [0.2.1](https://github.com/saltstack-formulas/syslog-ng-formula/compare/v0.2.0...v0.2.1) (2019-05-26) 190 | 191 | 192 | ### Bug Fixes 193 | 194 | * **inspec:** move test suite to test/integration/default ([0ba5fce](https://github.com/saltstack-formulas/syslog-ng-formula/commit/0ba5fce)) 195 | * **inspec:** update Inspec profile definition ([85bdfbb](https://github.com/saltstack-formulas/syslog-ng-formula/commit/85bdfbb)) 196 | 197 | 198 | ### Continuous Integration 199 | 200 | * **kitchen:** rename Kitchen config file ([dcbc58d](https://github.com/saltstack-formulas/syslog-ng-formula/commit/dcbc58d)) 201 | * **kitchen+travis:** test with more distros ([b1acda9](https://github.com/saltstack-formulas/syslog-ng-formula/commit/b1acda9)) 202 | * **travis:** debian wheezy is no longer supported ([e6d2a06](https://github.com/saltstack-formulas/syslog-ng-formula/commit/e6d2a06)) 203 | 204 | 205 | ### Documentation 206 | 207 | * **readme:** fix typos, update README with testing info ([35d0ca4](https://github.com/saltstack-formulas/syslog-ng-formula/commit/35d0ca4)) 208 | * **readme:** update readme ([0193e22](https://github.com/saltstack-formulas/syslog-ng-formula/commit/0193e22)) 209 | * **semantic-release:** implement an automated changelog ([98e17dd](https://github.com/saltstack-formulas/syslog-ng-formula/commit/98e17dd)) 210 | -------------------------------------------------------------------------------- /docs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | 2 | Changelog 3 | ========= 4 | 5 | `0.6.1 `_ (2025-09-04) 6 | ----------------------------------------------------------------------------------------------------------- 7 | 8 | Bug Fixes 9 | ^^^^^^^^^ 10 | 11 | 12 | * **osfingermap.yaml:** set syslog-ng version for Debian Trixie (\ `45a3620 `_\ ) 13 | 14 | `0.6.0 `_ (2025-06-16) 15 | ----------------------------------------------------------------------------------------------------------- 16 | 17 | Bug Fixes 18 | ^^^^^^^^^ 19 | 20 | 21 | * **osfingermap.yaml:** set syslog-ng version for Debian Bookworm (\ `0988aba `_\ ) 22 | * **osfingermap.yaml:** set syslog-ng version for Debian Bullseye (\ `d9ef31a `_\ ) 23 | 24 | Continuous Integration 25 | ^^^^^^^^^^^^^^^^^^^^^^ 26 | 27 | 28 | * update ``pre-commit`` configuration inc. for pre-commit.ci [skip ci] (\ `c4adb02 `_\ ) 29 | * update linters to latest versions [skip ci] (\ `2618873 `_\ ) 30 | * use latest test images (\ `d9514b0 `_\ ) 31 | * **3003.1:** update inc. AlmaLinux, Rocky & ``rst-lint`` [skip ci] (\ `affc7fd `_\ ) 32 | * **commitlint:** ensure ``upstream/master`` uses main repo URL [skip ci] (\ `d5e555a `_\ ) 33 | * **gemfile:** allow rubygems proxy to be provided as an env var [skip ci] (\ `ad7d546 `_\ ) 34 | * **gemfile+lock:** use ``ssf`` customised ``inspec`` repo [skip ci] (\ `4a16d6b `_\ ) 35 | * **gemfile+lock:** use ``ssf`` customised ``kitchen-docker`` repo [skip ci] (\ `464135e `_\ ) 36 | * **gitlab-ci:** add ``rubocop`` linter (with ``allow_failure``\ ) [skip ci] (\ `c4bbce7 `_\ ) 37 | * **gitlab-ci:** use GitLab CI as Travis CI replacement (\ `a09511d `_\ ) 38 | * **kitchen:** move ``provisioner`` block & update ``run_command`` [skip ci] (\ `c5c6142 `_\ ) 39 | * **kitchen+ci:** update with ``3004`` pre-salted images/boxes [skip ci] (\ `edf5b9c `_\ ) 40 | * **kitchen+ci:** update with latest ``3003.2`` pre-salted images [skip ci] (\ `8fc2589 `_\ ) 41 | * **kitchen+ci:** update with latest CVE pre-salted images [skip ci] (\ `72b19f3 `_\ ) 42 | * **kitchen+ci:** use latest pre-salted images (after CVE) [skip ci] (\ `a7dfcd4 `_\ ) 43 | * **kitchen+gitlab:** adjust matrix to add ``3003`` [skip ci] (\ `7ced1a7 `_\ ) 44 | * **kitchen+gitlab:** remove Ubuntu 16.04 & Fedora 32 (EOL) [skip ci] (\ `c2a64a5 `_\ ) 45 | * **kitchen+gitlab:** update for new pre-salted images [skip ci] (\ `85ed779 `_\ ) 46 | * **kitchen+gitlab:** update for new pre-salted images [skip ci] (\ `2a2dc5f `_\ ) 47 | * add ``arch-master`` to matrix and update ``.travis.yml`` [skip ci] (\ `6869801 `_\ ) 48 | * add Debian 11 Bullseye & update ``yamllint`` configuration [skip ci] (\ `99f2272 `_\ ) 49 | * **kitchen+gitlab-ci:** use latest pre-salted images [skip ci] (\ `f1c7151 `_\ ) 50 | * **pre-commit:** add to formula [skip ci] (\ `ffe3845 `_\ ) 51 | * **pre-commit:** enable/disable ``rstcheck`` as relevant [skip ci] (\ `1d77079 `_\ ) 52 | * **pre-commit:** finalise ``rstcheck`` configuration [skip ci] (\ `6c09627 `_\ ) 53 | * **pre-commit:** update hook for ``rubocop`` [skip ci] (\ `8f11ae5 `_\ ) 54 | 55 | Documentation 56 | ^^^^^^^^^^^^^ 57 | 58 | 59 | * **readme:** fix headings [skip ci] (\ `99b4c29 `_\ ) 60 | 61 | Features 62 | ^^^^^^^^ 63 | 64 | 65 | * **FreeBSD:** add support (\ `653201f `_\ ) 66 | * **osfamilymap:** add support for Gentoo (\ `e39ec5e `_\ ) 67 | 68 | Tests 69 | ^^^^^ 70 | 71 | 72 | * **rubocop:** fix all violations (\ `afe8620 `_\ ) 73 | * **system:** add ``build_platform_codename`` [skip ci] (\ `6450505 `_\ ) 74 | * **system.rb:** add support for ``mac_os_x`` [skip ci] (\ `d098cb6 `_\ ) 75 | * standardise use of ``share`` suite & ``_mapdata`` state [skip ci] (\ `9e67b07 `_\ ) 76 | 77 | `0.5.1 `_ (2020-09-09) 78 | ----------------------------------------------------------------------------------------------------------- 79 | 80 | Bug Fixes 81 | ^^^^^^^^^ 82 | 83 | 84 | * **libtofs:** “files_switch” mess up the variable exported by “map.jinja” [skip ci] (\ `e9c5153 `_\ ) 85 | * **release.config.js:** use full commit hash in commit link [skip ci] (\ `4d6851d `_\ ) 86 | * **state:** restart service when configuration has changed (\ `a8100d0 `_\ ) 87 | 88 | Continuous Integration 89 | ^^^^^^^^^^^^^^^^^^^^^^ 90 | 91 | 92 | * **gemfile:** restrict ``train`` gem version until upstream fix [skip ci] (\ `b44bfb5 `_\ ) 93 | * **gemfile.lock:** add to repo with updated ``Gemfile`` [skip ci] (\ `4af7a0f `_\ ) 94 | * **kitchen:** avoid using bootstrap for ``master`` instances [skip ci] (\ `b44b24e `_\ ) 95 | * **kitchen:** install required packages to bootstrapped ``opensuse`` [skip ci] (\ `8fe499e `_\ ) 96 | * **kitchen:** use ``debian-10-master-py3`` instead of ``develop`` [skip ci] (\ `3ce84e4 `_\ ) 97 | * **kitchen:** use ``develop`` image until ``master`` is ready (\ ``amazonlinux``\ ) [skip ci] (\ `68366d7 `_\ ) 98 | * **kitchen:** use ``saltimages`` Docker Hub where available [skip ci] (\ `1762054 `_\ ) 99 | * **kitchen:** use bootstrapped ``opensuse`` images until ``2019.2.2`` [skip ci] (\ `9b435f2 `_\ ) 100 | * **kitchen+travis:** remove ``master-py2-arch-base-latest`` [skip ci] (\ `766962a `_\ ) 101 | * **kitchen+travis:** upgrade matrix after ``2019.2.2`` release [skip ci] (\ `b5ebab0 `_\ ) 102 | * **travis:** add notifications => zulip [skip ci] (\ `7cffd70 `_\ ) 103 | * **travis:** apply changes from build config validation [skip ci] (\ `c3685b3 `_\ ) 104 | * **travis:** opt-in to ``dpl v2`` to complete build config validation [skip ci] (\ `3d5cd5c `_\ ) 105 | * **travis:** quote pathspecs used with ``git ls-files`` [skip ci] (\ `668926c `_\ ) 106 | * **travis:** run ``shellcheck`` during lint job [skip ci] (\ `fd9aba2 `_\ ) 107 | * **travis:** update ``salt-lint`` config for ``v0.0.10`` [skip ci] (\ `ce2de8b `_\ ) 108 | * **travis:** use ``major.minor`` for ``semantic-release`` version [skip ci] (\ `dcfa3d5 `_\ ) 109 | * **travis:** use build config validation (beta) [skip ci] (\ `9d34a63 `_\ ) 110 | * **workflows/commitlint:** add to repo [skip ci] (\ `ff23c72 `_\ ) 111 | * merge travis matrix, add ``salt-lint`` & ``rubocop`` to ``lint`` job (\ `a3fd56e `_\ ) 112 | * merge travis matrix, add ``salt-lint`` & ``rubocop`` to ``lint`` job (\ `2eb11ff `_\ ) 113 | 114 | Documentation 115 | ^^^^^^^^^^^^^ 116 | 117 | 118 | * **contributing:** remove to use org-level file instead [skip ci] (\ `b44429d `_\ ) 119 | * **readme:** update link to ``CONTRIBUTING`` [skip ci] (\ `9231f3f `_\ ) 120 | 121 | Performance Improvements 122 | ^^^^^^^^^^^^^^^^^^^^^^^^ 123 | 124 | 125 | * **travis:** improve ``salt-lint`` invocation [skip ci] (\ `1958610 `_\ ) 126 | 127 | Styles 128 | ^^^^^^ 129 | 130 | 131 | * **libtofs.jinja:** use Black-inspired Jinja formatting [skip ci] (\ `3de8cb7 `_\ ) 132 | 133 | `0.5.0 `_ (2019-10-01) 134 | ----------------------------------------------------------------------------------------------------------- 135 | 136 | Bug Fixes 137 | ^^^^^^^^^ 138 | 139 | 140 | * **pillar:** rearrange ``tofs`` block to avoid ``yamllint`` error (\ `7c4dd84 `_\ ) 141 | 142 | Features 143 | ^^^^^^^^ 144 | 145 | 146 | * **tofs:** add TOFS support (\ `6a6f255 `_\ ) 147 | 148 | `0.4.0 `_ (2019-09-30) 149 | ----------------------------------------------------------------------------------------------------------- 150 | 151 | Bug Fixes 152 | ^^^^^^^^^ 153 | 154 | 155 | * **syslog_ng.sls:** fix ``yamllint`` errors in test pillar (\ `8f6c57f `_\ ), closes `/travis-ci.com/saltstack-formulas/syslog-ng-formula/builds/129135816#L210-L217 `_ 156 | 157 | Code Refactoring 158 | ^^^^^^^^^^^^^^^^ 159 | 160 | 161 | * **pillars:** dry default pillars (\ `2f169e2 `_\ ) 162 | * **states:** switch to the new directory layout (\ `7ea12e3 `_\ ) 163 | 164 | Continuous Integration 165 | ^^^^^^^^^^^^^^^^^^^^^^ 166 | 167 | 168 | * use ``dist: bionic`` & apply ``opensuse-leap-15`` SCP error workaround (\ `9151f4e `_\ ) 169 | * **cirrus:** update test matrix (\ `7e3826b `_\ ) 170 | * **kitchen:** change ``log_level`` to ``debug`` instead of ``info`` (\ `8c7b3f0 `_\ ) 171 | * **kitchen+travis:** replace EOL pre-salted images (\ `25f12ac `_\ ) 172 | * **travis:** fix CentOS instance name (\ `2a94fab `_\ ) 173 | * **travis:** test formula with Travis (\ `2049866 `_\ ) 174 | * **yamllint:** add rule ``empty-values`` & use new ``yaml-files`` setting (\ `abd2920 `_\ ) 175 | 176 | Features 177 | ^^^^^^^^ 178 | 179 | 180 | * **distro:** add support for CentOS (\ `7311f10 `_\ ) 181 | * **distro:** add support for OpenSuse (\ `3258ee0 `_\ ) 182 | * **install:** provide EPEL repo configuration for ``Amazon Linux-2`` (\ `4e46ea0 `_\ ) 183 | * **pillar:** update map.jinja from template-formula (\ `c027735 `_\ ) 184 | * **platform:** add support for ``Arch`` (\ `2112711 `_\ ) 185 | 186 | Tests 187 | ^^^^^ 188 | 189 | 190 | * **inspec:** fix test on syslog-ng.conf file (\ `bd2506f `_\ ) 191 | * **pillar:** use custom pillar file to run tests (\ `5cb5bd4 `_\ ) 192 | * **refactor:** split tests (config/package/service) (\ `b7fac62 `_\ ) 193 | 194 | `0.3.0 `_ (2019-08-17) 195 | ----------------------------------------------------------------------------------------------------------- 196 | 197 | Continuous Integration 198 | ^^^^^^^^^^^^^^^^^^^^^^ 199 | 200 | 201 | * **cirrus:** use cirrus-ci alongisde travis-ci (\ `51271b6 `_\ ) 202 | * **kitchen+travis:** modify matrix to include ``develop`` platform (\ `b47b992 `_\ ) 203 | 204 | Features 205 | ^^^^^^^^ 206 | 207 | 208 | * **yamllint:** include for this repo and apply rules throughout (\ `a81ae52 `_\ ) 209 | 210 | `0.2.2 `_ (2019-05-26) 211 | ----------------------------------------------------------------------------------------------------------- 212 | 213 | Documentation 214 | ^^^^^^^^^^^^^ 215 | 216 | 217 | * **readme:** add testing requirements section (\ `06de318 `_\ ) 218 | 219 | `0.2.1 `_ (2019-05-26) 220 | ----------------------------------------------------------------------------------------------------------- 221 | 222 | Bug Fixes 223 | ^^^^^^^^^ 224 | 225 | 226 | * **inspec:** move test suite to test/integration/default (\ `0ba5fce `_\ ) 227 | * **inspec:** update Inspec profile definition (\ `85bdfbb `_\ ) 228 | 229 | Continuous Integration 230 | ^^^^^^^^^^^^^^^^^^^^^^ 231 | 232 | 233 | * **kitchen:** rename Kitchen config file (\ `dcbc58d `_\ ) 234 | * **kitchen+travis:** test with more distros (\ `b1acda9 `_\ ) 235 | * **travis:** debian wheezy is no longer supported (\ `e6d2a06 `_\ ) 236 | 237 | Documentation 238 | ^^^^^^^^^^^^^ 239 | 240 | 241 | * **readme:** fix typos, update README with testing info (\ `35d0ca4 `_\ ) 242 | * **readme:** update readme (\ `0193e22 `_\ ) 243 | * **semantic-release:** implement an automated changelog (\ `98e17dd `_\ ) 244 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://gitlab.com/saltstack-formulas/infrastructure/inspec 3 | revision: a0c6295303f7d7a4d2a6164b5e77868560b04945 4 | branch: ssf 5 | specs: 6 | inspec (5.21.15) 7 | cookstyle 8 | faraday_middleware (>= 0.12.2, < 1.1) 9 | inspec-core (= 5.21.15) 10 | mongo (= 2.13.2) 11 | progress_bar (~> 1.3.3) 12 | rake 13 | roo (~> 2.9.0) 14 | roo-xls 15 | train (~> 3.10) 16 | train-aws (~> 0.2) 17 | train-habitat (~> 0.1) 18 | train-winrm (~> 0.2) 19 | inspec-core (5.21.15) 20 | addressable (~> 2.4) 21 | chef-telemetry (~> 1.0, >= 1.0.8) 22 | faraday (>= 1, < 3) 23 | faraday-follow_redirects (~> 0.3) 24 | hashie (>= 3.4, < 5.0) 25 | license-acceptance (>= 0.2.13, < 3.0) 26 | method_source (>= 0.8, < 2.0) 27 | mixlib-log (~> 3.0) 28 | multipart-post (~> 2.0) 29 | parallel (~> 1.9) 30 | parslet (>= 1.5, < 2.0) 31 | pry (~> 0.13) 32 | rspec (>= 3.9, <= 3.11) 33 | rspec-its (~> 1.2) 34 | rubyzip (>= 1.2.2, < 3.0) 35 | semverse (~> 3.0) 36 | sslshake (~> 1.2) 37 | thor (>= 0.20, < 2.0) 38 | tomlrb (>= 1.2, < 2.1) 39 | train-core (~> 3.10) 40 | tty-prompt (~> 0.17) 41 | tty-table (~> 0.10) 42 | 43 | GIT 44 | remote: https://gitlab.com/saltstack-formulas/infrastructure/kitchen-docker 45 | revision: 104079a1d2fe34f5b076f4d316f6f837fa76e412 46 | branch: ssf 47 | specs: 48 | kitchen-docker (2.13.0) 49 | test-kitchen (>= 1.0.0) 50 | 51 | GEM 52 | remote: https://rubygems.org/ 53 | specs: 54 | activesupport (7.1.5.1) 55 | base64 56 | benchmark (>= 0.3) 57 | bigdecimal 58 | concurrent-ruby (~> 1.0, >= 1.0.2) 59 | connection_pool (>= 2.2.5) 60 | drb 61 | i18n (>= 1.6, < 2) 62 | logger (>= 1.4.2) 63 | minitest (>= 5.1) 64 | mutex_m 65 | securerandom (>= 0.3) 66 | tzinfo (~> 2.0) 67 | addressable (2.8.7) 68 | public_suffix (>= 2.0.2, < 7.0) 69 | ast (2.4.3) 70 | aws-eventstream (1.3.2) 71 | aws-partitions (1.863.0) 72 | aws-sdk-accessanalyzer (1.44.0) 73 | aws-sdk-core (~> 3, >= 3.188.0) 74 | aws-sigv4 (~> 1.1) 75 | aws-sdk-account (1.20.0) 76 | aws-sdk-core (~> 3, >= 3.188.0) 77 | aws-sigv4 (~> 1.1) 78 | aws-sdk-alexaforbusiness (1.67.0) 79 | aws-sdk-core (~> 3, >= 3.188.0) 80 | aws-sigv4 (~> 1.1) 81 | aws-sdk-amplify (1.54.0) 82 | aws-sdk-core (~> 3, >= 3.188.0) 83 | aws-sigv4 (~> 1.1) 84 | aws-sdk-apigateway (1.90.0) 85 | aws-sdk-core (~> 3, >= 3.188.0) 86 | aws-sigv4 (~> 1.1) 87 | aws-sdk-apigatewayv2 (1.53.0) 88 | aws-sdk-core (~> 3, >= 3.188.0) 89 | aws-sigv4 (~> 1.1) 90 | aws-sdk-applicationautoscaling (1.79.0) 91 | aws-sdk-core (~> 3, >= 3.188.0) 92 | aws-sigv4 (~> 1.1) 93 | aws-sdk-athena (1.79.0) 94 | aws-sdk-core (~> 3, >= 3.188.0) 95 | aws-sigv4 (~> 1.1) 96 | aws-sdk-autoscaling (1.102.0) 97 | aws-sdk-core (~> 3, >= 3.188.0) 98 | aws-sigv4 (~> 1.1) 99 | aws-sdk-batch (1.79.0) 100 | aws-sdk-core (~> 3, >= 3.188.0) 101 | aws-sigv4 (~> 1.1) 102 | aws-sdk-budgets (1.62.0) 103 | aws-sdk-core (~> 3, >= 3.188.0) 104 | aws-sigv4 (~> 1.1) 105 | aws-sdk-cloudformation (1.97.0) 106 | aws-sdk-core (~> 3, >= 3.188.0) 107 | aws-sigv4 (~> 1.1) 108 | aws-sdk-cloudfront (1.86.1) 109 | aws-sdk-core (~> 3, >= 3.188.0) 110 | aws-sigv4 (~> 1.1) 111 | aws-sdk-cloudhsm (1.50.0) 112 | aws-sdk-core (~> 3, >= 3.188.0) 113 | aws-sigv4 (~> 1.1) 114 | aws-sdk-cloudhsmv2 (1.53.0) 115 | aws-sdk-core (~> 3, >= 3.188.0) 116 | aws-sigv4 (~> 1.1) 117 | aws-sdk-cloudtrail (1.74.0) 118 | aws-sdk-core (~> 3, >= 3.188.0) 119 | aws-sigv4 (~> 1.1) 120 | aws-sdk-cloudwatch (1.83.0) 121 | aws-sdk-core (~> 3, >= 3.188.0) 122 | aws-sigv4 (~> 1.1) 123 | aws-sdk-cloudwatchevents (1.69.0) 124 | aws-sdk-core (~> 3, >= 3.188.0) 125 | aws-sigv4 (~> 1.1) 126 | aws-sdk-cloudwatchlogs (1.77.0) 127 | aws-sdk-core (~> 3, >= 3.188.0) 128 | aws-sigv4 (~> 1.1) 129 | aws-sdk-codecommit (1.62.0) 130 | aws-sdk-core (~> 3, >= 3.188.0) 131 | aws-sigv4 (~> 1.1) 132 | aws-sdk-codedeploy (1.62.0) 133 | aws-sdk-core (~> 3, >= 3.188.0) 134 | aws-sigv4 (~> 1.1) 135 | aws-sdk-codepipeline (1.67.0) 136 | aws-sdk-core (~> 3, >= 3.188.0) 137 | aws-sigv4 (~> 1.1) 138 | aws-sdk-cognitoidentity (1.51.0) 139 | aws-sdk-core (~> 3, >= 3.188.0) 140 | aws-sigv4 (~> 1.1) 141 | aws-sdk-cognitoidentityprovider (1.85.0) 142 | aws-sdk-core (~> 3, >= 3.188.0) 143 | aws-sigv4 (~> 1.1) 144 | aws-sdk-configservice (1.103.0) 145 | aws-sdk-core (~> 3, >= 3.188.0) 146 | aws-sigv4 (~> 1.1) 147 | aws-sdk-core (3.190.3) 148 | aws-eventstream (~> 1, >= 1.3.0) 149 | aws-partitions (~> 1, >= 1.651.0) 150 | aws-sigv4 (~> 1.8) 151 | jmespath (~> 1, >= 1.6.1) 152 | aws-sdk-costandusagereportservice (1.53.0) 153 | aws-sdk-core (~> 3, >= 3.188.0) 154 | aws-sigv4 (~> 1.1) 155 | aws-sdk-databasemigrationservice (1.91.0) 156 | aws-sdk-core (~> 3, >= 3.188.0) 157 | aws-sigv4 (~> 1.1) 158 | aws-sdk-dynamodb (1.98.0) 159 | aws-sdk-core (~> 3, >= 3.188.0) 160 | aws-sigv4 (~> 1.1) 161 | aws-sdk-ec2 (1.429.0) 162 | aws-sdk-core (~> 3, >= 3.188.0) 163 | aws-sigv4 (~> 1.1) 164 | aws-sdk-ecr (1.68.0) 165 | aws-sdk-core (~> 3, >= 3.188.0) 166 | aws-sigv4 (~> 1.1) 167 | aws-sdk-ecrpublic (1.25.0) 168 | aws-sdk-core (~> 3, >= 3.188.0) 169 | aws-sigv4 (~> 1.1) 170 | aws-sdk-ecs (1.135.0) 171 | aws-sdk-core (~> 3, >= 3.188.0) 172 | aws-sigv4 (~> 1.1) 173 | aws-sdk-efs (1.71.0) 174 | aws-sdk-core (~> 3, >= 3.188.0) 175 | aws-sigv4 (~> 1.1) 176 | aws-sdk-eks (1.95.0) 177 | aws-sdk-core (~> 3, >= 3.188.0) 178 | aws-sigv4 (~> 1.1) 179 | aws-sdk-elasticache (1.95.0) 180 | aws-sdk-core (~> 3, >= 3.188.0) 181 | aws-sigv4 (~> 1.1) 182 | aws-sdk-elasticbeanstalk (1.63.0) 183 | aws-sdk-core (~> 3, >= 3.188.0) 184 | aws-sigv4 (~> 1.1) 185 | aws-sdk-elasticloadbalancing (1.51.0) 186 | aws-sdk-core (~> 3, >= 3.188.0) 187 | aws-sigv4 (~> 1.1) 188 | aws-sdk-elasticloadbalancingv2 (1.96.0) 189 | aws-sdk-core (~> 3, >= 3.188.0) 190 | aws-sigv4 (~> 1.1) 191 | aws-sdk-elasticsearchservice (1.79.0) 192 | aws-sdk-core (~> 3, >= 3.188.0) 193 | aws-sigv4 (~> 1.1) 194 | aws-sdk-emr (1.81.0) 195 | aws-sdk-core (~> 3, >= 3.188.0) 196 | aws-sigv4 (~> 1.1) 197 | aws-sdk-eventbridge (1.54.0) 198 | aws-sdk-core (~> 3, >= 3.188.0) 199 | aws-sigv4 (~> 1.1) 200 | aws-sdk-firehose (1.60.0) 201 | aws-sdk-core (~> 3, >= 3.188.0) 202 | aws-sigv4 (~> 1.1) 203 | aws-sdk-glue (1.165.0) 204 | aws-sdk-core (~> 3, >= 3.188.0) 205 | aws-sigv4 (~> 1.1) 206 | aws-sdk-guardduty (1.85.0) 207 | aws-sdk-core (~> 3, >= 3.188.0) 208 | aws-sigv4 (~> 1.1) 209 | aws-sdk-iam (1.92.0) 210 | aws-sdk-core (~> 3, >= 3.188.0) 211 | aws-sigv4 (~> 1.1) 212 | aws-sdk-kafka (1.67.0) 213 | aws-sdk-core (~> 3, >= 3.188.0) 214 | aws-sigv4 (~> 1.1) 215 | aws-sdk-kinesis (1.54.0) 216 | aws-sdk-core (~> 3, >= 3.188.0) 217 | aws-sigv4 (~> 1.1) 218 | aws-sdk-kms (1.76.0) 219 | aws-sdk-core (~> 3, >= 3.188.0) 220 | aws-sigv4 (~> 1.1) 221 | aws-sdk-lambda (1.113.0) 222 | aws-sdk-core (~> 3, >= 3.188.0) 223 | aws-sigv4 (~> 1.1) 224 | aws-sdk-macie2 (1.64.0) 225 | aws-sdk-core (~> 3, >= 3.188.0) 226 | aws-sigv4 (~> 1.1) 227 | aws-sdk-mq (1.58.0) 228 | aws-sdk-core (~> 3, >= 3.188.0) 229 | aws-sigv4 (~> 1.1) 230 | aws-sdk-networkfirewall (1.39.0) 231 | aws-sdk-core (~> 3, >= 3.188.0) 232 | aws-sigv4 (~> 1.1) 233 | aws-sdk-networkmanager (1.40.0) 234 | aws-sdk-core (~> 3, >= 3.188.0) 235 | aws-sigv4 (~> 1.1) 236 | aws-sdk-organizations (1.83.0) 237 | aws-sdk-core (~> 3, >= 3.188.0) 238 | aws-sigv4 (~> 1.1) 239 | aws-sdk-ram (1.52.0) 240 | aws-sdk-core (~> 3, >= 3.188.0) 241 | aws-sigv4 (~> 1.1) 242 | aws-sdk-rds (1.208.0) 243 | aws-sdk-core (~> 3, >= 3.188.0) 244 | aws-sigv4 (~> 1.1) 245 | aws-sdk-redshift (1.107.0) 246 | aws-sdk-core (~> 3, >= 3.188.0) 247 | aws-sigv4 (~> 1.1) 248 | aws-sdk-route53 (1.83.0) 249 | aws-sdk-core (~> 3, >= 3.188.0) 250 | aws-sigv4 (~> 1.1) 251 | aws-sdk-route53domains (1.54.0) 252 | aws-sdk-core (~> 3, >= 3.188.0) 253 | aws-sigv4 (~> 1.1) 254 | aws-sdk-route53resolver (1.51.0) 255 | aws-sdk-core (~> 3, >= 3.188.0) 256 | aws-sigv4 (~> 1.1) 257 | aws-sdk-s3 (1.141.0) 258 | aws-sdk-core (~> 3, >= 3.189.0) 259 | aws-sdk-kms (~> 1) 260 | aws-sigv4 (~> 1.8) 261 | aws-sdk-s3control (1.74.0) 262 | aws-sdk-core (~> 3, >= 3.188.0) 263 | aws-sigv4 (~> 1.1) 264 | aws-sdk-secretsmanager (1.87.0) 265 | aws-sdk-core (~> 3, >= 3.188.0) 266 | aws-sigv4 (~> 1.1) 267 | aws-sdk-securityhub (1.98.0) 268 | aws-sdk-core (~> 3, >= 3.188.0) 269 | aws-sigv4 (~> 1.1) 270 | aws-sdk-servicecatalog (1.90.0) 271 | aws-sdk-core (~> 3, >= 3.188.0) 272 | aws-sigv4 (~> 1.1) 273 | aws-sdk-ses (1.58.0) 274 | aws-sdk-core (~> 3, >= 3.188.0) 275 | aws-sigv4 (~> 1.1) 276 | aws-sdk-shield (1.60.0) 277 | aws-sdk-core (~> 3, >= 3.188.0) 278 | aws-sigv4 (~> 1.1) 279 | aws-sdk-signer (1.50.0) 280 | aws-sdk-core (~> 3, >= 3.188.0) 281 | aws-sigv4 (~> 1.1) 282 | aws-sdk-simpledb (1.42.0) 283 | aws-sdk-core (~> 3, >= 3.188.0) 284 | aws-sigv2 (~> 1.0) 285 | aws-sdk-sms (1.52.0) 286 | aws-sdk-core (~> 3, >= 3.188.0) 287 | aws-sigv4 (~> 1.1) 288 | aws-sdk-sns (1.70.0) 289 | aws-sdk-core (~> 3, >= 3.188.0) 290 | aws-sigv4 (~> 1.1) 291 | aws-sdk-sqs (1.69.0) 292 | aws-sdk-core (~> 3, >= 3.188.0) 293 | aws-sigv4 (~> 1.1) 294 | aws-sdk-ssm (1.162.0) 295 | aws-sdk-core (~> 3, >= 3.188.0) 296 | aws-sigv4 (~> 1.1) 297 | aws-sdk-states (1.63.0) 298 | aws-sdk-core (~> 3, >= 3.188.0) 299 | aws-sigv4 (~> 1.1) 300 | aws-sdk-synthetics (1.39.0) 301 | aws-sdk-core (~> 3, >= 3.188.0) 302 | aws-sigv4 (~> 1.1) 303 | aws-sdk-transfer (1.86.0) 304 | aws-sdk-core (~> 3, >= 3.188.0) 305 | aws-sigv4 (~> 1.1) 306 | aws-sdk-waf (1.58.0) 307 | aws-sdk-core (~> 3, >= 3.188.0) 308 | aws-sigv4 (~> 1.1) 309 | aws-sdk-wafv2 (1.74.0) 310 | aws-sdk-core (~> 3, >= 3.188.0) 311 | aws-sigv4 (~> 1.1) 312 | aws-sigv2 (1.2.0) 313 | aws-sigv4 (1.11.0) 314 | aws-eventstream (~> 1, >= 1.0.2) 315 | azure_graph_rbac (0.17.2) 316 | ms_rest_azure (~> 0.12.0) 317 | azure_mgmt_key_vault (0.17.7) 318 | ms_rest_azure (~> 0.12.0) 319 | azure_mgmt_resources (0.18.2) 320 | ms_rest_azure (~> 0.12.0) 321 | azure_mgmt_security (0.19.0) 322 | ms_rest_azure (~> 0.12.0) 323 | azure_mgmt_storage (0.23.0) 324 | ms_rest_azure (~> 0.12.0) 325 | base64 (0.2.0) 326 | bcrypt_pbkdf (1.1.1) 327 | bcrypt_pbkdf (1.1.1-x64-mingw-ucrt) 328 | benchmark (0.4.0) 329 | bigdecimal (3.1.9) 330 | bson (4.15.0) 331 | builder (3.3.0) 332 | chef-config (18.7.6) 333 | addressable 334 | chef-utils (= 18.7.6) 335 | fuzzyurl 336 | mixlib-config (>= 2.2.12, < 4.0) 337 | mixlib-shellout (>= 2.0, < 4.0) 338 | tomlrb (~> 1.2) 339 | chef-gyoku (1.4.5) 340 | builder (>= 2.1.2) 341 | rexml (~> 3.4) 342 | chef-telemetry (1.1.1) 343 | chef-config 344 | concurrent-ruby (~> 1.0) 345 | chef-utils (18.7.6) 346 | concurrent-ruby 347 | chef-winrm (2.3.12) 348 | builder (>= 2.1.2) 349 | chef-gyoku (~> 1.4.0, <= 1.4.5) 350 | erubi (~> 1.8) 351 | ffi (>= 1.15.5, < 1.17.0) 352 | gssapi (~> 1.2) 353 | httpclient (~> 2.2, >= 2.2.0.2) 354 | logging (>= 1.6.1, < 3.0) 355 | nori (= 2.7.0) 356 | rexml (~> 3.3) 357 | rubyntlm (~> 0.6.0, >= 0.6.3) 358 | chef-winrm-elevated (1.2.5) 359 | chef-winrm (>= 2.3.11) 360 | chef-winrm-fs (>= 1.3.7) 361 | erubi (~> 1.8) 362 | chef-winrm-fs (1.3.7) 363 | chef-winrm (>= 2.3.11) 364 | erubi (>= 1.7) 365 | logging (>= 1.6.1, < 3.0) 366 | rubyzip (~> 2.0) 367 | coderay (1.1.3) 368 | concurrent-ruby (1.3.5) 369 | connection_pool (2.5.3) 370 | cookstyle (8.1.2) 371 | rubocop (= 1.75.5) 372 | declarative (0.0.20) 373 | diff-lcs (1.6.2) 374 | docker-api (2.4.0) 375 | excon (>= 0.64.0) 376 | multi_json 377 | domain_name (0.6.20240107) 378 | drb (2.2.1) 379 | ed25519 (1.4.0) 380 | erubi (1.13.1) 381 | excon (1.2.5) 382 | logger 383 | faraday (1.10.4) 384 | faraday-em_http (~> 1.0) 385 | faraday-em_synchrony (~> 1.0) 386 | faraday-excon (~> 1.1) 387 | faraday-httpclient (~> 1.0) 388 | faraday-multipart (~> 1.0) 389 | faraday-net_http (~> 1.0) 390 | faraday-net_http_persistent (~> 1.0) 391 | faraday-patron (~> 1.0) 392 | faraday-rack (~> 1.0) 393 | faraday-retry (~> 1.0) 394 | ruby2_keywords (>= 0.0.4) 395 | faraday-cookie_jar (0.0.7) 396 | faraday (>= 0.8.0) 397 | http-cookie (~> 1.0.0) 398 | faraday-em_http (1.0.0) 399 | faraday-em_synchrony (1.0.0) 400 | faraday-excon (1.1.0) 401 | faraday-follow_redirects (0.3.0) 402 | faraday (>= 1, < 3) 403 | faraday-httpclient (1.0.1) 404 | faraday-multipart (1.1.0) 405 | multipart-post (~> 2.0) 406 | faraday-net_http (1.0.2) 407 | faraday-net_http_persistent (1.2.0) 408 | faraday-patron (1.0.0) 409 | faraday-rack (1.0.0) 410 | faraday-retry (1.0.3) 411 | faraday_middleware (1.0.0) 412 | faraday (~> 1.0) 413 | ffi (1.16.3) 414 | ffi (1.16.3-x64-mingw-ucrt) 415 | ffi-win32-extensions (1.0.4) 416 | ffi 417 | fuzzyurl (0.9.0) 418 | google-apis-admin_directory_v1 (0.46.0) 419 | google-apis-core (>= 0.11.0, < 2.a) 420 | google-apis-cloudkms_v1 (0.41.0) 421 | google-apis-core (>= 0.11.0, < 2.a) 422 | google-apis-cloudresourcemanager_v1 (0.35.0) 423 | google-apis-core (>= 0.11.0, < 2.a) 424 | google-apis-compute_v1 (0.83.0) 425 | google-apis-core (>= 0.11.0, < 2.a) 426 | google-apis-core (0.11.3) 427 | addressable (~> 2.5, >= 2.5.1) 428 | googleauth (>= 0.16.2, < 2.a) 429 | httpclient (>= 2.8.1, < 3.a) 430 | mini_mime (~> 1.0) 431 | representable (~> 3.0) 432 | retriable (>= 2.0, < 4.a) 433 | rexml 434 | google-apis-iam_v1 (0.50.0) 435 | google-apis-core (>= 0.11.0, < 2.a) 436 | google-apis-monitoring_v3 (0.51.0) 437 | google-apis-core (>= 0.11.0, < 2.a) 438 | google-apis-storage_v1 (0.30.0) 439 | google-apis-core (>= 0.11.0, < 2.a) 440 | googleauth (1.8.1) 441 | faraday (>= 0.17.3, < 3.a) 442 | jwt (>= 1.4, < 3.0) 443 | multi_json (~> 1.11) 444 | os (>= 0.9, < 2.0) 445 | signet (>= 0.16, < 2.a) 446 | gssapi (1.3.1) 447 | ffi (>= 1.0.1) 448 | gyoku (1.4.0) 449 | builder (>= 2.1.2) 450 | rexml (~> 3.0) 451 | hashie (4.1.0) 452 | highline (3.1.2) 453 | reline 454 | http-cookie (1.0.8) 455 | domain_name (~> 0.5) 456 | httpclient (2.9.0) 457 | mutex_m 458 | i18n (1.14.7) 459 | concurrent-ruby (~> 1.0) 460 | inifile (3.0.0) 461 | io-console (0.8.0) 462 | jmespath (1.6.2) 463 | json (2.12.0) 464 | jwt (2.10.1) 465 | base64 466 | kitchen-inspec (3.0.0) 467 | hashie (>= 3.4, <= 5.0) 468 | inspec (>= 2.2.64, < 7.0) 469 | test-kitchen (>= 2.7, < 4) 470 | kitchen-salt (0.7.2) 471 | hashie (>= 3.5) 472 | test-kitchen (>= 1.4) 473 | language_server-protocol (3.17.0.5) 474 | license-acceptance (2.1.13) 475 | pastel (~> 0.7) 476 | tomlrb (>= 1.2, < 3.0) 477 | tty-box (~> 0.6) 478 | tty-prompt (~> 0.20) 479 | lint_roller (1.1.0) 480 | little-plugger (1.1.4) 481 | logger (1.7.0) 482 | logging (2.4.0) 483 | little-plugger (~> 1.1) 484 | multi_json (~> 1.14) 485 | method_source (1.1.0) 486 | mini_mime (1.1.5) 487 | mini_portile2 (2.8.9) 488 | minitest (5.25.5) 489 | mixlib-config (3.0.27) 490 | tomlrb 491 | mixlib-install (3.12.30) 492 | mixlib-shellout 493 | mixlib-versioning 494 | thor 495 | mixlib-log (3.2.3) 496 | ffi (>= 1.15.5) 497 | mixlib-shellout (3.3.9) 498 | chef-utils 499 | mixlib-shellout (3.3.9-x64-mingw-ucrt) 500 | chef-utils 501 | ffi-win32-extensions (~> 1.0.3) 502 | win32-process (~> 0.9) 503 | wmi-lite (~> 1.0) 504 | mixlib-versioning (1.2.12) 505 | mongo (2.13.2) 506 | bson (>= 4.8.2, < 5.0.0) 507 | ms_rest (0.7.6) 508 | concurrent-ruby (~> 1.0) 509 | faraday (>= 0.9, < 2.0.0) 510 | timeliness (~> 0.3.10) 511 | ms_rest_azure (0.12.0) 512 | concurrent-ruby (~> 1.0) 513 | faraday (>= 0.9, < 2.0.0) 514 | faraday-cookie_jar (~> 0.0.6) 515 | ms_rest (~> 0.7.6) 516 | multi_json (1.15.0) 517 | multipart-post (2.4.1) 518 | mutex_m (0.3.0) 519 | net-scp (4.1.0) 520 | net-ssh (>= 2.6.5, < 8.0.0) 521 | net-ssh (7.3.0) 522 | net-ssh-gateway (2.0.0) 523 | net-ssh (>= 4.0.0) 524 | nokogiri (1.18.9) 525 | mini_portile2 (~> 2.8.2) 526 | racc (~> 1.4) 527 | nokogiri (1.18.9-x64-mingw-ucrt) 528 | racc (~> 1.4) 529 | nori (2.7.0) 530 | bigdecimal 531 | options (2.3.2) 532 | os (1.1.4) 533 | parallel (1.27.0) 534 | parser (3.3.8.0) 535 | ast (~> 2.4.1) 536 | racc 537 | parslet (1.8.2) 538 | pastel (0.8.0) 539 | tty-color (~> 0.5) 540 | prism (1.4.0) 541 | progress_bar (1.3.4) 542 | highline (>= 1.6) 543 | options (~> 2.3.0) 544 | pry (0.15.2) 545 | coderay (~> 1.1) 546 | method_source (~> 1.0) 547 | public_suffix (6.0.2) 548 | racc (1.8.1) 549 | rainbow (3.1.1) 550 | rake (13.2.1) 551 | regexp_parser (2.10.0) 552 | reline (0.6.1) 553 | io-console (~> 0.5) 554 | representable (3.2.0) 555 | declarative (< 0.1.0) 556 | trailblazer-option (>= 0.1.1, < 0.2.0) 557 | uber (< 0.2.0) 558 | retriable (3.1.2) 559 | rexml (3.4.1) 560 | roo (2.9.0) 561 | nokogiri (~> 1) 562 | rubyzip (>= 1.3.0, < 3.0.0) 563 | roo-xls (1.2.0) 564 | nokogiri 565 | roo (>= 2.0.0, < 3) 566 | spreadsheet (> 0.9.0) 567 | rspec (3.11.0) 568 | rspec-core (~> 3.11.0) 569 | rspec-expectations (~> 3.11.0) 570 | rspec-mocks (~> 3.11.0) 571 | rspec-core (3.11.0) 572 | rspec-support (~> 3.11.0) 573 | rspec-expectations (3.11.1) 574 | diff-lcs (>= 1.2.0, < 2.0) 575 | rspec-support (~> 3.11.0) 576 | rspec-its (1.3.1) 577 | rspec-core (>= 3.0.0) 578 | rspec-expectations (>= 3.0.0) 579 | rspec-mocks (3.11.2) 580 | diff-lcs (>= 1.2.0, < 2.0) 581 | rspec-support (~> 3.11.0) 582 | rspec-support (3.11.1) 583 | rubocop (1.75.5) 584 | json (~> 2.3) 585 | language_server-protocol (~> 3.17.0.2) 586 | lint_roller (~> 1.1.0) 587 | parallel (~> 1.10) 588 | parser (>= 3.3.0.2) 589 | rainbow (>= 2.2.2, < 4.0) 590 | regexp_parser (>= 2.9.3, < 3.0) 591 | rubocop-ast (>= 1.44.0, < 2.0) 592 | ruby-progressbar (~> 1.7) 593 | unicode-display_width (>= 2.4.0, < 4.0) 594 | rubocop-ast (1.44.1) 595 | parser (>= 3.3.7.2) 596 | prism (~> 1.4) 597 | ruby-ole (1.2.13.1) 598 | ruby-progressbar (1.13.0) 599 | ruby2_keywords (0.0.5) 600 | rubyntlm (0.6.5) 601 | base64 602 | rubyzip (2.4.1) 603 | securerandom (0.4.1) 604 | semverse (3.0.2) 605 | signet (0.20.0) 606 | addressable (~> 2.8) 607 | faraday (>= 0.17.5, < 3.a) 608 | jwt (>= 1.5, < 3.0) 609 | multi_json (~> 1.10) 610 | spreadsheet (1.3.4) 611 | bigdecimal 612 | logger 613 | ruby-ole 614 | sslshake (1.3.1) 615 | strings (0.2.1) 616 | strings-ansi (~> 0.2) 617 | unicode-display_width (>= 1.5, < 3.0) 618 | unicode_utils (~> 1.4) 619 | strings-ansi (0.2.0) 620 | test-kitchen (3.7.0) 621 | bcrypt_pbkdf (~> 1.0) 622 | chef-utils (>= 16.4.35) 623 | ed25519 (~> 1.2) 624 | license-acceptance (>= 1.0.11, < 3.0) 625 | mixlib-install (~> 3.6) 626 | mixlib-shellout (>= 1.2, < 4.0) 627 | net-scp (>= 1.1, < 5.0) 628 | net-ssh (>= 2.9, < 8.0) 629 | net-ssh-gateway (>= 1.2, < 3.0) 630 | thor (>= 0.19, < 2.0) 631 | winrm (~> 2.0) 632 | winrm-elevated (~> 1.0) 633 | winrm-fs (~> 1.1) 634 | thor (1.4.0) 635 | timeliness (0.3.10) 636 | tomlrb (1.3.0) 637 | trailblazer-option (0.1.2) 638 | train (3.12.13) 639 | activesupport (>= 6.0.3.1, < 7.2.0) 640 | azure_graph_rbac (~> 0.16) 641 | azure_mgmt_key_vault (~> 0.17) 642 | azure_mgmt_resources (~> 0.15) 643 | azure_mgmt_security (~> 0.18) 644 | azure_mgmt_storage (~> 0.18) 645 | docker-api (>= 1.26, < 3.0) 646 | google-apis-admin_directory_v1 (~> 0.46.0) 647 | google-apis-cloudkms_v1 (~> 0.41.0) 648 | google-apis-cloudresourcemanager_v1 (~> 0.35.0) 649 | google-apis-compute_v1 (~> 0.83.0) 650 | google-apis-iam_v1 (~> 0.50.0) 651 | google-apis-monitoring_v3 (~> 0.51.0) 652 | google-apis-storage_v1 (~> 0.30.0) 653 | googleauth (>= 0.16.2, < 1.9.0) 654 | inifile (~> 3.0) 655 | train-core (= 3.12.13) 656 | train-winrm (~> 0.2.19) 657 | train-aws (0.2.41) 658 | aws-partitions (~> 1.863.0) 659 | aws-sdk-accessanalyzer (~> 1.44.0) 660 | aws-sdk-account (~> 1.20.0) 661 | aws-sdk-alexaforbusiness (~> 1.67.0) 662 | aws-sdk-amplify (~> 1.54.0) 663 | aws-sdk-apigateway (~> 1.90.0) 664 | aws-sdk-apigatewayv2 (~> 1.53.0) 665 | aws-sdk-applicationautoscaling (~> 1.79.0) 666 | aws-sdk-athena (>= 1.78, < 1.80) 667 | aws-sdk-autoscaling (= 1.102.0) 668 | aws-sdk-batch (~> 1.79.0) 669 | aws-sdk-budgets (~> 1.62.0) 670 | aws-sdk-cloudformation (>= 1.96, < 1.98) 671 | aws-sdk-cloudfront (~> 1.86.0) 672 | aws-sdk-cloudhsm (~> 1.50.0) 673 | aws-sdk-cloudhsmv2 (~> 1.53.0) 674 | aws-sdk-cloudtrail (~> 1.74.0) 675 | aws-sdk-cloudwatch (~> 1.83.0) 676 | aws-sdk-cloudwatchevents (~> 1.69.0) 677 | aws-sdk-cloudwatchlogs (~> 1.75) 678 | aws-sdk-codecommit (~> 1.62.0) 679 | aws-sdk-codedeploy (~> 1.62.0) 680 | aws-sdk-codepipeline (~> 1.67.0) 681 | aws-sdk-cognitoidentity (~> 1.51.0) 682 | aws-sdk-cognitoidentityprovider (~> 1.84) 683 | aws-sdk-configservice (~> 1.103.0) 684 | aws-sdk-core (~> 3.190.0) 685 | aws-sdk-costandusagereportservice (~> 1.53.0) 686 | aws-sdk-databasemigrationservice (~> 1.91.0) 687 | aws-sdk-dynamodb (~> 1.98.0) 688 | aws-sdk-ec2 (>= 1.427, < 1.430) 689 | aws-sdk-ecr (~> 1.68.0) 690 | aws-sdk-ecrpublic (~> 1.25.0) 691 | aws-sdk-ecs (~> 1.135.0) 692 | aws-sdk-efs (~> 1.71.0) 693 | aws-sdk-eks (~> 1.95.0) 694 | aws-sdk-elasticache (~> 1.95.0) 695 | aws-sdk-elasticbeanstalk (~> 1.63.0) 696 | aws-sdk-elasticloadbalancing (~> 1.51.0) 697 | aws-sdk-elasticloadbalancingv2 (~> 1.96.0) 698 | aws-sdk-elasticsearchservice (~> 1.79.0) 699 | aws-sdk-emr (~> 1.81.0) 700 | aws-sdk-eventbridge (~> 1.54.0) 701 | aws-sdk-firehose (~> 1.60.0) 702 | aws-sdk-glue (~> 1.164) 703 | aws-sdk-guardduty (~> 1.85.0) 704 | aws-sdk-iam (~> 1.92.0) 705 | aws-sdk-kafka (~> 1.67.0) 706 | aws-sdk-kinesis (~> 1.54.0) 707 | aws-sdk-kms (~> 1.74) 708 | aws-sdk-lambda (~> 1.113.0) 709 | aws-sdk-macie2 (~> 1.64.0) 710 | aws-sdk-mq (~> 1.58.0) 711 | aws-sdk-networkfirewall (~> 1.39.0) 712 | aws-sdk-networkmanager (~> 1.40.0) 713 | aws-sdk-organizations (~> 1.83.0) 714 | aws-sdk-ram (~> 1.52.0) 715 | aws-sdk-rds (~> 1.208.0) 716 | aws-sdk-redshift (~> 1.107.0) 717 | aws-sdk-route53 (~> 1.83.0) 718 | aws-sdk-route53domains (~> 1.54.0) 719 | aws-sdk-route53resolver (~> 1.51.0) 720 | aws-sdk-s3 (~> 1.141.0) 721 | aws-sdk-s3control (~> 1.74.0) 722 | aws-sdk-secretsmanager (~> 1.87.0) 723 | aws-sdk-securityhub (~> 1.98.0) 724 | aws-sdk-servicecatalog (~> 1.90.0) 725 | aws-sdk-ses (~> 1.58.0) 726 | aws-sdk-shield (~> 1.60.0) 727 | aws-sdk-signer (~> 1.50.0) 728 | aws-sdk-simpledb (~> 1.42.0) 729 | aws-sdk-sms (~> 1.52.0) 730 | aws-sdk-sns (~> 1.70.0) 731 | aws-sdk-sqs (~> 1.69.0) 732 | aws-sdk-ssm (~> 1.162.0) 733 | aws-sdk-states (~> 1.63.0) 734 | aws-sdk-synthetics (~> 1.39.0) 735 | aws-sdk-transfer (~> 1.86.0) 736 | aws-sdk-waf (~> 1.58.0) 737 | aws-sdk-wafv2 (~> 1.74.0) 738 | train-core (3.12.13) 739 | addressable (~> 2.5) 740 | ffi (!= 1.13.0) 741 | json (>= 1.8, < 3.0) 742 | mixlib-shellout (>= 2.0, < 4.0) 743 | net-scp (>= 1.2, < 5.0) 744 | net-ssh (>= 2.9, < 8.0) 745 | train-habitat (0.2.22) 746 | train-winrm (0.2.19) 747 | chef-winrm (~> 2.3.12) 748 | chef-winrm-elevated (~> 1.2.5) 749 | chef-winrm-fs (~> 1.3.7) 750 | tty-box (0.7.0) 751 | pastel (~> 0.8) 752 | strings (~> 0.2.0) 753 | tty-cursor (~> 0.7) 754 | tty-color (0.6.0) 755 | tty-cursor (0.7.1) 756 | tty-prompt (0.23.1) 757 | pastel (~> 0.8) 758 | tty-reader (~> 0.8) 759 | tty-reader (0.9.0) 760 | tty-cursor (~> 0.7) 761 | tty-screen (~> 0.8) 762 | wisper (~> 2.0) 763 | tty-screen (0.8.2) 764 | tty-table (0.12.0) 765 | pastel (~> 0.8) 766 | strings (~> 0.2.0) 767 | tty-screen (~> 0.8) 768 | tzinfo (2.0.6) 769 | concurrent-ruby (~> 1.0) 770 | uber (0.1.0) 771 | unicode-display_width (2.6.0) 772 | unicode_utils (1.4.0) 773 | win32-process (0.10.0) 774 | ffi (>= 1.0.0) 775 | winrm (2.3.8) 776 | builder (>= 2.1.2) 777 | erubi (~> 1.8) 778 | gssapi (~> 1.2) 779 | gyoku (~> 1.0) 780 | httpclient (~> 2.2, >= 2.2.0.2) 781 | logging (>= 1.6.1, < 3.0) 782 | nori (~> 2.0) 783 | rexml (~> 3.0) 784 | rubyntlm (~> 0.6.0, >= 0.6.3) 785 | winrm-elevated (1.2.3) 786 | erubi (~> 1.8) 787 | winrm (~> 2.0) 788 | winrm-fs (~> 1.0) 789 | winrm-fs (1.3.5) 790 | erubi (~> 1.8) 791 | logging (>= 1.6.1, < 3.0) 792 | rubyzip (~> 2.0) 793 | winrm (~> 2.0) 794 | wisper (2.0.1) 795 | wmi-lite (1.0.7) 796 | 797 | PLATFORMS 798 | ruby 799 | x64-mingw-ucrt 800 | 801 | DEPENDENCIES 802 | inspec! 803 | kitchen-docker! 804 | kitchen-inspec (= 3.0.0) 805 | kitchen-salt (= 0.7.2) 806 | net-ssh (>= 7.0.0) 807 | test-kitchen (= 3.7.0) 808 | 809 | BUNDLED WITH 810 | 2.3.7 811 | --------------------------------------------------------------------------------