Merge branch 'master' into add-mysql-community-package

This commit is contained in:
N 2020-12-03 23:24:01 +00:00 committed by GitHub
commit 03efdaf47f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 3043 additions and 516 deletions

16
.github/workflows/commitlint.yml vendored Normal file
View file

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
name: Commitlint
'on': [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v1

126
.gitignore vendored
View file

@ -1,4 +1,122 @@
*.pyc # Byte-compiled / optimized / DLL files
*~ __pycache__/
Gemfile.lock *.py[cod]
.kitchen/ *$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a packager
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.kitchen
.kitchen.local.yml
kitchen.local.yml
junit-*.xml
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# Bundler
.bundle/
# copied `.md` files used for conversion to `.rst` using `m2r`
docs/*.md
# Vim
*.sw?
## Collected when centralising formulas (check and sort)
# `collectd-formula`
.pytest_cache/
/.idea/
Dockerfile.*_*
ignore/
tmp/

View file

@ -1,6 +0,0 @@
---
driver:
name: docker
hostname: salt-formula.ci.local
use_sudo: true
require_chef_omnibus: false

View file

@ -1,31 +0,0 @@
<%
require 'yaml'
formula = YAML.load_file('FORMULA')
formula_name = formula['name']
%>
---
verifier:
name: inspec
platforms:
- name: ubuntu-16.04
- name: ubuntu-18.04
- name: debian-9
- name: centos-7
provisioner:
name: salt_solo
salt_install: bootstrap
salt_bootstrap_url: https://bootstrap.saltstack.com
salt_version: latest
salt_pillar_root: pillar.example
log_level: <%= ENV['SALT_DEBUG_LEVEL'] || 'info' %>
formula: <%= formula_name %>
state_top:
base:
'*':
- <%= formula_name %>
suites:
- name: default

56
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [commit]
repos:
- repo: https://github.com/dafyddj/commitlint-pre-commit-hook
rev: v2.3.0
hooks:
- id: commitlint
name: Check commit message using commitlint
description: Lint commit message against @commitlint/config-conventional rules
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
- id: commitlint-travis
stages: [manual]
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
always_run: true
- repo: https://github.com/adithyabsk/mirrors-rubocop
rev: v0.91.0
hooks:
- id: rubocop
name: Check Ruby files with rubocop
args: [--debug]
always_run: true
pass_filenames: false
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.3
hooks:
- id: shellcheck
name: Check shell scripts with shellcheck
files: ^.*\.(sh|bash|ksh)$
types: []
args: []
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.23.0
hooks:
- id: yamllint
name: Check YAML syntax with yamllint
args: [--strict, '.']
always_run: true
pass_filenames: false
- repo: https://github.com/warpnet/salt-lint
rev: v0.3.0
hooks:
- id: salt-lint
name: Check Salt files using salt-lint
files: ^.*\.(sls|jinja|j2|tmpl|tst)$
- repo: https://github.com/myint/rstcheck
rev: 3f929574
hooks:
- id: rstcheck
name: Check reST files using rstcheck
exclude: 'docs/CHANGELOG.rst'
args: [--report=warning]

3
.rstcheck.cfg Normal file
View file

@ -0,0 +1,3 @@
[rstcheck]
report=error
ignore_language=rst

16
.rubocop.yml Normal file
View file

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# General overrides used across formulas in the org
Layout/LineLength:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
Max: 88
Metrics/BlockLength:
ExcludedMethods:
- control
- describe
# Increase from default of `25`
Max: 30
# Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`

17
.salt-lint Normal file
View file

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
exclude_paths: []
rules: {}
skip_list:
# TODO: Formula-specific override to remove eventually
# A lot of attention is going to be needed to resolve the existing long lines
- 204 # Lines should be no longer that 160 chars
# Using `salt-lint` for linting other files as well, such as Jinja macros/templates
- 205 # Use ".sls" as a Salt State file extension
# Skipping `207` and `208` because `210` is sufficient, at least for the time-being
# I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755`
- 207 # File modes should always be encapsulated in quotation marks
- 208 # File modes should always contain a leading zero
tags: []
verbosity: 1

View file

@ -1,26 +1,143 @@
language: ruby # -*- coding: utf-8 -*-
# vim: ft=yaml
---
## Machine config
os: 'linux'
arch: 'amd64'
dist: 'bionic'
version: '~> 1.0'
rvm: ## Language and cache config
- 2.2.5 language: 'ruby'
cache: 'bundler'
sudo: required ## Services config
services: docker services:
- docker
env:
matrix:
- INSTANCE=default-ubuntu-1604
- INSTANCE=default-ubuntu-1804
- INSTANCE=default-debian-9
- INSTANCE=centos-7
# https://github.com/zuazo/kitchen-in-travis-native/issues/1#issuecomment-142455888
before_script: sudo iptables -L DOCKER || sudo iptables -N DOCKER
install:
# setup ci for test formula
- export BUNDLE_GEMFILE=$PWD/Gemfile
- bundle install
## Script to run for the test stage
script: script:
# Run unit tests - bin/kitchen verify "${INSTANCE}"
- KITCHEN_LOCAL_YAML=.kitchen.docker.yml bundle exec kitchen verify ${INSTANCE}
## Stages and jobs matrix
stages:
- test
- name: 'release'
if: 'branch = master AND type != pull_request'
jobs:
include:
## Define the test stage that runs the linters (and testing matrix, if applicable)
# Run all of the linters in a single job
- language: 'node_js'
node_js: 'lts/*'
env: 'Lint'
name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
before_install: 'skip'
script:
# Install and run `salt-lint`
- pip install --user salt-lint
- git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst'
| xargs salt-lint
# Install and run `yamllint`
# Need at least `v1.17.0` for the `yaml-files` setting
- pip install --user yamllint>=1.17.0
- yamllint -s .
# Install and run `rubocop`
- gem install rubocop
- rubocop -d
# Run `shellcheck` (already pre-installed in Travis)
- shellcheck --version
- git ls-files -- '*.sh' '*.bash' '*.ksh'
| xargs shellcheck
# Install and run `commitlint`
- npm i -D @commitlint/config-conventional
@commitlint/travis-cli
- commitlint-travis
# Run `pre-commit` linters in a single job
- language: 'python'
env: 'Lint_pre-commit'
name: 'Lint: pre-commit'
before_install: 'skip'
cache:
directories:
- $HOME/.cache/pre-commit
script:
# Install and run `pre-commit`
- pip install pre-commit==2.7.1
- pre-commit run --all-files --color always --verbose
- pre-commit run --color always --hook-stage manual --verbose commitlint-travis
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
- env: INSTANCE=default-debian-10-master-py3
- env: INSTANCE=default-ubuntu-2004-master-py3
# - env: INSTANCE=default-ubuntu-1804-master-py3
# - env: INSTANCE=default-centos-8-master-py3
# - env: INSTANCE=default-fedora-32-master-py3
# - env: INSTANCE=default-fedora-31-master-py3
# - env: INSTANCE=default-opensuse-leap-152-master-py3
# - env: INSTANCE=default-amazonlinux-2-master-py3
# - env: INSTANCE=default-debian-10-3000-3-py3
- env: INSTANCE=default-debian-9-3000-3-py3
- env: INSTANCE=default-ubuntu-1804-3000-3-py3
# - env: INSTANCE=default-centos-8-3000-3-py3
# - env: INSTANCE=default-centos-7-3000-3-py3
# - env: INSTANCE=default-fedora-31-3000-3-py3
# - env: INSTANCE=default-opensuse-leap-152-3000-3-py3
# - env: INSTANCE=default-amazonlinux-2-3000-3-py3
# - env: INSTANCE=default-ubuntu-1804-3000-3-py2
# - env: INSTANCE=default-ubuntu-1604-3000-3-py2
# - env: INSTANCE=default-arch-base-latest-3000-3-py2
# - env: INSTANCE=default-debian-10-2019-2-py3
# - env: INSTANCE=default-debian-9-2019-2-py3
# - env: INSTANCE=default-ubuntu-1804-2019-2-py3
- env: INSTANCE=default-ubuntu-1604-2019-2-py3
# - env: INSTANCE=default-centos-8-2019-2-py3
# - env: INSTANCE=default-centos-7-2019-2-py3
# - env: INSTANCE=default-fedora-31-2019-2-py3
# - env: INSTANCE=default-opensuse-leap-152-2019-2-py3
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
# - env: INSTANCE=default-centos-6-2019-2-py2
# - env: INSTANCE=default-amazonlinux-1-2019-2-py2
# - env: INSTANCE=default-arch-base-latest-2019-2-py2
## Define the release stage that runs `semantic-release`
- stage: 'release'
language: 'node_js'
node_js: 'lts/*'
env: 'Release'
name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA'
before_install: 'skip'
script:
# Update `AUTHORS.md`
- export MAINTAINER_TOKEN=${GH_TOKEN}
- go get github.com/myii/maintainer
- maintainer contributor
# Install all dependencies required for `semantic-release`
- npm i -D @semantic-release/changelog@3
@semantic-release/exec@3
@semantic-release/git@7
deploy:
provider: 'script'
# Opt-in to `dpl v2` to complete the Travis build config validation (beta)
# * https://docs.travis-ci.com/user/build-config-validation
# Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default
edge: true
# Run `semantic-release`
script: 'npx semantic-release@15.14'
# Notification options: `always`, `never` or `change`
notifications:
webhooks:
if: 'repo = saltstack-formulas/mysql-formula'
urls:
- https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=saltstack-formulas%2Fmysql-formula&ignore_pull_requests=true
on_success: always # default: always
on_failure: always # default: always
on_start: always # default: never
on_cancel: always # default: always
on_error: always # default: always

38
.yamllint Normal file
View file

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Extend the `default` configuration provided by `yamllint`
extends: default
# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any SLS files under directory `test/`, which are actually state files
# 3. Any YAML files under directory `.kitchen/`, introduced during local testing
# 4. Any YAML files using Jinja (result in `yamllint` syntax errors)
ignore: |
node_modules/
test/**/states/**/*.sls
.kitchen/
mysql/supported_sections.yaml
yaml-files:
# Default settings
- '*.yaml'
- '*.yml'
- .salt-lint
- .yamllint
# SaltStack Formulas additional settings
- '*.example'
- test/**/*.sls
rules:
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
line-length:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
max: 88
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true

88
AUTHORS.md Normal file
View file

@ -0,0 +1,88 @@
# Authors
This list is sorted by the number of commits per contributor in _descending_ order.
Avatar|Contributor|Contributions
:-:|---|:-:
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>|[@myii](https://github.com/myii)|65
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>|[@gravyboat](https://github.com/gravyboat)|38
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>|[@aboe76](https://github.com/aboe76)|37
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>|[@nmadhok](https://github.com/nmadhok)|28
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/91293?v=4' width='36' height='36' alt='@whiteinge'>|[@whiteinge](https://github.com/whiteinge)|27
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>|[@noelmcloughlin](https://github.com/noelmcloughlin)|18
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>|[@alxwr](https://github.com/alxwr)|14
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/1184479?v=4' width='36' height='36' alt='@cheuschober'>|[@cheuschober](https://github.com/cheuschober)|11
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/117961?v=4' width='36' height='36' alt='@babilen5'>|[@babilen5](https://github.com/babilen5)|11
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/56635?v=4' width='36' height='36' alt='@pprkut'>|[@pprkut](https://github.com/pprkut)|9
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/287147?v=4' width='36' height='36' alt='@techhat'>|[@techhat](https://github.com/techhat)|7
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/533172?v=4' width='36' height='36' alt='@roock'>|[@roock](https://github.com/roock)|6
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/727535?v=4' width='36' height='36' alt='@Routhinator'>|[@Routhinator](https://github.com/Routhinator)|5
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/528061?v=4' width='36' height='36' alt='@puneetk'>|[@puneetk](https://github.com/puneetk)|5
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1002811?v=4' width='36' height='36' alt='@davidjb'>|[@davidjb](https://github.com/davidjb)|5
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/7139195?v=4' width='36' height='36' alt='@xenophonf'>|[@xenophonf](https://github.com/xenophonf)|4
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/507599?v=4' width='36' height='36' alt='@thatch45'>|[@thatch45](https://github.com/thatch45)|4
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/1773291?v=4' width='36' height='36' alt='@toanju'>|[@toanju](https://github.com/toanju)|4
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/398720?v=4' width='36' height='36' alt='@tiger-seo'>|[@tiger-seo](https://github.com/tiger-seo)|4
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/732321?v=4' width='36' height='36' alt='@gtmanfred'>|[@gtmanfred](https://github.com/gtmanfred)|4
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/142916?v=4' width='36' height='36' alt='@alexhayes'>|[@alexhayes](https://github.com/alexhayes)|3
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/2804767?v=4' width='36' height='36' alt='@alfonsfoubert'>|[@alfonsfoubert](https://github.com/alfonsfoubert)|3
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/146882?v=4' width='36' height='36' alt='@cboltz'>|[@cboltz](https://github.com/cboltz)|3
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/358074?v=4' width='36' height='36' alt='@pcdummy'>|[@pcdummy](https://github.com/pcdummy)|3
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/46799934?v=4' width='36' height='36' alt='@sticky-note'>|[@sticky-note](https://github.com/sticky-note)|3
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/941928?v=4' width='36' height='36' alt='@amontalban'>|[@amontalban](https://github.com/amontalban)|2
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/20441?v=4' width='36' height='36' alt='@iggy'>|[@iggy](https://github.com/iggy)|2
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/5789536?v=4' width='36' height='36' alt='@ogabrielsantos'>|[@ogabrielsantos](https://github.com/ogabrielsantos)|2
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/279094?v=4' width='36' height='36' alt='@kaharlichenko'>|[@kaharlichenko](https://github.com/kaharlichenko)|2
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>|[@javierbertoli](https://github.com/javierbertoli)|2
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/3842066?v=4' width='36' height='36' alt='@neuhalje'>|[@neuhalje](https://github.com/neuhalje)|2
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/3768412?v=4' width='36' height='36' alt='@stp-ip'>|[@stp-ip](https://github.com/stp-ip)|2
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/2753036?v=4' width='36' height='36' alt='@RonWilliams'>|[@RonWilliams](https://github.com/RonWilliams)|2
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/4956475?v=4' width='36' height='36' alt='@ross-p'>|[@ross-p](https://github.com/ross-p)|2
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1809538?v=4' width='36' height='36' alt='@sray'>|[@sray](https://github.com/sray)|2
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/642928?v=4' width='36' height='36' alt='@tomasfejfar'>|[@tomasfejfar](https://github.com/tomasfejfar)|2
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/1482937?v=4' width='36' height='36' alt='@vschum'>|[@vschum](https://github.com/vschum)|2
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/1731256?v=4' width='36' height='36' alt='@madflojo'>|[@madflojo](https://github.com/madflojo)|2
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/306240?v=4' width='36' height='36' alt='@UtahDave'>|[@UtahDave](https://github.com/UtahDave)|2
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/52996?v=4' width='36' height='36' alt='@daks'>|[@daks](https://github.com/daks)|2
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/3833337?v=4' width='36' height='36' alt='@nesteves'>|[@nesteves](https://github.com/nesteves)|2
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/4608417?v=4' width='36' height='36' alt='@1exx'>|[@1exx](https://github.com/1exx)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/11548856?v=4' width='36' height='36' alt='@aaronm-cloudtek'>|[@aaronm-cloudtek](https://github.com/aaronm-cloudtek)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/479001?v=4' width='36' height='36' alt='@Achimh3011'>|[@Achimh3011](https://github.com/Achimh3011)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/762280?v=4' width='36' height='36' alt='@asenci'>|[@asenci](https://github.com/asenci)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/330045?v=4' width='36' height='36' alt='@word'>|[@word](https://github.com/word)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/445200?v=4' width='36' height='36' alt='@arthurlogilab'>|[@arthurlogilab](https://github.com/arthurlogilab)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/218060?v=4' width='36' height='36' alt='@johnklehm'>|[@johnklehm](https://github.com/johnklehm)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/6368493?v=4' width='36' height='36' alt='@tardypad'>|[@tardypad](https://github.com/tardypad)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/1196632?v=4' width='36' height='36' alt='@dosercz'>|[@dosercz](https://github.com/dosercz)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/7666055?v=4' width='36' height='36' alt='@sivir'>|[@sivir](https://github.com/sivir)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/328598?v=4' width='36' height='36' alt='@terminalmage'>|[@terminalmage](https://github.com/terminalmage)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/337608?v=4' width='36' height='36' alt='@replicant0wnz'>|[@replicant0wnz](https://github.com/replicant0wnz)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/418769?v=4' width='36' height='36' alt='@GeJ'>|[@GeJ](https://github.com/GeJ)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/94157?v=4' width='36' height='36' alt='@imran1008'>|[@imran1008](https://github.com/imran1008)|1
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/2150143?v=4' width='36' height='36' alt='@JubbaSmail'>|[@JubbaSmail](https://github.com/JubbaSmail)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/34903?v=4' width='36' height='36' alt='@h4ck3rm1k3'>|[@h4ck3rm1k3](https://github.com/h4ck3rm1k3)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/667455?v=4' width='36' height='36' alt='@dijit'>|[@dijit](https://github.com/dijit)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/952828?v=4' width='36' height='36' alt='@joejulian'>|[@joejulian](https://github.com/joejulian)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/668449?v=4' width='36' height='36' alt='@stromnet'>|[@stromnet](https://github.com/stromnet)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3956745?v=4' width='36' height='36' alt='@thejcannon'>|[@thejcannon](https://github.com/thejcannon)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/6354880?v=4' width='36' height='36' alt='@TaiSHiNet'>|[@TaiSHiNet](https://github.com/TaiSHiNet)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/296523?v=4' width='36' height='36' alt='@mkotsbak'>|[@mkotsbak](https://github.com/mkotsbak)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/188214?v=4' width='36' height='36' alt='@miska'>|[@miska](https://github.com/miska)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/805439?v=4' width='36' height='36' alt='@natehouk'>|[@natehouk](https://github.com/natehouk)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/804806?v=4' width='36' height='36' alt='@phil-lavin'>|[@phil-lavin](https://github.com/phil-lavin)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/22398368?v=4' width='36' height='36' alt='@S-Wilhelm'>|[@S-Wilhelm](https://github.com/S-Wilhelm)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/327943?v=4' width='36' height='36' alt='@Cottser'>|[@Cottser](https://github.com/Cottser)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/56102?v=4' width='36' height='36' alt='@soniah'>|[@soniah](https://github.com/soniah)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/26336?v=4' width='36' height='36' alt='@tony'>|[@tony](https://github.com/tony)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/326786?v=4' width='36' height='36' alt='@wido'>|[@wido](https://github.com/wido)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/751889?v=4' width='36' height='36' alt='@Yoda-BZH'>|[@Yoda-BZH](https://github.com/Yoda-BZH)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/228723?v=4' width='36' height='36' alt='@abednarik'>|[@abednarik](https://github.com/abednarik)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/546883?v=4' width='36' height='36' alt='@jam13'>|[@jam13](https://github.com/jam13)|1
<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/715563?v=4' width='36' height='36' alt='@getSurreal'>|[@getSurreal](https://github.com/getSurreal)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1132799?v=4' width='36' height='36' alt='@slawekp'>|[@slawekp](https://github.com/slawekp)|1
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1386595?v=4' width='36' height='36' alt='@tsia'>|[@tsia](https://github.com/tsia)|1
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/3351040?v=4' width='36' height='36' alt='@zhujinhe'>|[@zhujinhe](https://github.com/zhujinhe)|1
---
Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2020-08-27.

172
CHANGELOG.md Normal file
View file

@ -0,0 +1,172 @@
# Changelog
## [0.54.2](https://github.com/saltstack-formulas/mysql-formula/compare/v0.54.1...v0.54.2) (2020-08-27)
### Bug Fixes
* **indent:** properly indent file.directory block ([7791268](https://github.com/saltstack-formulas/mysql-formula/commit/7791268d133d557d21414365db59dc14c8f97f74)), closes [#250](https://github.com/saltstack-formulas/mysql-formula/issues/250)
## [0.54.1](https://github.com/saltstack-formulas/mysql-formula/compare/v0.54.0...v0.54.1) (2020-08-24)
### Bug Fixes
* **freebsd:** upgrade to mysql57-server ([ec68199](https://github.com/saltstack-formulas/mysql-formula/commit/ec681995b4f7e23a8dbec63809d3704f19ec9299))
# [0.54.0](https://github.com/saltstack-formulas/mysql-formula/compare/v0.53.0...v0.54.0) (2020-07-10)
### Continuous Integration
* **kitchen:** use `saltimages` Docker Hub where available [skip ci] ([b37a8a7](https://github.com/saltstack-formulas/mysql-formula/commit/b37a8a7c970cb30ed18f04c4103c5f553557699d))
### Features
* **socket_authentication:** allow unix_socket authentication ([8eccd5a](https://github.com/saltstack-formulas/mysql-formula/commit/8eccd5a68cadde02f54467a7fb9e370d2ee7d574))
# [0.53.0](https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.7...v0.53.0) (2020-06-01)
### Continuous Integration
* **kitchen+travis:** use latest pre-salted images ([7ea518a](https://github.com/saltstack-formulas/mysql-formula/commit/7ea518a3919f1a59bc6ae821bc0df7577629059a))
* **travis:** add notifications => zulip [skip ci] ([8adfc4b](https://github.com/saltstack-formulas/mysql-formula/commit/8adfc4bb4fbb49548cf46d277a0403b89c180b1a))
### Features
* **focal:** add settings for `ubuntu-20.04` ([0d77164](https://github.com/saltstack-formulas/mysql-formula/commit/0d77164f394909ec371f39cb41a4920c82e75052))
## [0.52.7](https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.6...v0.52.7) (2020-05-19)
### Bug Fixes
* **osfamilymap.yaml:** update SUSE defaults ([8ee79a7](https://github.com/saltstack-formulas/mysql-formula/commit/8ee79a7bb03488e4c3632a1dcfe143696a11aad5))
### Continuous Integration
* **gemfile.lock:** add to repo with updated `Gemfile` [skip ci] ([9e9fa3e](https://github.com/saltstack-formulas/mysql-formula/commit/9e9fa3e3d15e25ad22f75eae61af4883c79b7c0f))
* **kitchen+travis:** remove `master-py2-arch-base-latest` [skip ci] ([c1dddc3](https://github.com/saltstack-formulas/mysql-formula/commit/c1dddc3a8d561847094bbe23fe2c764c8fdf79de))
* **workflows/commitlint:** add to repo [skip ci] ([b4c6570](https://github.com/saltstack-formulas/mysql-formula/commit/b4c65702b91e8813741bf72008e41d1d8dfc735d))
## [0.52.6](https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.5...v0.52.6) (2020-04-17)
### Bug Fixes
* **reload-modules:** do `reload_modules` on py module installation ([2b6e704](https://github.com/saltstack-formulas/mysql-formula/commit/2b6e704c96d0373aadb56f90d758c960f538abdb))
### Continuous Integration
* **gemfile:** restrict `train` gem version until upstream fix [skip ci] ([04f75a7](https://github.com/saltstack-formulas/mysql-formula/commit/04f75a7a3b43de9425a8f36dc202b7ecf0c4f856))
* **kitchen:** avoid using bootstrap for `master` instances [skip ci] ([ef7a2ce](https://github.com/saltstack-formulas/mysql-formula/commit/ef7a2ce2d857dd271ec0704ab951c8337cb6b64e))
* **travis:** use `major.minor` for `semantic-release` version [skip ci] ([b4f5f79](https://github.com/saltstack-formulas/mysql-formula/commit/b4f5f79781631d7d31061b880df3066ac5bc5860))
## [0.52.5](https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.4...v0.52.5) (2019-12-10)
### Bug Fixes
* **db_load:** preserve space between -h and -p on the db load `cmd.wait` ([a05f263](https://github.com/saltstack-formulas/mysql-formula/commit/a05f263f4b9eac52a5854fd57a6a24f997ccb291))
## [0.52.4](https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.3...v0.52.4) (2019-12-03)
### Styles
* remove previous line from jinja directives ([ec0e2a7](https://github.com/saltstack-formulas/mysql-formula/commit/ec0e2a765a587d0df94b0afb9f7a4ef78a5319ab))
## [0.52.3](https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.2...v0.52.3) (2019-12-03)
### Bug Fixes
* **mac_shortcut.sh:** fix `shellcheck` errors ([7b309f8](https://github.com/saltstack-formulas/mysql-formula/commit/7b309f8da272ebdcb36dbfa7619a0fc9872a79a7))
* **release.config.js:** use full commit hash in commit link [skip ci] ([3f51b8b](https://github.com/saltstack-formulas/mysql-formula/commit/3f51b8bbc231a7455e6763b415221abff636d8a2))
### Continuous Integration
* **kitchen:** use `debian-10-master-py3` instead of `develop` [skip ci] ([5efe938](https://github.com/saltstack-formulas/mysql-formula/commit/5efe9387fde63e0c09d99d5771f3b623fb934242))
* **kitchen:** use `develop` image until `master` is ready (`amazonlinux`) [skip ci] ([63bfb4a](https://github.com/saltstack-formulas/mysql-formula/commit/63bfb4a0f25b62bdc45c1738d438ce5ec64f2183))
* **kitchen+travis:** upgrade matrix after `2019.2.2` release [skip ci] ([27ac5a3](https://github.com/saltstack-formulas/mysql-formula/commit/27ac5a3f684325a8e15736bb85d4774807061534))
* **travis:** apply changes from build config validation [skip ci] ([d520848](https://github.com/saltstack-formulas/mysql-formula/commit/d520848c815a9c2815ee3f1943e3e3962a26c7cf))
* **travis:** opt-in to `dpl v2` to complete build config validation [skip ci] ([1a8d914](https://github.com/saltstack-formulas/mysql-formula/commit/1a8d914fbd5e43f78ee2334b9c5ccd51ee65ad57))
* **travis:** quote pathspecs used with `git ls-files` [skip ci] ([3fb5a82](https://github.com/saltstack-formulas/mysql-formula/commit/3fb5a82de66dda9a05decc5ee7263729ef913533))
* **travis:** run `shellcheck` during lint job [skip ci] ([0931835](https://github.com/saltstack-formulas/mysql-formula/commit/0931835f1cfc77022a43242bd3ab04cbed2a3a02))
* **travis:** update `salt-lint` config for `v0.0.10` [skip ci] ([1512279](https://github.com/saltstack-formulas/mysql-formula/commit/1512279c2eac26638720461cc7e847d93d2c77d6))
* **travis:** use build config validation (beta) [skip ci] ([40d4b97](https://github.com/saltstack-formulas/mysql-formula/commit/40d4b9763f252f5811d31b2b2df156260bde2b6d))
### Documentation
* **contributing:** remove to use org-level file instead [skip ci] ([6afcc80](https://github.com/saltstack-formulas/mysql-formula/commit/6afcc80396dc4ec2044d8611f18a6ed9075c6a52))
* **readme:** update link to `CONTRIBUTING` [skip ci] ([01f25a3](https://github.com/saltstack-formulas/mysql-formula/commit/01f25a3ebfbf59d1db2bec73bc5fef9d8bcafd7e))
### Performance Improvements
* **travis:** improve `salt-lint` invocation [skip ci] ([1980c63](https://github.com/saltstack-formulas/mysql-formula/commit/1980c634b9021c7d29be914bd2a63ddf3c31c8ad))
## [0.52.2](https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.1...v0.52.2) (2019-10-11)
### Bug Fixes
* **rubocop:** add fixes using `rubocop --safe-auto-correct` ([](https://github.com/saltstack-formulas/mysql-formula/commit/fca3b04))
### Continuous Integration
* merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([](https://github.com/saltstack-formulas/mysql-formula/commit/b2b8863))
* **travis:** merge `rubocop` linter into main `lint` job ([](https://github.com/saltstack-formulas/mysql-formula/commit/26dc562))
## [0.52.1](https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.0...v0.52.1) (2019-10-10)
### Bug Fixes
* **server.sls:** fix `salt-lint` errors ([](https://github.com/saltstack-formulas/mysql-formula/commit/764dd0c))
* **user.sls:** fix `salt-lint` errors ([](https://github.com/saltstack-formulas/mysql-formula/commit/a014e55))
### Continuous Integration
* **kitchen:** change `log_level` to `debug` instead of `info` ([](https://github.com/saltstack-formulas/mysql-formula/commit/75fd8dc))
* **kitchen:** install required packages to bootstrapped `opensuse` [skip ci] ([](https://github.com/saltstack-formulas/mysql-formula/commit/8b89ebc))
* **kitchen:** use bootstrapped `opensuse` images until `2019.2.2` [skip ci] ([](https://github.com/saltstack-formulas/mysql-formula/commit/4bdaab7))
* **platform:** add `arch-base-latest` (commented out for now) [skip ci] ([](https://github.com/saltstack-formulas/mysql-formula/commit/5c20c9b))
* **yamllint:** add rule `empty-values` & use new `yaml-files` setting ([](https://github.com/saltstack-formulas/mysql-formula/commit/2322ff6))
* merge travis matrix, add `salt-lint` & `rubocop` to `lint` job ([](https://github.com/saltstack-formulas/mysql-formula/commit/00494d5))
* use `dist: bionic` & apply `opensuse-leap-15` SCP error workaround ([](https://github.com/saltstack-formulas/mysql-formula/commit/05b1cef))
# [0.52.0](https://github.com/saltstack-formulas/mysql-formula/compare/v0.51.0...v0.52.0) (2019-08-17)
### Features
* **yamllint:** include for this repo and apply rules throughout ([9f739fa](https://github.com/saltstack-formulas/mysql-formula/commit/9f739fa))
# [0.51.0](https://github.com/saltstack-formulas/mysql-formula/compare/v0.50.0...v0.51.0) (2019-08-08)
### Bug Fixes
* **connector:** fix typos (connnector) and missing `enabled` ([bdee94a](https://github.com/saltstack-formulas/mysql-formula/commit/bdee94a))
### Features
* **linux:** archlinux support (no osmajorrelase grain) ([4b4ad88](https://github.com/saltstack-formulas/mysql-formula/commit/4b4ad88))
# [0.50.0](https://github.com/saltstack-formulas/mysql-formula/compare/v0.49.0...v0.50.0) (2019-07-12)
### Features
* **semantic-release:** implement for this formula ([1d2e2f5](https://github.com/saltstack-formulas/mysql-formula/commit/1d2e2f5))

47
CODEOWNERS Normal file
View file

@ -0,0 +1,47 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# SECTION: Owner(s) for everything in the repo, unless a later match takes precedence
# **************************************************************************
# *** NO GLOBAL OWNER(S) SPECIFIED ***
# *** Ideally this will be defined for a healthy, well-maintained repo ***
# **************************************************************************
# FILE PATTERN OWNER(S)
* @NONE
# SECTION: Owner(s) for specific directories
# FILE PATTERN OWNER(S)
# SECTION: Owner(s) for files/directories related to `semantic-release`
# FILE PATTERN OWNER(S)
/.github/workflows/ @saltstack-formulas/ssf
/bin/install-hooks @saltstack-formulas/ssf
/bin/kitchen @saltstack-formulas/ssf
/docs/AUTHORS.rst @saltstack-formulas/ssf
/docs/CHANGELOG.rst @saltstack-formulas/ssf
/docs/TOFS_pattern.rst @saltstack-formulas/ssf
/mysql/libsaltcli.jinja @saltstack-formulas/ssf
/mysql/libtofs.jinja @saltstack-formulas/ssf
/test/integration/**/inspec.yml @saltstack-formulas/ssf
/test/integration/**/README.md @saltstack-formulas/ssf
/.gitignore @saltstack-formulas/ssf
/.cirrus.yml @saltstack-formulas/ssf
/.pre-commit-config.yaml @saltstack-formulas/ssf
/.rstcheck.cfg @saltstack-formulas/ssf
/.rubocop.yml @saltstack-formulas/ssf
/.salt-lint @saltstack-formulas/ssf
/.travis.yml @saltstack-formulas/ssf
/.yamllint @saltstack-formulas/ssf
/AUTHORS.md @saltstack-formulas/ssf
/CHANGELOG.md @saltstack-formulas/ssf
/CODEOWNERS @saltstack-formulas/ssf
/commitlint.config.js @saltstack-formulas/ssf
/FORMULA @saltstack-formulas/ssf
/Gemfile @saltstack-formulas/ssf
/Gemfile.lock @saltstack-formulas/ssf
/kitchen.yml @saltstack-formulas/ssf
/pre-commit_semantic-release.sh @saltstack-formulas/ssf
/release-rules.js @saltstack-formulas/ssf
/release.config.js @saltstack-formulas/ssf
# SECTION: Owner(s) for specific files
# FILE PATTERN OWNER(S)

View file

@ -1,8 +1,9 @@
name: mysql name: mysql
os: RedHat, CentOS, Debian, Ubuntu, Suse, Gentoo, FreeBSD os: RedHat, CentOS, Debian, Ubuntu, Suse, Gentoo, FreeBSD
os_family: RedHat, Debian, Suse, Gentoo, FreeBSD os_family: RedHat, Debian, Suse, Gentoo, FreeBSD
version: 201507 version: 0.54.2
release: 1 release: 1
minimum_version: 2015.8 minimum_version: 2015.8
summary: Formula for installing MySQL summary: Formula for installing MySQL
description: Formula for installing MySQL database client and/or server description: Formula for installing MySQL database client and/or server
top_level_dir: mysql

26
Gemfile
View file

@ -1,18 +1,12 @@
# frozen_string_literal: true
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'codeclimate-test-reporter', group: :test, require: nil # Use the latest version of `inspec` prior to `4.23.4`, which introduces a
gem 'rake' # regression where the diff isn't displayed when comparing using `eq`.
gem 'berkshelf', '~> 4.0' gem 'inspec', '~> 4.22.22'
# Install the `kitchen-docker` gem from GitHub because the latest version
group :integration do # currently available (`2.10.0`) doesn't include a recent fix for Gentoo.
gem 'test-kitchen' gem 'kitchen-docker', github: 'test-kitchen/kitchen-docker', ref: '41e80fe'
gem 'kitchen-salt' gem 'kitchen-inspec', '>= 2.2.1'
gem 'kitchen-inspec' gem 'kitchen-salt', '>= 0.6.3'
end
group :docker do
gem 'kitchen-docker'
end
# vi: set ft=ruby :
gem "kitchen-vagrant"

530
Gemfile.lock Normal file
View file

@ -0,0 +1,530 @@
GIT
remote: https://github.com/test-kitchen/kitchen-docker.git
revision: 41e80fed3a7cc86323e19c16a5a340cebf7e5848
ref: 41e80fe
specs:
kitchen-docker (2.10.0)
test-kitchen (>= 1.0.0)
GEM
remote: https://rubygems.org/
specs:
activesupport (5.2.4.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
aws-eventstream (1.1.0)
aws-partitions (1.386.0)
aws-sdk-apigateway (1.55.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-apigatewayv2 (1.29.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-athena (1.33.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-autoscaling (1.22.0)
aws-sdk-core (~> 3, >= 3.52.1)
aws-sigv4 (~> 1.1)
aws-sdk-budgets (1.36.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-cloudformation (1.44.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-cloudfront (1.46.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-cloudhsm (1.27.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-cloudhsmv2 (1.30.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-cloudtrail (1.29.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-cloudwatch (1.45.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-cloudwatchlogs (1.38.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-codecommit (1.40.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-codedeploy (1.37.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-codepipeline (1.37.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-configservice (1.53.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-core (3.109.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-costandusagereportservice (1.28.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-dynamodb (1.55.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-ec2 (1.202.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-ecr (1.39.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-ecs (1.70.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-efs (1.36.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-eks (1.45.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-elasticache (1.44.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-elasticbeanstalk (1.39.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-elasticloadbalancing (1.29.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-elasticloadbalancingv2 (1.53.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-elasticsearchservice (1.43.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-firehose (1.35.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-guardduty (1.42.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-iam (1.46.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-kafka (1.29.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-kinesis (1.30.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-kms (1.39.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-lambda (1.51.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-organizations (1.17.0)
aws-sdk-core (~> 3, >= 3.39.0)
aws-sigv4 (~> 1.0)
aws-sdk-rds (1.104.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-redshift (1.50.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-route53 (1.44.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-route53domains (1.28.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-route53resolver (1.21.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.83.1)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sdk-securityhub (1.35.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-ses (1.36.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-sms (1.27.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-sns (1.34.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-sqs (1.34.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-ssm (1.95.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2)
azure_graph_rbac (0.17.2)
ms_rest_azure (~> 0.12.0)
azure_mgmt_key_vault (0.17.6)
ms_rest_azure (~> 0.12.0)
azure_mgmt_resources (0.18.0)
ms_rest_azure (~> 0.12.0)
azure_mgmt_security (0.18.2)
ms_rest_azure (~> 0.12.0)
azure_mgmt_storage (0.22.0)
ms_rest_azure (~> 0.12.0)
bcrypt_pbkdf (1.0.1)
builder (3.2.4)
chef-config (16.6.14)
addressable
chef-utils (= 16.6.14)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
tomlrb (~> 1.2)
chef-telemetry (1.0.14)
chef-config
concurrent-ruby (~> 1.0)
ffi-yajl (~> 2.2)
chef-utils (16.6.14)
coderay (1.1.3)
concurrent-ruby (1.1.7)
declarative (0.0.20)
declarative-option (0.1.0)
diff-lcs (1.4.4)
docker-api (2.0.0)
excon (>= 0.47.0)
multi_json
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
ecma-re-validator (0.2.1)
regexp_parser (~> 1.2)
ed25519 (1.2.4)
erubi (1.9.0)
excon (0.78.0)
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
ffi (1.13.1)
ffi-yajl (2.3.4)
libyajl2 (~> 1.2)
fuzzyurl (0.9.0)
google-api-client (0.44.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.12)
googleauth (0.13.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
gssapi (1.3.0)
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
hana (1.3.6)
hashie (3.6.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
inifile (3.0.0)
inspec (4.22.22)
faraday_middleware (~> 0.12.2)
inspec-core (= 4.22.22)
train (~> 3.0)
train-aws (~> 0.1)
train-habitat (~> 0.1)
train-winrm (~> 0.2)
inspec-core (4.22.22)
addressable (~> 2.4)
chef-telemetry (~> 1.0)
faraday (>= 0.9.0)
hashie (~> 3.4)
json_schemer (>= 0.2.1, < 0.2.12)
license-acceptance (>= 0.2.13, < 2.0)
method_source (>= 0.8, < 2.0)
mixlib-log (~> 3.0)
multipart-post (~> 2.0)
parallel (~> 1.9)
parslet (~> 1.5)
pry (~> 0.13)
rspec (~> 3.9)
rspec-its (~> 1.2)
rubyzip (~> 1.2, >= 1.2.2)
semverse (~> 3.0)
sslshake (~> 1.2)
thor (>= 0.20, < 2.0)
tomlrb (~> 1.2.0)
train-core (~> 3.0)
tty-prompt (~> 0.17)
tty-table (~> 0.10)
jmespath (1.4.0)
json (2.3.1)
json_schemer (0.2.11)
ecma-re-validator (~> 0.2)
hana (~> 1.3)
regexp_parser (~> 1.5)
uri_template (~> 0.7)
jwt (2.2.2)
kitchen-inspec (2.2.1)
hashie (~> 3.4)
inspec (>= 2.2.64, < 5.0)
test-kitchen (>= 2.7, < 3)
kitchen-salt (0.6.3)
hashie (>= 3.5)
test-kitchen (>= 1.4)
libyajl2 (1.2.0)
license-acceptance (1.0.19)
pastel (~> 0.7)
tomlrb (~> 1.2)
tty-box (~> 0.3)
tty-prompt (~> 0.18)
little-plugger (1.1.4)
logging (2.3.0)
little-plugger (~> 1.1)
multi_json (~> 1.14)
memoist (0.16.2)
method_source (1.0.0)
mini_mime (1.0.2)
minitest (5.14.2)
mixlib-config (3.0.9)
tomlrb
mixlib-install (3.12.3)
mixlib-shellout
mixlib-versioning
thor
mixlib-log (3.0.9)
mixlib-shellout (3.1.6)
chef-utils
mixlib-versioning (1.2.12)
ms_rest (0.7.6)
concurrent-ruby (~> 1.0)
faraday (>= 0.9, < 2.0.0)
timeliness (~> 0.3.10)
ms_rest_azure (0.12.0)
concurrent-ruby (~> 1.0)
faraday (>= 0.9, < 2.0.0)
faraday-cookie_jar (~> 0.0.6)
ms_rest (~> 0.7.6)
multi_json (1.15.0)
multipart-post (2.1.1)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.1.0)
net-ssh-gateway (2.0.0)
net-ssh (>= 4.0.0)
nori (2.6.0)
os (1.1.1)
parallel (1.19.2)
parslet (1.8.2)
pastel (0.8.0)
tty-color (~> 0.5)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
regexp_parser (1.8.2)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.3)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.4)
rubyntlm (0.6.2)
rubyzip (1.3.0)
semverse (3.0.0)
signet (0.14.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
sslshake (1.3.1)
strings (0.2.0)
strings-ansi (~> 0.2)
unicode-display_width (~> 1.5)
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
test-kitchen (2.7.2)
bcrypt_pbkdf (~> 1.0)
ed25519 (~> 1.2)
license-acceptance (>= 1.0.11, < 3.0)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 4.0)
net-scp (>= 1.1, < 4.0)
net-ssh (>= 2.9, < 7.0)
net-ssh-gateway (>= 1.2, < 3.0)
thor (>= 0.19, < 2.0)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (1.0.1)
thread_safe (0.3.6)
timeliness (0.3.10)
tomlrb (1.2.9)
train (3.3.27)
activesupport (>= 5.2.4.3, < 6.0.0)
azure_graph_rbac (~> 0.16)
azure_mgmt_key_vault (~> 0.17)
azure_mgmt_resources (~> 0.15)
azure_mgmt_security (~> 0.18)
azure_mgmt_storage (~> 0.18)
docker-api (>= 1.26, < 3.0)
google-api-client (>= 0.23.9, < 0.44.1)
googleauth (>= 0.6.6, < 0.13.1)
inifile (~> 3.0)
train-core (= 3.3.27)
train-winrm (~> 0.2)
train-aws (0.1.18)
aws-sdk-apigateway (~> 1.0)
aws-sdk-apigatewayv2 (~> 1.0)
aws-sdk-athena (~> 1.0)
aws-sdk-autoscaling (~> 1.22.0)
aws-sdk-budgets (~> 1.0)
aws-sdk-cloudformation (~> 1.0)
aws-sdk-cloudfront (~> 1.0)
aws-sdk-cloudhsm (~> 1.0)
aws-sdk-cloudhsmv2 (~> 1.0)
aws-sdk-cloudtrail (~> 1.8)
aws-sdk-cloudwatch (~> 1.13)
aws-sdk-cloudwatchlogs (~> 1.13)
aws-sdk-codecommit (~> 1.0)
aws-sdk-codedeploy (~> 1.0)
aws-sdk-codepipeline (~> 1.0)
aws-sdk-configservice (~> 1.21)
aws-sdk-core (~> 3.0)
aws-sdk-costandusagereportservice (~> 1.6)
aws-sdk-dynamodb (~> 1.31)
aws-sdk-ec2 (~> 1.70)
aws-sdk-ecr (~> 1.18)
aws-sdk-ecs (~> 1.30)
aws-sdk-efs (~> 1.0)
aws-sdk-eks (~> 1.9)
aws-sdk-elasticache (~> 1.0)
aws-sdk-elasticbeanstalk (~> 1.0)
aws-sdk-elasticloadbalancing (~> 1.8)
aws-sdk-elasticloadbalancingv2 (~> 1.0)
aws-sdk-elasticsearchservice (~> 1.0)
aws-sdk-firehose (~> 1.0)
aws-sdk-guardduty (~> 1.31)
aws-sdk-iam (~> 1.13)
aws-sdk-kafka (~> 1.0)
aws-sdk-kinesis (~> 1.0)
aws-sdk-kms (~> 1.13)
aws-sdk-lambda (~> 1.0)
aws-sdk-organizations (~> 1.17.0)
aws-sdk-rds (~> 1.43)
aws-sdk-redshift (~> 1.0)
aws-sdk-route53 (~> 1.0)
aws-sdk-route53domains (~> 1.0)
aws-sdk-route53resolver (~> 1.0)
aws-sdk-s3 (~> 1.30)
aws-sdk-securityhub (~> 1.0)
aws-sdk-ses (~> 1.0)
aws-sdk-sms (~> 1.0)
aws-sdk-sns (~> 1.9)
aws-sdk-sqs (~> 1.10)
aws-sdk-ssm (~> 1.0)
train-core (3.3.27)
addressable (~> 2.5)
ffi (!= 1.13.0)
json (>= 1.8, < 3.0)
mixlib-shellout (>= 2.0, < 4.0)
net-scp (>= 1.2, < 4.0)
net-ssh (>= 2.9, < 7.0)
train-habitat (0.2.13)
train-winrm (0.2.11)
winrm (~> 2.0)
winrm-elevated (~> 1.2.2)
winrm-fs (~> 1.0)
tty-box (0.6.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-cursor (~> 0.7)
tty-color (0.5.2)
tty-cursor (0.7.1)
tty-prompt (0.22.0)
pastel (~> 0.8)
tty-reader (~> 0.8)
tty-reader (0.8.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.1)
tty-table (0.12.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-screen (~> 0.8)
tzinfo (1.2.7)
thread_safe (~> 0.1)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
unicode_utils (1.4.0)
uri_template (0.7.0)
winrm (2.3.5)
builder (>= 2.1.2)
erubi (~> 1.8)
gssapi (~> 1.2)
gyoku (~> 1.0)
httpclient (~> 2.2, >= 2.2.0.2)
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
winrm-elevated (1.2.2)
erubi (~> 1.8)
winrm (~> 2.0)
winrm-fs (~> 1.0)
winrm-fs (1.3.3)
erubi (~> 1.8)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
winrm (~> 2.0)
wisper (2.0.1)
PLATFORMS
ruby
DEPENDENCIES
inspec (~> 4.22.22)
kitchen-docker!
kitchen-inspec (>= 2.2.1)
kitchen-salt (>= 0.6.3)
BUNDLED WITH
2.1.2

View file

@ -1,31 +0,0 @@
require 'rake'
require 'rake/testtask'
require 'bundler/setup'
Rake::TestTask.new do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
desc 'Run Test Kitchen integration tests'
namespace :integration do
desc 'Run integration tests with kitchen-docker'
task :docker do
require 'kitchen'
Kitchen.logger = Kitchen.default_file_logger
@loader = Kitchen::Loader::YAML.new(local_config: '.kitchen.docker.yml')
Kitchen::Config.new(loader: @loader).instances.each do |instance|
instance.test(:always)
end
end
end
task default: :test
begin
require 'kitchen/rake_tasks'
Kitchen::RakeTasks.new
rescue LoadError
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
end

16
bin/install-hooks Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env sh
set -o nounset # Treat unset variables as an error and immediately exit
set -o errexit # If a command fails exit the whole script
if [ "${DEBUG:-false}" = "true" ]; then
set -x # Run the entire script in debug mode
fi
if ! command -v pre-commit >/dev/null 2>&1; then
echo "pre-commit not found: please install or check your PATH" >&2
echo "See https://pre-commit.com/#installation" >&2
exit 1
fi
pre-commit install --install-hooks
pre-commit install --hook-type commit-msg --install-hooks

32
bin/kitchen Executable file
View file

@ -0,0 +1,32 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'kitchen' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path('bundle', __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort(
'Your `bin/bundle` was not generated by Bundler, '\
'so this binstub cannot run. Replace `bin/bundle` by running '\
'`bundle binstubs bundler --force`, then run this command again.'
)
end
end
require 'rubygems'
require 'bundler/setup'
load Gem.bin_path('test-kitchen', 'kitchen')

8
commitlint.config.js Normal file
View file

@ -0,0 +1,8 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [2, 'always', 120],
'footer-max-line-length': [2, 'always', 120],
'header-max-length': [2, 'always', 72],
},
};

254
docs/AUTHORS.rst Normal file
View file

@ -0,0 +1,254 @@
.. role:: raw-html-m2r(raw)
:format: html
Authors
=======
This list is sorted by the number of commits per contributor in *descending* order.
.. list-table::
:header-rows: 1
* - Avatar
- Contributor
- Contributions
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>`
- `@myii <https://github.com/myii>`_
- 65
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>`
- `@gravyboat <https://github.com/gravyboat>`_
- 38
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>`
- `@aboe76 <https://github.com/aboe76>`_
- 37
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>`
- `@nmadhok <https://github.com/nmadhok>`_
- 28
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/91293?v=4' width='36' height='36' alt='@whiteinge'>`
- `@whiteinge <https://github.com/whiteinge>`_
- 27
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>`
- `@noelmcloughlin <https://github.com/noelmcloughlin>`_
- 18
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>`
- `@alxwr <https://github.com/alxwr>`_
- 14
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/1184479?v=4' width='36' height='36' alt='@cheuschober'>`
- `@cheuschober <https://github.com/cheuschober>`_
- 11
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/117961?v=4' width='36' height='36' alt='@babilen5'>`
- `@babilen5 <https://github.com/babilen5>`_
- 11
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/56635?v=4' width='36' height='36' alt='@pprkut'>`
- `@pprkut <https://github.com/pprkut>`_
- 9
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/287147?v=4' width='36' height='36' alt='@techhat'>`
- `@techhat <https://github.com/techhat>`_
- 7
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/533172?v=4' width='36' height='36' alt='@roock'>`
- `@roock <https://github.com/roock>`_
- 6
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/727535?v=4' width='36' height='36' alt='@Routhinator'>`
- `@Routhinator <https://github.com/Routhinator>`_
- 5
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/528061?v=4' width='36' height='36' alt='@puneetk'>`
- `@puneetk <https://github.com/puneetk>`_
- 5
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1002811?v=4' width='36' height='36' alt='@davidjb'>`
- `@davidjb <https://github.com/davidjb>`_
- 5
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/7139195?v=4' width='36' height='36' alt='@xenophonf'>`
- `@xenophonf <https://github.com/xenophonf>`_
- 4
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/507599?v=4' width='36' height='36' alt='@thatch45'>`
- `@thatch45 <https://github.com/thatch45>`_
- 4
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/1773291?v=4' width='36' height='36' alt='@toanju'>`
- `@toanju <https://github.com/toanju>`_
- 4
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/398720?v=4' width='36' height='36' alt='@tiger-seo'>`
- `@tiger-seo <https://github.com/tiger-seo>`_
- 4
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/732321?v=4' width='36' height='36' alt='@gtmanfred'>`
- `@gtmanfred <https://github.com/gtmanfred>`_
- 4
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/142916?v=4' width='36' height='36' alt='@alexhayes'>`
- `@alexhayes <https://github.com/alexhayes>`_
- 3
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/2804767?v=4' width='36' height='36' alt='@alfonsfoubert'>`
- `@alfonsfoubert <https://github.com/alfonsfoubert>`_
- 3
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/146882?v=4' width='36' height='36' alt='@cboltz'>`
- `@cboltz <https://github.com/cboltz>`_
- 3
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/358074?v=4' width='36' height='36' alt='@pcdummy'>`
- `@pcdummy <https://github.com/pcdummy>`_
- 3
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/46799934?v=4' width='36' height='36' alt='@sticky-note'>`
- `@sticky-note <https://github.com/sticky-note>`_
- 3
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/941928?v=4' width='36' height='36' alt='@amontalban'>`
- `@amontalban <https://github.com/amontalban>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/20441?v=4' width='36' height='36' alt='@iggy'>`
- `@iggy <https://github.com/iggy>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/5789536?v=4' width='36' height='36' alt='@ogabrielsantos'>`
- `@ogabrielsantos <https://github.com/ogabrielsantos>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/279094?v=4' width='36' height='36' alt='@kaharlichenko'>`
- `@kaharlichenko <https://github.com/kaharlichenko>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>`
- `@javierbertoli <https://github.com/javierbertoli>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/3842066?v=4' width='36' height='36' alt='@neuhalje'>`
- `@neuhalje <https://github.com/neuhalje>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/3768412?v=4' width='36' height='36' alt='@stp-ip'>`
- `@stp-ip <https://github.com/stp-ip>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/2753036?v=4' width='36' height='36' alt='@RonWilliams'>`
- `@RonWilliams <https://github.com/RonWilliams>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/4956475?v=4' width='36' height='36' alt='@ross-p'>`
- `@ross-p <https://github.com/ross-p>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1809538?v=4' width='36' height='36' alt='@sray'>`
- `@sray <https://github.com/sray>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/642928?v=4' width='36' height='36' alt='@tomasfejfar'>`
- `@tomasfejfar <https://github.com/tomasfejfar>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/1482937?v=4' width='36' height='36' alt='@vschum'>`
- `@vschum <https://github.com/vschum>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/1731256?v=4' width='36' height='36' alt='@madflojo'>`
- `@madflojo <https://github.com/madflojo>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/306240?v=4' width='36' height='36' alt='@UtahDave'>`
- `@UtahDave <https://github.com/UtahDave>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/52996?v=4' width='36' height='36' alt='@daks'>`
- `@daks <https://github.com/daks>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/3833337?v=4' width='36' height='36' alt='@nesteves'>`
- `@nesteves <https://github.com/nesteves>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/4608417?v=4' width='36' height='36' alt='@1exx'>`
- `@1exx <https://github.com/1exx>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/11548856?v=4' width='36' height='36' alt='@aaronm-cloudtek'>`
- `@aaronm-cloudtek <https://github.com/aaronm-cloudtek>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/479001?v=4' width='36' height='36' alt='@Achimh3011'>`
- `@Achimh3011 <https://github.com/Achimh3011>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/762280?v=4' width='36' height='36' alt='@asenci'>`
- `@asenci <https://github.com/asenci>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/330045?v=4' width='36' height='36' alt='@word'>`
- `@word <https://github.com/word>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/445200?v=4' width='36' height='36' alt='@arthurlogilab'>`
- `@arthurlogilab <https://github.com/arthurlogilab>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/218060?v=4' width='36' height='36' alt='@johnklehm'>`
- `@johnklehm <https://github.com/johnklehm>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/6368493?v=4' width='36' height='36' alt='@tardypad'>`
- `@tardypad <https://github.com/tardypad>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/1196632?v=4' width='36' height='36' alt='@dosercz'>`
- `@dosercz <https://github.com/dosercz>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/7666055?v=4' width='36' height='36' alt='@sivir'>`
- `@sivir <https://github.com/sivir>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/328598?v=4' width='36' height='36' alt='@terminalmage'>`
- `@terminalmage <https://github.com/terminalmage>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/337608?v=4' width='36' height='36' alt='@replicant0wnz'>`
- `@replicant0wnz <https://github.com/replicant0wnz>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/418769?v=4' width='36' height='36' alt='@GeJ'>`
- `@GeJ <https://github.com/GeJ>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/94157?v=4' width='36' height='36' alt='@imran1008'>`
- `@imran1008 <https://github.com/imran1008>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/2150143?v=4' width='36' height='36' alt='@JubbaSmail'>`
- `@JubbaSmail <https://github.com/JubbaSmail>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/34903?v=4' width='36' height='36' alt='@h4ck3rm1k3'>`
- `@h4ck3rm1k3 <https://github.com/h4ck3rm1k3>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/667455?v=4' width='36' height='36' alt='@dijit'>`
- `@dijit <https://github.com/dijit>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/952828?v=4' width='36' height='36' alt='@joejulian'>`
- `@joejulian <https://github.com/joejulian>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/668449?v=4' width='36' height='36' alt='@stromnet'>`
- `@stromnet <https://github.com/stromnet>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3956745?v=4' width='36' height='36' alt='@thejcannon'>`
- `@thejcannon <https://github.com/thejcannon>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/6354880?v=4' width='36' height='36' alt='@TaiSHiNet'>`
- `@TaiSHiNet <https://github.com/TaiSHiNet>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/296523?v=4' width='36' height='36' alt='@mkotsbak'>`
- `@mkotsbak <https://github.com/mkotsbak>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/188214?v=4' width='36' height='36' alt='@miska'>`
- `@miska <https://github.com/miska>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/805439?v=4' width='36' height='36' alt='@natehouk'>`
- `@natehouk <https://github.com/natehouk>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/804806?v=4' width='36' height='36' alt='@phil-lavin'>`
- `@phil-lavin <https://github.com/phil-lavin>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/22398368?v=4' width='36' height='36' alt='@S-Wilhelm'>`
- `@S-Wilhelm <https://github.com/S-Wilhelm>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/327943?v=4' width='36' height='36' alt='@Cottser'>`
- `@Cottser <https://github.com/Cottser>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/56102?v=4' width='36' height='36' alt='@soniah'>`
- `@soniah <https://github.com/soniah>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/26336?v=4' width='36' height='36' alt='@tony'>`
- `@tony <https://github.com/tony>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/326786?v=4' width='36' height='36' alt='@wido'>`
- `@wido <https://github.com/wido>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/751889?v=4' width='36' height='36' alt='@Yoda-BZH'>`
- `@Yoda-BZH <https://github.com/Yoda-BZH>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/228723?v=4' width='36' height='36' alt='@abednarik'>`
- `@abednarik <https://github.com/abednarik>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/546883?v=4' width='36' height='36' alt='@jam13'>`
- `@jam13 <https://github.com/jam13>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars3.githubusercontent.com/u/715563?v=4' width='36' height='36' alt='@getSurreal'>`
- `@getSurreal <https://github.com/getSurreal>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1132799?v=4' width='36' height='36' alt='@slawekp'>`
- `@slawekp <https://github.com/slawekp>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1386595?v=4' width='36' height='36' alt='@tsia'>`
- `@tsia <https://github.com/tsia>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/3351040?v=4' width='36' height='36' alt='@zhujinhe'>`
- `@zhujinhe <https://github.com/zhujinhe>`_
- 1
----
Auto-generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2020-08-27.

212
docs/CHANGELOG.rst Normal file
View file

@ -0,0 +1,212 @@
Changelog
=========
`0.54.2 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.54.1...v0.54.2>`_ (2020-08-27)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **indent:** properly indent file.directory block (\ `7791268 <https://github.com/saltstack-formulas/mysql-formula/commit/7791268d133d557d21414365db59dc14c8f97f74>`_\ ), closes `#250 <https://github.com/saltstack-formulas/mysql-formula/issues/250>`_
`0.54.1 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.54.0...v0.54.1>`_ (2020-08-24)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **freebsd:** upgrade to mysql57-server (\ `ec68199 <https://github.com/saltstack-formulas/mysql-formula/commit/ec681995b4f7e23a8dbec63809d3704f19ec9299>`_\ )
`0.54.0 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.53.0...v0.54.0>`_ (2020-07-10)
----------------------------------------------------------------------------------------------------------
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **kitchen:** use ``saltimages`` Docker Hub where available [skip ci] (\ `b37a8a7 <https://github.com/saltstack-formulas/mysql-formula/commit/b37a8a7c970cb30ed18f04c4103c5f553557699d>`_\ )
Features
^^^^^^^^
* **socket_authentication:** allow unix_socket authentication (\ `8eccd5a <https://github.com/saltstack-formulas/mysql-formula/commit/8eccd5a68cadde02f54467a7fb9e370d2ee7d574>`_\ )
`0.53.0 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.7...v0.53.0>`_ (2020-06-01)
----------------------------------------------------------------------------------------------------------
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **kitchen+travis:** use latest pre-salted images (\ `7ea518a <https://github.com/saltstack-formulas/mysql-formula/commit/7ea518a3919f1a59bc6ae821bc0df7577629059a>`_\ )
* **travis:** add notifications => zulip [skip ci] (\ `8adfc4b <https://github.com/saltstack-formulas/mysql-formula/commit/8adfc4bb4fbb49548cf46d277a0403b89c180b1a>`_\ )
Features
^^^^^^^^
* **focal:** add settings for ``ubuntu-20.04`` (\ `0d77164 <https://github.com/saltstack-formulas/mysql-formula/commit/0d77164f394909ec371f39cb41a4920c82e75052>`_\ )
`0.52.7 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.6...v0.52.7>`_ (2020-05-19)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **osfamilymap.yaml:** update SUSE defaults (\ `8ee79a7 <https://github.com/saltstack-formulas/mysql-formula/commit/8ee79a7bb03488e4c3632a1dcfe143696a11aad5>`_\ )
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **gemfile.lock:** add to repo with updated ``Gemfile`` [skip ci] (\ `9e9fa3e <https://github.com/saltstack-formulas/mysql-formula/commit/9e9fa3e3d15e25ad22f75eae61af4883c79b7c0f>`_\ )
* **kitchen+travis:** remove ``master-py2-arch-base-latest`` [skip ci] (\ `c1dddc3 <https://github.com/saltstack-formulas/mysql-formula/commit/c1dddc3a8d561847094bbe23fe2c764c8fdf79de>`_\ )
* **workflows/commitlint:** add to repo [skip ci] (\ `b4c6570 <https://github.com/saltstack-formulas/mysql-formula/commit/b4c65702b91e8813741bf72008e41d1d8dfc735d>`_\ )
`0.52.6 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.5...v0.52.6>`_ (2020-04-17)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **reload-modules:** do ``reload_modules`` on py module installation (\ `2b6e704 <https://github.com/saltstack-formulas/mysql-formula/commit/2b6e704c96d0373aadb56f90d758c960f538abdb>`_\ )
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **gemfile:** restrict ``train`` gem version until upstream fix [skip ci] (\ `04f75a7 <https://github.com/saltstack-formulas/mysql-formula/commit/04f75a7a3b43de9425a8f36dc202b7ecf0c4f856>`_\ )
* **kitchen:** avoid using bootstrap for ``master`` instances [skip ci] (\ `ef7a2ce <https://github.com/saltstack-formulas/mysql-formula/commit/ef7a2ce2d857dd271ec0704ab951c8337cb6b64e>`_\ )
* **travis:** use ``major.minor`` for ``semantic-release`` version [skip ci] (\ `b4f5f79 <https://github.com/saltstack-formulas/mysql-formula/commit/b4f5f79781631d7d31061b880df3066ac5bc5860>`_\ )
`0.52.5 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.4...v0.52.5>`_ (2019-12-10)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **db_load:** preserve space between -h and -p on the db load ``cmd.wait`` (\ `a05f263 <https://github.com/saltstack-formulas/mysql-formula/commit/a05f263f4b9eac52a5854fd57a6a24f997ccb291>`_\ )
`0.52.4 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.3...v0.52.4>`_ (2019-12-03)
----------------------------------------------------------------------------------------------------------
Styles
^^^^^^
* remove previous line from jinja directives (\ `ec0e2a7 <https://github.com/saltstack-formulas/mysql-formula/commit/ec0e2a765a587d0df94b0afb9f7a4ef78a5319ab>`_\ )
`0.52.3 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.2...v0.52.3>`_ (2019-12-03)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **mac_shortcut.sh:** fix ``shellcheck`` errors (\ `7b309f8 <https://github.com/saltstack-formulas/mysql-formula/commit/7b309f8da272ebdcb36dbfa7619a0fc9872a79a7>`_\ )
* **release.config.js:** use full commit hash in commit link [skip ci] (\ `3f51b8b <https://github.com/saltstack-formulas/mysql-formula/commit/3f51b8bbc231a7455e6763b415221abff636d8a2>`_\ )
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **kitchen:** use ``debian-10-master-py3`` instead of ``develop`` [skip ci] (\ `5efe938 <https://github.com/saltstack-formulas/mysql-formula/commit/5efe9387fde63e0c09d99d5771f3b623fb934242>`_\ )
* **kitchen:** use ``develop`` image until ``master`` is ready (\ ``amazonlinux``\ ) [skip ci] (\ `63bfb4a <https://github.com/saltstack-formulas/mysql-formula/commit/63bfb4a0f25b62bdc45c1738d438ce5ec64f2183>`_\ )
* **kitchen+travis:** upgrade matrix after ``2019.2.2`` release [skip ci] (\ `27ac5a3 <https://github.com/saltstack-formulas/mysql-formula/commit/27ac5a3f684325a8e15736bb85d4774807061534>`_\ )
* **travis:** apply changes from build config validation [skip ci] (\ `d520848 <https://github.com/saltstack-formulas/mysql-formula/commit/d520848c815a9c2815ee3f1943e3e3962a26c7cf>`_\ )
* **travis:** opt-in to ``dpl v2`` to complete build config validation [skip ci] (\ `1a8d914 <https://github.com/saltstack-formulas/mysql-formula/commit/1a8d914fbd5e43f78ee2334b9c5ccd51ee65ad57>`_\ )
* **travis:** quote pathspecs used with ``git ls-files`` [skip ci] (\ `3fb5a82 <https://github.com/saltstack-formulas/mysql-formula/commit/3fb5a82de66dda9a05decc5ee7263729ef913533>`_\ )
* **travis:** run ``shellcheck`` during lint job [skip ci] (\ `0931835 <https://github.com/saltstack-formulas/mysql-formula/commit/0931835f1cfc77022a43242bd3ab04cbed2a3a02>`_\ )
* **travis:** update ``salt-lint`` config for ``v0.0.10`` [skip ci] (\ `1512279 <https://github.com/saltstack-formulas/mysql-formula/commit/1512279c2eac26638720461cc7e847d93d2c77d6>`_\ )
* **travis:** use build config validation (beta) [skip ci] (\ `40d4b97 <https://github.com/saltstack-formulas/mysql-formula/commit/40d4b9763f252f5811d31b2b2df156260bde2b6d>`_\ )
Documentation
^^^^^^^^^^^^^
* **contributing:** remove to use org-level file instead [skip ci] (\ `6afcc80 <https://github.com/saltstack-formulas/mysql-formula/commit/6afcc80396dc4ec2044d8611f18a6ed9075c6a52>`_\ )
* **readme:** update link to ``CONTRIBUTING`` [skip ci] (\ `01f25a3 <https://github.com/saltstack-formulas/mysql-formula/commit/01f25a3ebfbf59d1db2bec73bc5fef9d8bcafd7e>`_\ )
Performance Improvements
^^^^^^^^^^^^^^^^^^^^^^^^
* **travis:** improve ``salt-lint`` invocation [skip ci] (\ `1980c63 <https://github.com/saltstack-formulas/mysql-formula/commit/1980c634b9021c7d29be914bd2a63ddf3c31c8ad>`_\ )
`0.52.2 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.1...v0.52.2>`_ (2019-10-11)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **rubocop:** add fixes using ``rubocop --safe-auto-correct`` (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/fca3b04>`_\ )
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* merge travis matrix, add ``salt-lint`` & ``rubocop`` to ``lint`` job (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/b2b8863>`_\ )
* **travis:** merge ``rubocop`` linter into main ``lint`` job (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/26dc562>`_\ )
`0.52.1 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.52.0...v0.52.1>`_ (2019-10-10)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **server.sls:** fix ``salt-lint`` errors (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/764dd0c>`_\ )
* **user.sls:** fix ``salt-lint`` errors (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/a014e55>`_\ )
Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
* **kitchen:** change ``log_level`` to ``debug`` instead of ``info`` (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/75fd8dc>`_\ )
* **kitchen:** install required packages to bootstrapped ``opensuse`` [skip ci] (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/8b89ebc>`_\ )
* **kitchen:** use bootstrapped ``opensuse`` images until ``2019.2.2`` [skip ci] (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/4bdaab7>`_\ )
* **platform:** add ``arch-base-latest`` (commented out for now) [skip ci] (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/5c20c9b>`_\ )
* **yamllint:** add rule ``empty-values`` & use new ``yaml-files`` setting (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/2322ff6>`_\ )
* merge travis matrix, add ``salt-lint`` & ``rubocop`` to ``lint`` job (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/00494d5>`_\ )
* use ``dist: bionic`` & apply ``opensuse-leap-15`` SCP error workaround (\ ` <https://github.com/saltstack-formulas/mysql-formula/commit/05b1cef>`_\ )
`0.52.0 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.51.0...v0.52.0>`_ (2019-08-17)
----------------------------------------------------------------------------------------------------------
Features
^^^^^^^^
* **yamllint:** include for this repo and apply rules throughout (\ `9f739fa <https://github.com/saltstack-formulas/mysql-formula/commit/9f739fa>`_\ )
`0.51.0 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.50.0...v0.51.0>`_ (2019-08-08)
----------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **connector:** fix typos (connnector) and missing ``enabled`` (\ `bdee94a <https://github.com/saltstack-formulas/mysql-formula/commit/bdee94a>`_\ )
Features
^^^^^^^^
* **linux:** archlinux support (no osmajorrelase grain) (\ `4b4ad88 <https://github.com/saltstack-formulas/mysql-formula/commit/4b4ad88>`_\ )
`0.50.0 <https://github.com/saltstack-formulas/mysql-formula/compare/v0.49.0...v0.50.0>`_ (2019-07-12)
----------------------------------------------------------------------------------------------------------
Features
^^^^^^^^
* **semantic-release:** implement for this formula (\ `1d2e2f5 <https://github.com/saltstack-formulas/mysql-formula/commit/1d2e2f5>`_\ )

View file

@ -1,42 +1,72 @@
===== .. _readme:
mysql mysql
===== =====
|img_travis| |img_sr|
.. |img_travis| image:: https://travis-ci.com/saltstack-formulas/mysql-formula.svg?branch=master
:alt: Travis CI Build Status
:scale: 100%
:target: https://travis-ci.com/saltstack-formulas/mysql-formula
.. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
:alt: Semantic Release
:scale: 100%
:target: https://github.com/semantic-release/semantic-release
Install the MySQL client and/or server on Linux and MacOS. Install the MySQL client and/or server on Linux and MacOS.
.. note:: .. contents:: **Table of Contents**
See the full `Salt Formulas installation and usage instructions General notes
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_. -------------
See the full `SaltStack Formulas installation and usage instructions
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas>`_.
If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,
which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/>`_.
See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.
Contributing to this repo
-------------------------
**Commit message formatting is significant!!**
Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
Available states Available states
================ ----------------
.. contents:: .. contents::
:local: :local:
``mysql`` ``mysql``
--------- ^^^^^^^^^
Meta-state including all server packages in correct order. This meta-state does **not** include ``mysql.remove_test_database``. Meta-state including all server packages in correct order. This meta-state does **not** include ``mysql.remove_test_database``.
``mysql.macos`` ``mysql.macos``
---------------- ^^^^^^^^^^^^^^^^
Install "MySQL Community Server", "MySQL Workbench", and other related mysql products on MacOS (and create Desktop shortcuts). Install "MySQL Community Server", "MySQL Workbench", and other related mysql products on MacOS (and create Desktop shortcuts).
``mysql.macos.remove`` ``mysql.macos.remove``
---------------- ^^^^^^^^^^^^^^^^
Remove "MySQL Community Server", "MySQL Workbench", and any other enabled products from MacOS. Remove "MySQL Community Server", "MySQL Workbench", and any other enabled products from MacOS.
``mysql.client`` ``mysql.client``
---------------- ^^^^^^^^^^^^^^^^
Install the MySQL client package on Linux. Install the MySQL client package on Linux.
``mysql.server`` ``mysql.server``
---------------- ^^^^^^^^^^^^^^^^
Install the MySQL server package and start the service. Install the MySQL server package and start the service.
@ -52,28 +82,28 @@ Debian OS family supports setting MySQL root password during install via debconf
newly available ``random.get_str`` method. newly available ``random.get_str`` method.
``mysql.server_checks`` ``mysql.server_checks``
----------------------- ^^^^^^^^^^^^^^^^^^^^^^^
Enforces a root password to be set. Enforces a root password to be set.
``mysql.disabled`` ``mysql.disabled``
------------------ ^^^^^^^^^^^^^^^^^^
Ensure that the MySQL service is not running. Ensure that the MySQL service is not running.
``mysql.database`` ``mysql.database``
------------------ ^^^^^^^^^^^^^^^^^^
Create and manage MySQL databases. Create and manage MySQL databases.
``mysql.python`` ``mysql.python``
---------------- ^^^^^^^^^^^^^^^^
Install mysql python bindings. Install mysql python bindings.
``mysql.user`` ``mysql.user``
-------------- ^^^^^^^^^^^^^^
Create and manage MySQL database users with definable GRANT privileges. Create and manage MySQL database users with definable GRANT privileges.
@ -88,7 +118,7 @@ priority.
Make sure to **quote the passwords** in the pillar so YAML doesn't throw an exception. Make sure to **quote the passwords** in the pillar so YAML doesn't throw an exception.
``mysql.remove_test_database`` ``mysql.remove_test_database``
------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. warning:: .. warning::
@ -100,7 +130,7 @@ MySQL installation. This state is **not** included as part of the meta-state
above as this name may conflict with a real database. above as this name may conflict with a real database.
``mysql.dev`` ``mysql.dev``
------------- ^^^^^^^^^^^^^
Install the MySQL development libraries and header files. Install the MySQL development libraries and header files.
@ -109,7 +139,7 @@ Install the MySQL development libraries and header files.
your pillar data accordingly. your pillar data accordingly.
``mysql.repo`` ``mysql.repo``
-------------- ^^^^^^^^^^^^^^
Add the official MySQL 5.7 repository. Add the official MySQL 5.7 repository.
@ -120,7 +150,7 @@ Add the official MySQL 5.7 repository.
changed enabled repository accordingly. changed enabled repository accordingly.
``mysql.config`` ``mysql.config``
------------------ ^^^^^^^^^^^^^^^^^^
Manage the MySQL configuration. Manage the MySQL configuration.
@ -135,3 +165,49 @@ Manage the MySQL configuration.
component keys (`mysql.server`, `mysql.galera`, `mysql.libraries`, etc) with optional global component keys (`mysql.server`, `mysql.galera`, `mysql.libraries`, etc) with optional global
configuration from `mysql.global`. The monolithic configuration, however, is defined separately configuration from `mysql.global`. The monolithic configuration, however, is defined separately
in `mysql.config`. in `mysql.config`.
Testing
-------
Linux testing is done with ``kitchen-salt``.
Requirements
^^^^^^^^^^^^
* Ruby
* Docker
.. code-block:: bash
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]
Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
e.g. ``debian-9-2019-2-py3``.
``bin/kitchen converge``
^^^^^^^^^^^^^^^^^^^^^^^^
Creates the docker instance and runs the ``mysql`` main state, ready for testing.
``bin/kitchen verify``
^^^^^^^^^^^^^^^^^^^^^^
Runs the ``inspec`` tests on the actual instance.
``bin/kitchen destroy``
^^^^^^^^^^^^^^^^^^^^^^^
Removes the docker instance.
``bin/kitchen test``
^^^^^^^^^^^^^^^^^^^^
Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
``bin/kitchen login``
^^^^^^^^^^^^^^^^^^^^^
Gives you SSH access to the instance for manual testing.

166
kitchen.yml Normal file
View file

@ -0,0 +1,166 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# For help on this file's format, see https://kitchen.ci/
driver:
name: docker
use_sudo: false
privileged: true
run_command: /lib/systemd/systemd
# Make sure the platforms listed below match up with
# the `env.matrix` instances defined in `.travis.yml`
platforms:
## SALT `master`
- name: debian-10-master-py3
driver:
image: saltimages/salt-master-py3:debian-10
- name: ubuntu-2004-master-py3
driver:
image: saltimages/salt-master-py3:ubuntu-20.04
- name: ubuntu-1804-master-py3
driver:
image: saltimages/salt-master-py3:ubuntu-18.04
- name: centos-8-master-py3
driver:
image: saltimages/salt-master-py3:centos-8
- name: fedora-32-master-py3
driver:
image: saltimages/salt-master-py3:fedora-32
- name: fedora-31-master-py3
driver:
image: saltimages/salt-master-py3:fedora-31
- name: opensuse-leap-152-master-py3
driver:
image: saltimages/salt-master-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-2-master-py3
driver:
image: saltimages/salt-master-py3:amazonlinux-2
## SALT `3000.3`
- name: debian-10-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:debian-10
- name: debian-9-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:debian-9
- name: ubuntu-1804-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:ubuntu-18.04
- name: centos-8-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:centos-8
- name: centos-7-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:centos-7
- name: fedora-31-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:fedora-31
- name: opensuse-leap-152-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-2-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:amazonlinux-2
- name: ubuntu-1804-3000-3-py2
driver:
image: saltimages/salt-3000.3-py2:ubuntu-18.04
- name: ubuntu-1604-3000-3-py2
driver:
image: saltimages/salt-3000.3-py2:ubuntu-16.04
- name: arch-base-latest-3000-3-py2
driver:
image: saltimages/salt-3000.3-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd
## SALT `2019.2`
- name: debian-10-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:debian-10
- name: debian-9-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:debian-9
- name: ubuntu-1804-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:ubuntu-18.04
- name: ubuntu-1604-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:ubuntu-16.04
- name: centos-8-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:centos-8
- name: centos-7-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:centos-7
- name: fedora-31-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:fedora-31
- name: opensuse-leap-152-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-2-2019-2-py3
driver:
image: saltimages/salt-2019.2-py3:amazonlinux-2
- name: centos-6-2019-2-py2
driver:
image: saltimages/salt-2019.2-py2:centos-6
run_command: /sbin/init
- name: amazonlinux-1-2019-2-py2
driver:
image: saltimages/salt-2019.2-py2:amazonlinux-1
run_command: /sbin/init
- name: arch-base-latest-2019-2-py2
driver:
image: saltimages/salt-2019.2-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd
provisioner:
name: salt_solo
log_level: debug
salt_install: none
require_chef: false
formula: mysql
salt_copy_filter:
- .kitchen
- .git
verifier:
# https://www.inspec.io/
name: inspec
sudo: true
# cli, documentation, html, progress, json, json-min, json-rspec, junit
reporter:
- cli
suites:
- name: default
provisioner:
state_top:
base:
'*':
- mysql
pillars:
top.sls:
base:
'*':
- mysql
pillars_from_files:
mysql.sls: test/salt/pillar/mysql.sls
verifier:
inspec_tests:
- path: test/integration/default

View file

@ -1,4 +1,4 @@
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
{%- if "apparmor" in mysql.config %} {%- if "apparmor" in mysql.config %}

View file

@ -1,7 +1,7 @@
include: include:
- .config - .config
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
mysql: mysql:
pkg.installed: pkg.installed:

View file

@ -1,100 +1,100 @@
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
{% set os_family = salt['grains.get']('os_family', None) %} {%- set os_family = salt['grains.get']('os_family', None) %}
{% if "config_directory" in mysql %} {%- if "config_directory" in mysql %}
mysql_config_directory: mysql_config_directory:
file.directory: file.directory:
- name: {{ mysql.config_directory }} - name: {{ mysql.config_directory }}
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %} {%- if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root - user: root
- group: root - group: root
- mode: 755 - mode: 755
{% endif %} {%- endif %}
- makedirs: True - makedirs: True
{% if "server_config" in mysql %} {%- if "server_config" in mysql %}
mysql_server_config: mysql_server_config:
file.managed: file.managed:
- name: {{ mysql.config_directory + mysql.server_config.file }} - name: {{ mysql.config_directory + mysql.server_config.file }}
- template: jinja - template: jinja
- source: salt://{{ tpldir }}/files/server.cnf - source: salt://{{ tpldir }}/files/server.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %} {%- if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context: - context:
tpldir: {{ tpldir }} tpldir: {{ tpldir }}
- user: root - user: root
- group: root - group: root
- mode: 644 - mode: 644
{% endif %} {%- endif %}
- require: - require:
- file: mysql_config_directory - file: mysql_config_directory
{% endif %} {%- endif %}
{% if "galera_config" in mysql %} {%- if "galera_config" in mysql %}
mysql_galera_config: mysql_galera_config:
file.managed: file.managed:
- name: {{ mysql.config_directory + mysql.galera_config.file }} - name: {{ mysql.config_directory + mysql.galera_config.file }}
- template: jinja - template: jinja
- source: salt://{{ tpldir }}/files/galera.cnf - source: salt://{{ tpldir }}/files/galera.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %} {%- if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context: - context:
tpldir: {{ tpldir }} tpldir: {{ tpldir }}
- user: root - user: root
- group: root - group: root
- mode: 644 - mode: 644
{% endif %} {%- endif %}
- require: - require:
- file: mysql_config_directory - file: mysql_config_directory
{% endif %} {%- endif %}
{% if "library_config" in mysql %} {%- if "library_config" in mysql %}
mysql_library_config: mysql_library_config:
file.managed: file.managed:
- name: {{ mysql.config_directory + mysql.library_config.file }} - name: {{ mysql.config_directory + mysql.library_config.file }}
- template: jinja - template: jinja
- source: salt://{{ tpldir }}/files/client.cnf - source: salt://{{ tpldir }}/files/client.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %} {%- if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context: - context:
tpldir: {{ tpldir }} tpldir: {{ tpldir }}
- user: root - user: root
- group: root - group: root
- mode: 644 - mode: 644
{% endif %} {%- endif %}
- require: - require:
- file: mysql_config_directory - file: mysql_config_directory
{% endif %} {%- endif %}
{% if "clients_config" in mysql %} {%- if "clients_config" in mysql %}
mysql_clients_config: mysql_clients_config:
file.managed: file.managed:
- name: {{ mysql.config_directory + mysql.clients_config.file }} - name: {{ mysql.config_directory + mysql.clients_config.file }}
- template: jinja - template: jinja
- source: salt://{{ tpldir }}/files/mysql-clients.cnf - source: salt://{{ tpldir }}/files/mysql-clients.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %} {%- if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context: - context:
tpldir: {{ tpldir }} tpldir: {{ tpldir }}
- user: root - user: root
- group: root - group: root
- mode: 644 - mode: 644
{% endif %} {%- endif %}
- require: - require:
- file: mysql_config_directory - file: mysql_config_directory
{% endif %} {%- endif %}
{% endif %} {%- endif %}
mysql_config: mysql_config:
file.managed: file.managed:
- name: {{ mysql.config.file }} - name: {{ mysql.config.file }}
- template: jinja - template: jinja
{% if "config_directory" in mysql %} {%- if "config_directory" in mysql %}
- source: salt://{{ tpldir }}/files/my-include.cnf - source: salt://{{ tpldir }}/files/my-include.cnf
{% else %} {%- else %}
- source: salt://{{ tpldir }}/files/my.cnf - source: salt://{{ tpldir }}/files/my.cnf
{% endif %} {%- endif %}
- context: - context:
tpldir: {{ tpldir }} tpldir: {{ tpldir }}
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %} {%- if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root - user: root
- group: root - group: root
- mode: 644 - mode: 644
{% endif %} {%- endif %}

View file

@ -1,34 +1,46 @@
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
{% set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %} {%- set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %}
{% set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %} {%- set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %}
{% set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %} {%- set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %}
{% set db_states = [] %} {%- set db_states = [] %}
{% set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', mysql_root_user) %} {%- set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', mysql_root_user) %}
{% set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %} {%- set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %}
include: include:
- .python - .python
{% for database_obj in salt['pillar.get']('mysql:database', []) %} {%- for database_obj in salt['pillar.get']('mysql:database', []) %}
{% set state_id = 'mysql_db_' ~ loop.index0 %} {%- set state_id = 'mysql_db_' ~ loop.index0 %}
{% set database = database_obj.get('name') if database_obj is mapping else database_obj %} {%- if not database_obj %}{# in case database_obj == [] #}
{%- continue %}
{%- elif database_obj is mapping %}
{%- set database = database_obj.get('name') %}
{%- set present = database_obj.get('present', True) %}
{%- else %}
{%- set database = database_obj %}
{%- set present = True %}
{%- endif %}
{{ state_id }}: {{ state_id }}:
{%- if present %}
mysql_database.present: mysql_database.present:
{%- if database_obj is mapping %}
- character_set: {{ database_obj.get('character_set', '') }}
- collate: {{ database_obj.get('collate', '') }}
{%- endif %}
{%- else %}
mysql_database.absent:
{%- endif %}
- name: {{ database }} - name: {{ database }}
- connection_host: '{{ mysql_host }}' - connection_host: '{{ mysql_host }}'
- connection_user: '{{ mysql_salt_user }}' - connection_user: '{{ mysql_salt_user }}'
{% if mysql_salt_pass %} {%- if mysql_salt_pass %}
- connection_pass: '{{ mysql_salt_pass }}' - connection_pass: '{{ mysql_salt_pass }}'
{% endif %} {%- endif %}
{% if database_obj is mapping %}
- character_set: {{ database_obj.get('character_set', '') }}
- collate: {{ database_obj.get('collate', '') }}
{% endif %}
- connection_charset: utf8 - connection_charset: utf8
{% if salt['pillar.get'](['mysql', 'schema', database, 'load']|join(':'), False) %} {%- if salt['pillar.get'](['mysql', 'schema', database, 'load']|join(':'), False) %}
{{ state_id }}_schema: {{ state_id }}_schema:
file.managed: file.managed:
- name: /etc/mysql/{{ database }}.schema - name: /etc/mysql/{{ database }}.schema
@ -38,17 +50,17 @@ include:
{%- if template_type %} {%- if template_type %}
- template: {{ template_type }} - template: {{ template_type }}
- context: {{ template_context|yaml }} - context: {{ template_context|yaml }}
{% endif %} {%- endif %}
- user: {{ salt['pillar.get']('mysql:server:user', 'mysql') }} - user: {{ salt['pillar.get']('mysql:server:user', 'mysql') }}
- makedirs: True - makedirs: True
{{ state_id }}_load: {{ state_id }}_load:
cmd.wait: cmd.wait:
- name: mysql -u {{ mysql_salt_user }} -h{{ mysql_host }} {% if mysql_salt_pass %}-p{% endif %}{{ mysql_salt_pass }} {{ database }} < /etc/mysql/{{ database }}.schema - name: mysql -u {{ mysql_salt_user }} -h{{ mysql_host }} {% if mysql_salt_pass %}-p{%- endif %}{{ mysql_salt_pass }} {{ database }} < /etc/mysql/{{ database }}.schema
- watch: - watch:
- file: {{ state_id }}_schema - file: {{ state_id }}_schema
- mysql_database: {{ state_id }} - mysql_database: {{ state_id }}
{% endif %} {%- endif %}
{% do db_states.append(state_id) %} {%- do db_states.append(state_id) %}
{% endfor %} {%- endfor %}

View file

@ -1,10 +1,10 @@
# vim: sts=2 ts=2 sw=2 et ai # -*- coding: utf-8 -*-
# # vim: ft=yaml
---
mysql: mysql:
serverpkg: mysql-server serverpkg: mysql-server
clientpkg: mysql-client clientpkg: mysql-client
service: mysql service: mysql
pythonpkg: python-mysqldb
devpkg: mysql-devel devpkg: mysql-devel
debconf_utils: debconf-utils debconf_utils: debconf-utils
@ -26,8 +26,9 @@ mysql:
macos: macos:
userhomes: /Users userhomes: /Users
user: # `user` and `group` are set from `map.jinja`
group: # user: ~
# group: ~
dl: dl:
tmpdir: /tmp/mysqltmp tmpdir: /tmp/mysqltmp
prefix: /usr/local prefix: /usr/local
@ -36,65 +37,77 @@ mysql:
retries: 2 retries: 2
products: products:
community_server: community_server:
enabled: True enabled: true
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-8.0.11-macos10.13-x86_64.dmg url: https://downloads.mysql.com/archives/get/file/mysql-8.0.11-macos10.13-x86_64.dmg
sum: 'md5=602a84390ecf3d82025b1d99fc594124' sum: 'md5=602a84390ecf3d82025b1d99fc594124'
isapp: False isapp: false
path: /usr/local/mysql path: /usr/local/mysql
app: mysql app: mysql
workbench: workbench:
enabled: True enabled: true
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-workbench-community-8.0.11-rc-macos-x86_64.dmg url: https://downloads.mysql.com/archives/get/file/mysql-workbench-community-8.0.11-rc-macos-x86_64.dmg
sum: 'md5=37c5ae5bd75a4e1804ae6e0127d68611' sum: 'md5=37c5ae5bd75a4e1804ae6e0127d68611'
isapp: True isapp: true
path: /Applications/MySQLWorkbench/Contents/Versions/latest path: /Applications/MySQLWorkbench/Contents/Versions/latest
app: MySQLWorkbench app: MySQLWorkbench
cluster: cluster:
enabled: False enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-cluster-gpl-7.6.6-macos10.13-x86_64.dmg url: https://downloads.mysql.com/archives/get/file/mysql-cluster-gpl-7.6.6-macos10.13-x86_64.dmg
sum: 'md5=0df975908e7d8e4e8c1003d95edf4721' sum: 'md5=0df975908e7d8e4e8c1003d95edf4721'
isapp: False isapp: false
path: /usr/local/mysqlcluster path: /usr/local/mysqlcluster
app: MySQLCluster app: MySQLCluster
router: router:
enabled: False enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-router-8.0.11-macos10.13-x86-64bit.dmg url: https://downloads.mysql.com/archives/get/file/mysql-router-8.0.11-macos10.13-x86-64bit.dmg
sum: 'md5=8dd536f2f223933ecbfb8b19e54ee2f6' sum: 'md5=8dd536f2f223933ecbfb8b19e54ee2f6'
isapp: False isapp: false
app: MySQLRouter app: MySQLRouter
utilities: utilities:
enabled: False enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-utilities-1.6.5-macos10.12.dmg url: https://downloads.mysql.com/archives/get/file/mysql-utilities-1.6.5-macos10.12.dmg
sum: 'md5=4c8e75bb217b8293dcdeb915b649c2c8' sum: 'md5=4c8e75bb217b8293dcdeb915b649c2c8'
isapp: True ## ?? isapp: true ## ??
app: MySQLUtilties app: MySQLUtilties
shell: shell:
enabled: False enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-shell-8.0.11-macos10.13-x86-64bit.dmg url: https://downloads.mysql.com/archives/get/file/mysql-shell-8.0.11-macos10.13-x86-64bit.dmg
sum: 'md5=43db4f0fc39f88c1d7be4a4f52cec363' sum: 'md5=43db4f0fc39f88c1d7be4a4f52cec363'
isapp: True ## ?? isapp: true ## ??
app: MySQLShell app: MySQLShell
proxy: proxy:
enabled: False enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-proxy-0.8.5-osx10.7-x86-32bit.tar.gz url: https://downloads.mysql.com/archives/get/file/mysql-proxy-0.8.5-osx10.7-x86-32bit.tar.gz
sum: 'md5=107df22412aa8c483d2021e1af24ee22' sum: 'md5=107df22412aa8c483d2021e1af24ee22'
connnector: connector:
enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-connector-nodejs-8.0.11.tar.gz url: https://downloads.mysql.com/archives/get/file/mysql-connector-nodejs-8.0.11.tar.gz
sum: 'md5=dece7fe5607918ba68499ef07c31508d' sum: 'md5=dece7fe5607918ba68499ef07c31508d'
forvisualstudio: forvisualstudio:
enabled: False enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-for-visualstudio-2.0.4-src.zip url: https://downloads.mysql.com/archives/get/file/mysql-for-visualstudio-2.0.4-src.zip
sum: 'md5=fcf39316505ee2921e31a431eae77a9c' sum: 'md5=fcf39316505ee2921e31a431eae77a9c'
forexcel: forexcel:
enabled: False enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-for-excel-1.3.6-src.zip url: https://downloads.mysql.com/archives/get/file/mysql-for-excel-1.3.6-src.zip
sum: 'md5=2cc8b65eb72a1b07a6e4e2665e2a29e3' sum: 'md5=2cc8b65eb72a1b07a6e4e2665e2a29e3'
notifier: notifier:
enabled: False enabled: false
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-notifier-1.1.6-src.zip url: https://downloads.mysql.com/archives/get/file/mysql-notifier-1.1.6-src.zip
sum: 'md5=349f1994681763fd6626a8ddf6be5363' sum: 'md5=349f1994681763fd6626a8ddf6be5363'
#The following dict names are reserved for pillar data (see pillar.example) # The following dict names are reserved for pillar data (see pillar.example)
global: {} global: {}
clients: {} clients: {}
library: {} library: {}

View file

@ -1,4 +1,4 @@
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
mysql_dev: mysql_dev:
pkg: pkg:

View file

@ -1,4 +1,4 @@
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
mysql: mysql:
service.dead: service.dead:

View file

@ -2,10 +2,10 @@
CMD='/usr/bin/osascript -e' CMD='/usr/bin/osascript -e'
if [[ -e "{{ home }}/{{ user }}/Desktop/{{ app }}" ]] && [[ "${1}" -eq "remove" ]] if [[ -e "{{ home }}/{{ user }}/Desktop/{{ app }}" ]] && [[ "${1}" == "remove" ]]
then then
$CMD "tell application \"Finder\" to delete POSIX file \"{{home}}/{{user}}/Desktop/{{ app }}\"" $CMD "tell application \"Finder\" to delete POSIX file \"{{home}}/{{user}}/Desktop/{{ app }}\""
elif [[ -e "{{ dir }}/{{ app ~ '.app' if suffix else app }}" ]] && [[ "${1}" -eq "add" ]] elif [[ -e "{{ dir }}/{{ app ~ '.app' if suffix else app }}" ]] && [[ "${1}" == "add" ]]
then then
$CMD "tell application \"Finder\" to delete POSIX file \"{{home}}/{{user}}/Desktop/{{ app }}\"" >/dev/null 2>&1 $CMD "tell application \"Finder\" to delete POSIX file \"{{home}}/{{user}}/Desktop/{{ app }}\"" >/dev/null 2>&1
$CMD "tell application \"Finder\" to make new Alias at (path to desktop folder) to POSIX file \"{{ dir }}/{{ app }}{{ suffix or '' }}\"" $CMD "tell application \"Finder\" to make new Alias at (path to desktop folder) to POSIX file \"{{ dir }}/{{ app }}{{ suffix or '' }}\""

View file

@ -1,32 +1,32 @@
{% from tpldir ~ '/database.sls' import db_states with context %} {%- from tpldir ~ '/database.sls' import db_states with context %}
{% from tpldir ~ '/user.sls' import user_states with context %} {%- from tpldir ~ '/user.sls' import user_states with context %}
{% macro requisites(type, states) %} {%- macro requisites(type, states) %}
{%- for state in states %} {%- for state in states %}
- {{ type }}: {{ state }} - {{ type }}: {{ state }}
{%- endfor -%} {%- endfor -%}
{% endmacro %} {%- endmacro %}
{% set mysql_dev = salt['pillar.get']('mysql:dev:install', False) %} {%- set mysql_dev = salt['pillar.get']('mysql:dev:install', False) %}
{% set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', False) %} {%- set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', False) %}
include: include:
- .server - .server
{% if mysql_salt_user %} {%- if mysql_salt_user %}
- .salt-user - .salt-user
{% endif %} {%- endif %}
- .database - .database
- .user - .user
{% if mysql_dev %} {%- if mysql_dev %}
- .dev - .dev
{% endif %} {%- endif %}
{% if (db_states|length() + user_states|length()) > 0 %} {%- if (db_states|length() + user_states|length()) > 0 %}
extend: extend:
mysqld-service-running: mysqld-service-running:
service: service:
- require_in: - require_in:
{{ requisites('mysql_database', db_states) }} {{ requisites('mysql_database', db_states) }}
{{ requisites('mysql_user', user_states) }} {{ requisites('mysql_user', user_states) }}
{% endif %} {%- endif %}

View file

@ -9,29 +9,25 @@ mysql-macos-extract-dirs:
file.directory: file.directory:
- name: {{ dl.tmpdir }} - name: {{ dl.tmpdir }}
- makedirs: True - makedirs: True
- clean: True
{%- for product, data in mysql.macos.products.items() if "enabled" in data and data.enabled %} {%- for product, data in mysql.macos.products.items() if "enabled" in data and data.enabled %}
{%- set archivefile = data.url.split('/')[-1] %} {%- set archivefile = data.url.split('/')[-1] %}
{%- set archiveformat = archivefile.split('.')[-1] %} {%- set archiveformat = archivefile.split('.')[-1] %}
{%- set archivename = archivefile|replace('.dmg', '')|replace('.tar.gz', '')|replace('.zip', '') %} {%- set archivename = archivefile|replace('.dmg', '')|replace('.tar.gz', '')|replace('.zip', '') %}
mysql-macos-remove-previous-{{ product }}-download-archive:
file.absent:
- name: {{ dl.tmpdir }}/{{ archivefile }}
- require_in:
- mysql-macos-download-{{ product }}-archive
mysql-macos-download-{{ product }}-archive: mysql-macos-download-{{ product }}-archive:
pkg.installed: pkg.installed:
- name: curl - name: curl
cmd.run: cmd.run:
- name: curl {{ dl.opts }} -o {{ dl.tmpdir }}/{{ archivefile }} {{ data.url }} - name: curl {{ dl.opts }} -o {{ dl.tmpdir }}/{{ archivefile }} {{ data.url }}
{% if grains['saltversioninfo'] >= [2017, 7, 0] %} - unless: test -f {{ dl.tmpdir }}/{{ archivefile }}
{%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
- retry: - retry:
attempts: {{ dl.retries }} attempts: {{ dl.retries }}
interval: {{ dl.interval }} interval: {{ dl.interval }}
{% endif %} until: True
splay: 10
{%- endif %}
- require: - require:
- mysql-macos-extract-dirs - mysql-macos-extract-dirs
@ -41,8 +37,8 @@ mysql-macos-check-{{ product }}-archive-hash:
- name: file.check_hash - name: file.check_hash
- path: {{ dl.tmpdir }}/{{ archivefile }} - path: {{ dl.tmpdir }}/{{ archivefile }}
- file_hash: {{ data.sum }} - file_hash: {{ data.sum }}
- onchanges: - require:
- mysql-macos-download-{{ product }}-archive - cmd: mysql-macos-download-{{ product }}-archive
- require_in: - require_in:
- mysql-macos-{{ product }}-install - mysql-macos-{{ product }}-install
{%- endif %} {%- endif %}
@ -68,10 +64,7 @@ mysql-macos-{{ product }}-install:
- source_hash: {{ data.sum }} - source_hash: {{ data.sum }}
- onchanges: - onchanges:
- mysql-macos-download-{{ product }}-archive - mysql-macos-download-{{ product }}-archive
{%- endif %} {%- endif %}
- require_in:
- mysql-macos-tidyup-{{ product }}
{%- if "path" in data and data.path and "app" in data and data.app %} {%- if "path" in data and data.path and "app" in data and data.app %}
@ -100,12 +93,4 @@ mysql-macos-{{ product }}-desktop-shortcut-add:
- file: mysql-macos-{{ product }}-desktop-shortcut-add - file: mysql-macos-{{ product }}-desktop-shortcut-add
{%- endif %} {%- endif %}
{%- endfor %}
mysql-macos-tidyup-{{ product }}:
file.absent:
- name: {{ dl.tmpdir }}/{{ archivefile }}
- onchanges:
- mysql-macos-download-{{ product }}-archive
{% endfor %}

View file

@ -1,17 +1,61 @@
{% import_yaml "mysql/defaults.yaml" as defaults %} # -*- coding: utf-8 -*-
{% import_yaml "mysql/osfamilymap.yaml" as osfamilymap %} # vim: ft=jinja
{% import_yaml "mysql/osmap.yaml" as osmap %}
{% set mysql = salt['grains.filter_by']( {#- Get the `tplroot` from `tpldir` #}
defaults, {%- set tplroot = tpldir.split('/')[0] %}
{#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
{#- Retrieve the config dict only once #}
{%- set _config = salt['config.get'](tplroot, default={}) %}
{%- set py_ver_settings = {
2: {'pythonpkg': 'python-mysqldb'},
3: {'pythonpkg': 'python3-mysqldb'},
} %}
{%- set defaults = salt['grains.filter_by'](
py_ver_settings,
default=grains.pythonversion[0],
merge=salt['grains.filter_by'](
default_settings,
default=tplroot,
merge=salt['grains.filter_by']( merge=salt['grains.filter_by'](
osfamilymap, osfamilymap,
grain='os_family', grain='os_family',
merge=salt['grains.filter_by']( merge=salt['grains.filter_by'](
osmap, osmap,
grain='os', grain='os',
merge=salt['pillar.get']('mysql', {}), merge=salt['grains.filter_by'](
), osfingermap,
), grain='osfinger',
base='mysql', merge=salt['grains.filter_by'](
) %} _config,
default='lookup'
)
)
)
)
)
)
%}
{%- set config = salt['grains.filter_by'](
{'defaults': defaults},
default='defaults',
merge=_config
)
%}
{%- set mysql = config %}
{#- Post-processing for specific non-YAML customisations #}
{%- if grains.os == 'MacOS' %}
{%- set macos_user = salt['pillar.get']('mysql:user', salt['cmd.run']("stat -f '%Su' /dev/console")) %}
{%- set macos_group = salt['pillar.get']('mysql:group', salt['cmd.run']("stat -f '%Sg' /dev/console")) %}
{%- do mysql.macos.update({'user': macos_user}) %}
{%- do mysql.macos.update({'group': macos_group}) %}
{%- endif %}

View file

@ -1,15 +1,8 @@
# vim: sts=2 ts=2 sw=2 et ai # -*- coding: utf-8 -*-
# # vim: ft=yaml
---
Debian: Debian:
{% if salt['grains.get']('osmajorrelease')|int >= 9 %}
serverpkg: mariadb-server
service: mariadb
clientpkg: mariadb-client
devpkg: libmariadbclient-dev
{% else %}
devpkg: libmysqlclient-dev devpkg: libmysqlclient-dev
{% endif %}
config: config:
sections: sections:
@ -29,9 +22,9 @@ Debian:
thread_cache_size: 8 thread_cache_size: 8
expire_logs_days: 10 expire_logs_days: 10
max_binlog_size: 100M max_binlog_size: 100M
#innodb_flush_log_at_trx_commit: 1 # innodb_flush_log_at_trx_commit: 1
#innodb_lock_wait_timeout: 50 # innodb_lock_wait_timeout: 50
#innodb_file_per_table: noarg_present # innodb_file_per_table: noarg_present
mysqldump: mysqldump:
quick: noarg_present quick: noarg_present
quote_names: noarg_present quote_names: noarg_present
@ -40,31 +33,18 @@ Debian:
key_buffer_size: 16M key_buffer_size: 16M
append: | append: |
!includedir /etc/mysql/conf.d/ !includedir /etc/mysql/conf.d/
# {% if salt['grains.get']('osmajorrelease')|int >= 9 -%}
# !includedir /etc/mysql/mariadb.conf.d/
# {%- endif %}
RedHat: RedHat:
#https://mariadb.com/blog/rhel7-transition-mysql-mariadb-first-look
{%- if salt['grains.get']('osmajorrelease')|int in [7] %}
{% set fork = 'mariadb' %}
serverpkg: mariadb-server
service: mariadb
devpkg: mariadb-devel
{%- else %}
{% set fork = 'mysql' %}
service: mysqld service: mysqld
{%- endif %} clientpkg: mysql
clientpkg: {{ fork }}
pythonpkg: MySQL-python pythonpkg: MySQL-python
config: config:
file: /etc/my.cnf file: /etc/my.cnf
sections: sections:
client: client: {}
mysqld_safe: mysqld_safe:
log_error: /var/log/{{ fork }}/mysqld.log log_error: /var/log/mysql/mysqld.log
pid_file: /var/run/{{ fork }}/mysqld.pid pid_file: /var/run/mysql/mysqld.pid
mysqld: mysqld:
socket: /var/lib/mysql/mysql.sock socket: /var/lib/mysql/mysql.sock
bind_address: 127.0.0.1 bind_address: 127.0.0.1
@ -73,26 +53,24 @@ RedHat:
Suse: Suse:
serverpkg: mariadb serverpkg: mariadb
clientpkg: mariadb-client clientpkg: mariadb-client
{%- if salt['grains.get']('osmajorrelease')|int == 42 %} pythonpkg: python3-PyMySQL
# "old" package name up to Leap 42.x
pythonpkg: python-PyMySQL
{% else %}
pythonpkg: python2-pymysql
{% endif %}
config: config:
file: /etc/my.cnf file: /etc/my.cnf
sections: sections:
client: client:
socket: /var/run/mysql/mysql.sock socket: /run/mysql/mysql.sock
mysqld: mysqld:
# Empty values below to be resolved, disabling the rule in the meantime
# yamllint disable rule:empty-values
port: port:
user: user:
socket: socket:
datadir: datadir:
tmpdir: tmpdir:
# yamllint enable rule:empty-values
innodb_file_format: Barracuda innodb_file_format: Barracuda
innodb_file_per_table: ON innodb_file_per_table: 'ON'
server-id: 1 server-id: 1
sql_mode: NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES sql_mode: NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
mysqld_multi: mysqld_multi:
@ -107,6 +85,8 @@ Arch:
clientpkg: mariadb-clients clientpkg: mariadb-clients
service: mysqld service: mysqld
pythonpkg: mysql-python pythonpkg: mysql-python
# Empty value below to be resolved, disabling the rule in the meantime
# yamllint disable-line rule:empty-values
dev: dev:
config: config:
@ -176,7 +156,7 @@ Gentoo:
default_character_set: utf8 default_character_set: utf8
myisamchk: myisamchk:
character_sets_dir: /usr/share/mysql/charsets character_sets_dir: /usr/share/mysql/charsets
key_buffer: 20M ##????? key_buffer_size ? key_buffer: 20M ## ????? key_buffer_size ?
sort_buffer_size: 20M sort_buffer_size: 20M
read_buffer: 2M read_buffer: 2M
write_buffer: 2M write_buffer: 2M
@ -186,7 +166,8 @@ Gentoo:
err_log: /var/log/mysql/mysql.err err_log: /var/log/mysql/mysql.err
mysqld: mysqld:
character_set_serverpkg: utf8 character_set_serverpkg: utf8
# note: the gentoo init.d script specifically needs pid-file (dash not underscore) # note: the gentoo init.d script specifically needs pid-file
# (dash not underscore)
pid-file: /var/run/mysqld/mysqld.pid pid-file: /var/run/mysqld/mysqld.pid
log_error: /var/log/mysql/mysqld.err log_error: /var/log/mysql/mysqld.err
basedir: /usr basedir: /usr
@ -215,7 +196,7 @@ Gentoo:
innodb_lock_wait_timeout: 50 innodb_lock_wait_timeout: 50
innodb_file_per_table: noarg_present innodb_file_per_table: noarg_present
isamchk: isamchk:
key_buffer: 20M ##????? key_buffer_size ? key_buffer: 20M ## ????? key_buffer_size ?
sort_buffer_size: 20M sort_buffer_size: 20M
read_buffer: 2M read_buffer: 2M
write_buffer: 2M write_buffer: 2M
@ -223,20 +204,23 @@ Gentoo:
interactive_timeout: noarg_present interactive_timeout: noarg_present
FreeBSD: FreeBSD:
serverpkg: mysql56-server serverpkg: mysql57-server
clientpkg: mysql56-client clientpkg: mysql57-client
service: mysql-server service: mysql-server
pythonpkg: py27-pymysql pythonpkg: py37-pymysql
devpkg: mysql56-server devpkg: mysql57-server
config: config:
file: /usr/local/etc/my.cnf file: /usr/local/etc/mysql/my.cnf
sections: sections:
client: client:
socket: /tmp/mysql.sock socket: /tmp/mysql.sock
mysqld: mysqld:
# Empty values below to be resolved, disabling the rule in the meantime
# yamllint disable rule:empty-values
user: user:
datadir: datadir: /var/db/mysql
# yamllint enable rule:empty-values
socket: /tmp/mysql.sock socket: /tmp/mysql.sock
skip-external-locking: noarg_present skip-external-locking: noarg_present
key_buffer_size: 16M key_buffer_size: 16M

76
mysql/osfingermap.yaml Normal file
View file

@ -0,0 +1,76 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Debian
Debian-10:
serverpkg: mariadb-server
service: mariadb
clientpkg: mariadb-client
devpkg: libmariadbclient-dev
config:
append: |
!includedir /etc/mysql/conf.d/
# !includedir /etc/mysql/mariadb.conf.d/
Debian-9:
serverpkg: mariadb-server
service: mariadb
clientpkg: mariadb-client
devpkg: libmariadbclient-dev
config:
append: |
!includedir /etc/mysql/conf.d/
# !includedir /etc/mysql/mariadb.conf.d/
# Ubuntu
Ubuntu-20.04:
serverpkg: mariadb-server
service: mariadb
clientpkg: mariadb-client
devpkg: libmariadbclient-dev
config:
append: |
!includedir /etc/mysql/conf.d/
# !includedir /etc/mysql/mariadb.conf.d/
Ubuntu-18.04:
serverpkg: mariadb-server
# service: mariadb
clientpkg: mariadb-client
# devpkg: libmariadbclient-dev
Ubuntu-16.04:
serverpkg: mariadb-server
# service: mariadb
clientpkg: mariadb-client
# devpkg: libmariadbclient-dev
# Redhat
Redhat-7:
# https://mariadb.com/blog/rhel7-transition-mysql-mariadb-first-look
serverpkg: mariadb-server
service: mariadb
clientpkg: mariadb
devpkg: mariadb-devel
config:
sections:
mysqld_safe:
log_error: /var/log/mariadb/mysqld.log
pid_file: /var/run/mariadb/mysqld.pid
# CentOS
CentOS Linux-7:
# https://mariadb.com/blog/rhel7-transition-mysql-mariadb-first-look
serverpkg: mariadb-server
service: mariadb
clientpkg: mariadb
devpkg: mariadb-devel
config:
sections:
mysqld_safe:
log_error: /var/log/mariadb/mysqld.log
pid_file: /var/run/mariadb/mysqld.pid
server_config:
sections:
mysqld_safe:
log_error: /var/log/mariadb/mysqld.log
pid_file: /var/run/mariadb/mysqld.pid
# Suse
Leap-42:
pythonpkg: python-PyMySQL

View file

@ -1,13 +1,6 @@
# vim: ft=sls # -*- coding: utf-8 -*-
# vim: sts=2 ts=2 sw=2 et ai # vim: ft=yaml
---
{% if grains.os == 'MacOS' %}
MacOS:
macos:
user: {{ salt['pillar.get']('mysql:user', salt['cmd.run']("stat -f '%Su' /dev/console")) }}
group: {{ salt['pillar.get']('mysql:group', salt['cmd.run']("stat -f '%Sg' /dev/console")) }}
{% endif %}
Debian: Debian:
service: mysql service: mysql
@ -23,22 +16,13 @@ Ubuntu:
!includedir /etc/mysql/conf.d/ !includedir /etc/mysql/conf.d/
CentOS: CentOS:
# https://mariadb.com/blog/rhel7-transition-mysql-mariadb-first-look
{%- if salt['grains.get']('osmajorrelease')|int in [7] %}
{% set fork = 'mariadb' %}
{% set service = 'mariadb' %}
{%- else %}
{% set fork = 'mysql' %}
{% set service = 'mysqld' %}
{%- endif %}
config_directory: /etc/my.cnf.d/ config_directory: /etc/my.cnf.d/
server_config: server_config:
file: server.cnf file: server.cnf
sections: sections:
mysqld_safe: mysqld_safe:
log_error: /var/log/{{ fork }}/mysqld.log log_error: /var/log/mysql/mysqld.log
pid_file: /var/run/{{ fork }}/mysqld.pid pid_file: /var/run/mysql/mysqld.pid
mysqld: mysqld:
socket: /var/lib/mysql/mysql.sock socket: /var/lib/mysql/mysql.sock
bind_address: 127.0.0.1 bind_address: 127.0.0.1

View file

@ -1,5 +1,6 @@
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
mysql_python: mysql_python:
pkg.installed: pkg.installed:
- name: {{ mysql.pythonpkg }} - name: {{ mysql.pythonpkg }}
- reload_modules: True

View file

@ -1,8 +1,8 @@
{% set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %} {%- set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %}
{% set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %} {%- set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %}
{% set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %} {%- set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %}
{% set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', mysql_root_user) %} {%- set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', mysql_root_user) %}
{% set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %} {%- set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %}
include: include:
- .python - .python
@ -13,7 +13,7 @@ mysql remove test database:
- host: '{{ mysql_host }}' - host: '{{ mysql_host }}'
- connection_user: '{{ mysql_salt_user }}' - connection_user: '{{ mysql_salt_user }}'
- connection_host: '{{ mysql_host }}' - connection_host: '{{ mysql_host }}'
{% if mysql_salt_pass %} {%- if mysql_salt_pass %}
- connection_pass: '{{ mysql_salt_pass }}' - connection_pass: '{{ mysql_salt_pass }}'
{% endif %} {%- endif %}
- connection_charset: utf8 - connection_charset: utf8

View file

@ -1,26 +1,26 @@
include: include:
- .config - .config
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
# Completely ignore non-RHEL based systems # Completely ignore non-RHEL based systems
# TODO: Add Debian and Suse systems. # TODO: Add Debian and Suse systems.
# TODO: Allow user to specify MySQL version and alter yum repo file accordingly. # TODO: Allow user to specify MySQL version and alter yum repo file accordingly.
{% if grains['os_family'] == 'RedHat' %} {%- if grains['os_family'] == 'RedHat' and 'osmajorrelease' in grains %}
{% if grains['osmajorrelease']|int == 5 %} {%- if grains['osmajorrelease']|int == 5 %}
{% set rpm_source = "http://repo.mysql.com/mysql57-community-release-el5.rpm" %} {%- set rpm_source = "http://repo.mysql.com/mysql57-community-release-el5.rpm" %}
{% elif grains['osmajorrelease']|int == 6 %} {%- elif grains['osmajorrelease']|int == 6 %}
{% set rpm_source = "http://repo.mysql.com/mysql57-community-release-el6.rpm" %} {%- set rpm_source = "http://repo.mysql.com/mysql57-community-release-el6.rpm" %}
{% elif grains['osmajorrelease']|int == 7 %} {%- elif grains['osmajorrelease']|int == 7 %}
{% set rpm_source = "http://repo.mysql.com/mysql57-community-release-el7.rpm" %} {%- set rpm_source = "http://repo.mysql.com/mysql57-community-release-el7.rpm" %}
{% endif %} {%- endif %}
{% endif %} {%- endif %}
{% set mysql57_community_release = salt['pillar.get']('mysql:release', false) %} {%- set mysql57_community_release = salt['pillar.get']('mysql:release', false) %}
# A lookup table for MySQL Repo GPG keys & RPM URLs for various RedHat releases # A lookup table for MySQL Repo GPG keys & RPM URLs for various RedHat releases
{% set pkg = { {%- set pkg = {
'key': 'http://repo.mysql.com/RPM-GPG-KEY-mysql', 'key': 'http://repo.mysql.com/RPM-GPG-KEY-mysql',
'key_hash': 'md5=472a4a4867adfd31a68e8c9bbfacc23d', 'key_hash': 'md5=162ec8cb41add661b357e926a083b0cc',
'rpm': rpm_source 'rpm': rpm_source
} %} } %}
@ -38,12 +38,12 @@ mysql57_community_release:
- require: - require:
- file: install_pubkey_mysql - file: install_pubkey_mysql
- require_in: - require_in:
{% if "server_config" in mysql %} {%- if "server_config" in mysql %}
- pkg: {{ mysql.serverpkg }} - pkg: {{ mysql.serverpkg }}
{% endif %} {%- endif %}
{% if "clients_config" in mysql %} {%- if "clients_config" in mysql %}
- pkg: {{ mysql.clientpkg }} - pkg: {{ mysql.clientpkg }}
{% endif %} {%- endif %}
set_pubkey_mysql: set_pubkey_mysql:
file.replace: file.replace:

View file

@ -1,20 +1,20 @@
include: include:
- .server - .server
{% set os_family = salt['grains.get']('os_family', None) %} {%- set os_family = salt['grains.get']('os_family', None) %}
{% set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', 'salt') %} {%- set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', 'salt') %}
{% set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', salt['grains.get']('server_id')) %} {%- set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', salt['grains.get']('server_id')) %}
{% set mysql_salt_grants = salt['pillar.get']('mysql:salt_user:grants', []) %} {%- set mysql_salt_grants = salt['pillar.get']('mysql:salt_user:grants', []) %}
{% set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %} {%- set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %}
{% set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %} {%- set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %}
{% set mysql_root_hash = salt['pillar.get']('mysql:server:root_password_hash', None) %} {%- set mysql_root_hash = salt['pillar.get']('mysql:server:root_password_hash', None) %}
{% set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %} {%- set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %}
{% if mysql_host == 'localhost' %} {%- if mysql_host == 'localhost' %}
{% set host = 'localhost' %} {%- set host = 'localhost' %}
{% else %} {%- else %}
{% set host = grains['fqdn'] %} {%- set host = grains['fqdn'] %}
{% endif %} {%- endif %}
mysql_salt_user_with_salt_user: mysql_salt_user_with_salt_user:
mysql_user.present: mysql_user.present:
@ -25,13 +25,13 @@ mysql_salt_user_with_salt_user:
- connection_user: '{{ mysql_salt_user }}' - connection_user: '{{ mysql_salt_user }}'
- connection_pass: '{{ mysql_salt_pass }}' - connection_pass: '{{ mysql_salt_pass }}'
- connection_charset: utf8 - connection_charset: utf8
- onlyif: # - onlyif:
- mysql --user {{ mysql_salt_user }} --password='{{ mysql_salt_pass|replace("'", "'\"'\"'") }}' -h {{ mysql_host }} --execute="SELECT 1;" # - mysql --user {{ mysql_salt_user }} --password='{{ mysql_salt_pass|replace("'", "'\"'\"'") }}' -h {{ mysql_host }} --execute="SELECT 1;"
- VALUE=$(mysql --user {{ mysql_salt_user }} --password='{{ mysql_salt_pass|replace("'", "'\"'\"'") }}' -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'Y' ]; then /bin/true; else /bin/false; fi # - VALUE=$(mysql --user {{ mysql_salt_user }} --password='{{ mysql_salt_pass|replace("'", "'\"'\"'") }}' -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'Y' ]; then /bin/true; else /bin/false; fi
{% if os_family in ['RedHat', 'Suse'] %} {%- if os_family in ['RedHat', 'Suse'] %}
- require_in: - require_in:
- mysql_user: mysql_root_password - mysql_user: mysql_root_password
{% endif %} {%- endif %}
{%- if mysql_salt_grants != [] %} {%- if mysql_salt_grants != [] %}
mysql_salt_user_with_salt_user_grants: mysql_salt_user_with_salt_user_grants:
@ -51,11 +51,11 @@ mysql_salt_user_with_salt_user_grants:
- VALUE=$(mysql --user {{ mysql_salt_user }} --password='{{ mysql_salt_pass|replace("'", "'\"'\"'") }}' -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'Y' ]; then /bin/true; else /bin/false; fi - VALUE=$(mysql --user {{ mysql_salt_user }} --password='{{ mysql_salt_pass|replace("'", "'\"'\"'") }}' -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'Y' ]; then /bin/true; else /bin/false; fi
- require: - require:
- mysql_user: mysql_salt_user_with_salt_user - mysql_user: mysql_salt_user_with_salt_user
{% if os_family in ['RedHat', 'Suse'] %} {%- if os_family in ['RedHat', 'Suse'] %}
- require_in: - require_in:
- mysql_user: mysql_root_password - mysql_user: mysql_root_password
{% endif %} {%- endif %}
{% endif %} {%- endif %}
mysql_salt_user_with_root_user: mysql_salt_user_with_root_user:
mysql_user.present: mysql_user.present:
@ -69,10 +69,10 @@ mysql_salt_user_with_root_user:
- onlyif: - onlyif:
- mysql --user {{ mysql_root_user }} --password='{{ mysql_root_pass|replace("'", "'\"'\"'") }}' -h {{ mysql_host }} --execute="SELECT 1;" - mysql --user {{ mysql_root_user }} --password='{{ mysql_root_pass|replace("'", "'\"'\"'") }}' -h {{ mysql_host }} --execute="SELECT 1;"
- VALUE=$(mysql --user {{ mysql_root_user }} --password='{{ mysql_root_pass|replace("'", "'\"'\"'") }}' -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'N' -o -z "$VALUE" ]; then /bin/true; else /bin/false; fi - VALUE=$(mysql --user {{ mysql_root_user }} --password='{{ mysql_root_pass|replace("'", "'\"'\"'") }}' -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'N' -o -z "$VALUE" ]; then /bin/true; else /bin/false; fi
{% if os_family in ['RedHat', 'Suse'] %} {%- if os_family in ['RedHat', 'Suse'] %}
- require_in: - require_in:
- mysql_user: mysql_root_password - mysql_user: mysql_root_password
{% endif %} {%- endif %}
{%- if mysql_salt_grants != [] %} {%- if mysql_salt_grants != [] %}
mysql_salt_user_with_root_user_grants: mysql_salt_user_with_root_user_grants:
@ -92,11 +92,11 @@ mysql_salt_user_with_root_user_grants:
- VALUE=$(mysql --user {{ mysql_root_user }} --password='{{ mysql_root_pass|replace("'", "'\"'\"'") }}' -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'N' -o -z "$VALUE" ]; then /bin/true; else /bin/false; fi - VALUE=$(mysql --user {{ mysql_root_user }} --password='{{ mysql_root_pass|replace("'", "'\"'\"'") }}' -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'N' -o -z "$VALUE" ]; then /bin/true; else /bin/false; fi
- require: - require:
- mysql_user: mysql_salt_user_with_root_user - mysql_user: mysql_salt_user_with_root_user
{% if os_family in ['RedHat', 'Suse'] %} {%- if os_family in ['RedHat', 'Suse'] %}
- require_in: - require_in:
- mysql_user: mysql_root_password - mysql_user: mysql_root_password
{% endif %} {%- endif %}
{% endif %} {%- endif %}
mysql_salt_user_with_passwordless_root_user: mysql_salt_user_with_passwordless_root_user:
mysql_user.present: mysql_user.present:
@ -109,10 +109,10 @@ mysql_salt_user_with_passwordless_root_user:
- onlyif: - onlyif:
- mysql --user {{ mysql_root_user }} -h {{ mysql_host }} --execute="SELECT 1;" - mysql --user {{ mysql_root_user }} -h {{ mysql_host }} --execute="SELECT 1;"
- VALUE=$(mysql --user {{ mysql_root_user }} -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'N' -o -z "$VALUE" ]; then /bin/true; else /bin/false; fi - VALUE=$(mysql --user {{ mysql_root_user }} -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'N' -o -z "$VALUE" ]; then /bin/true; else /bin/false; fi
{% if os_family in ['RedHat', 'Suse'] %} {%- if os_family in ['RedHat', 'Suse'] %}
- require_in: - require_in:
- mysql_user: mysql_root_password - mysql_user: mysql_root_password
{% endif %} {%- endif %}
{%- if mysql_salt_grants != [] %} {%- if mysql_salt_grants != [] %}
mysql_salt_user_with_passwordless_root_user_grants: mysql_salt_user_with_passwordless_root_user_grants:
@ -131,13 +131,13 @@ mysql_salt_user_with_passwordless_root_user_grants:
- VALUE=$(mysql --user {{ mysql_root_user }} -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'N' -o -z "$VALUE" ]; then /bin/true; else /bin/false; fi - VALUE=$(mysql --user {{ mysql_root_user }} -ss -e "SELECT Grant_priv FROM mysql.user WHERE user = '{{ mysql_salt_user }}' AND host = '{{ host }}';"); if [ "$VALUE" = 'N' -o -z "$VALUE" ]; then /bin/true; else /bin/false; fi
- require: - require:
- mysql_user: mysql_salt_user_with_passwordless_root_user - mysql_user: mysql_salt_user_with_passwordless_root_user
{% if os_family in ['RedHat', 'Suse'] %} {%- if os_family in ['RedHat', 'Suse'] %}
- require_in: - require_in:
- mysql_user: mysql_root_password - mysql_user: mysql_root_password
{% endif %} {%- endif %}
{% endif %} {%- endif %}
{% if os_family in ['RedHat', 'Suse'] %} {%- if os_family in ['RedHat', 'Suse'] %}
extend: extend:
mysql_root_password: mysql_root_password:
cmd.run: cmd.run:
@ -157,4 +157,4 @@ extend:
- connection_user: '{{ mysql_salt_user }}' - connection_user: '{{ mysql_salt_user }}'
- connection_pass: '{{ mysql_salt_pass }}' - connection_pass: '{{ mysql_salt_pass }}'
- connection_charset: utf8 - connection_charset: utf8
{% endif %} {%- endif %}

View file

@ -42,7 +42,7 @@ mysql_debconf:
- require: - require:
- pkg: mysql_debconf_utils - pkg: mysql_debconf_utils
{% if salt['grains.get']('osmajorrelease')|int < 9 or not salt['grains.get']('os')|lower == 'debian' %} {%- if 'osmajorrelease' in grains and salt['grains.get']('osmajorrelease')|int < 9 or not salt['grains.get']('os')|lower == 'debian' %}
{% if mysql.serverpkg == 'mysql-community-server' %} {% if mysql.serverpkg == 'mysql-community-server' %}
mysql_password_debconf: mysql_password_debconf:
@ -71,7 +71,7 @@ mysql_password_debconf:
{% endif %} {% endif %}
{% endif %} {% endif %}
{% elif os_family in ['RedHat', 'Suse', 'FreeBSD'] %} {%- elif os_family in ['RedHat', 'Suse', 'FreeBSD'] %}
mysql_root_password: mysql_root_password:
cmd.run: cmd.run:
- name: mysqladmin --host "{{ mysql_host }}" --user {{ mysql_root_user }} password '{{ mysql_root_password|replace("'", "'\"'\"'") }}' - name: mysqladmin --host "{{ mysql_host }}" --user {{ mysql_root_user }} password '{{ mysql_root_password|replace("'", "'\"'\"'") }}'
@ -79,7 +79,7 @@ mysql_root_password:
- require: - require:
- service: mysqld-service-running - service: mysqld-service-running
{% for host in {'localhost': '', 'localhost.localdomain': '', salt['grains.get']('fqdn'): ''}.keys() %} {%- for host in {'localhost': '', 'localhost.localdomain': '', salt['grains.get']('fqdn'): ''}.keys() %}
mysql_delete_anonymous_user_{{ host }}: mysql_delete_anonymous_user_{{ host }}:
mysql_user: mysql_user:
- absent - absent
@ -87,9 +87,9 @@ mysql_delete_anonymous_user_{{ host }}:
- name: '' - name: ''
- connection_host: '{{ mysql_host }}' - connection_host: '{{ mysql_host }}'
- connection_user: '{{ mysql_salt_user }}' - connection_user: '{{ mysql_salt_user }}'
{% if mysql_salt_password %} {%- if mysql_salt_password %}
- connection_pass: '{{ mysql_salt_password }}' - connection_pass: '{{ mysql_salt_password }}'
{% endif %} {%- endif %}
- connection_charset: utf8 - connection_charset: utf8
- require: - require:
- service: mysqld-service-running - service: mysqld-service-running
@ -100,19 +100,19 @@ mysql_delete_anonymous_user_{{ host }}:
{%- if (mysql_salt_user != mysql_root_user) %} {%- if (mysql_salt_user != mysql_root_user) %}
- sls: mysql.salt-user - sls: mysql.salt-user
{%- endif %} {%- endif %}
{% endfor %} {%- endfor %}
{% endif %} {%- endif %}
{% endif %} {%- endif %}
{% if os_family == 'Arch' %} {%- if os_family == 'Arch' %}
# on arch linux: inital mysql datadirectory is not created # on arch linux: inital mysql datadirectory is not created
mysql_install_datadir: mysql_install_datadir:
cmd.run: cmd.run:
{% if mysql.version is defined and mysql.version >= 5.7 %} {%- if mysql.version is defined and mysql.version >= 5.7 %}
- name: mysqld --initialize-insecure --user=mysql --basedir=/usr --datadir={{ mysql_datadir }} - name: mysqld --initialize-insecure --user=mysql --basedir=/usr --datadir={{ mysql_datadir }}
{% else %} {%- else %}
- name: mysql_install_db --user=mysql --basedir=/usr --datadir={{ mysql_datadir }} - name: mysql_install_db --user=mysql --basedir=/usr --datadir={{ mysql_datadir }}
{% endif %} {%- endif %}
- runas: root - runas: root
- creates: {{ mysql_datadir }}/mysql/user.frm - creates: {{ mysql_datadir }}/mysql/user.frm
- env: - env:
@ -122,33 +122,33 @@ mysql_install_datadir:
- file: mysql_config - file: mysql_config
- require_in: - require_in:
- service: mysqld-service-running - service: mysqld-service-running
{% endif %} {%- endif %}
mysqld-packages: mysqld-packages:
pkg.installed: pkg.installed:
- name: {{ mysql.serverpkg }} - name: {{ mysql.serverpkg }}
{% if os_family == 'Debian' and mysql_root_password %} {%- if os_family == 'Debian' and mysql_root_password %}
- require: - require:
- debconf: mysql_debconf - debconf: mysql_debconf
{% endif %} {%- endif %}
- require_in: - require_in:
- file: mysql_config - file: mysql_config
{% if "config_directory" in mysql %} {%- if "config_directory" in mysql %}
- file: mysql_config_directory - file: mysql_config_directory
{% endif %} {%- endif %}
{% if os_family in ['RedHat', 'Suse'] and mysql.version is defined and mysql.version >= 5.7 and mysql.serverpkg.lower() != 'mariadb-server' %} {%- if os_family in ['RedHat', 'Suse'] and mysql.version is defined and mysql.version >= 5.7 and mysql.serverpkg.lower() != 'mariadb-server' %}
# Initialize mysql database with --initialize-insecure option before starting service so we don't get locked out. # Initialize mysql database with --initialize-insecure option before starting service so we don't get locked out.
mysql_initialize: mysql_initialize:
cmd.run: cmd.run:
- name: mysqld --initialize-insecure --user=mysql --basedir=/usr --datadir={{ mysql_datadir }} - name: mysqld --initialize-insecure --user=mysql --basedir=/usr --datadir={{ mysql_datadir }}
- runas: root - runas: root
- creates: {{ mysql_datadir}}/mysql/ - creates: {{ mysql_datadir }}/mysql/
- require: - require:
- pkg: {{ mysql.serverpkg }} - pkg: {{ mysql.serverpkg }}
{% endif %} {%- endif %}
{% if os_family in ['RedHat', 'Suse'] and mysql.serverpkg.lower() == 'mariadb-server' %} {%- if os_family in ['RedHat', 'Suse'] and mysql.serverpkg.lower() == 'mariadb-server' %}
# For MariaDB it's enough to only create the datadir # For MariaDB it's enough to only create the datadir
mysql_initialize: mysql_initialize:
file.directory: file.directory:
@ -158,17 +158,33 @@ mysql_initialize:
- makedirs: True - makedirs: True
- require: - require:
- pkg: {{ mysql.serverpkg }} - pkg: {{ mysql.serverpkg }}
{% endif %} {%- endif %}
{% if os_family in ['Gentoo'] %} {%- if os_family in ['Gentoo'] %}
mysql_initialize: mysql_initialize:
cmd.run: cmd.run:
- name: emerge --config {{ mysql.serverpkg }} - name: emerge --config {{ mysql.serverpkg }}
- runas: root - runas: root
- creates: {{ mysql_datadir}}/mysql/ - creates: {{ mysql_datadir }}/mysql/
- require: - require:
- pkg: {{ mysql.serverpkg }} - pkg: {{ mysql.serverpkg }}
{% endif %} {%- endif %}
{%- if os_family in ['FreeBSD'] and mysql.serverpkg.lower() != 'mariadb-server' %}
mysql_initialize:
file.directory:
- name: /var/log/mysql
- user: mysql
- group: mysql
- mode: '0750'
cmd.run:
- name: /usr/local/libexec/mysqld --initialize-insecure --user=mysql --basedir=/usr/local --datadir={{ mysql_datadir }}
- runas: root
- creates: {{ mysql_datadir }}/mysql/
- require:
- pkg: {{ mysql.serverpkg }}
- file: /var/log/mysql
{%- endif %}
mysqld-service-running: mysqld-service-running:
service.running: service.running:
@ -176,17 +192,17 @@ mysqld-service-running:
- enable: True - enable: True
- require: - require:
- pkg: {{ mysql.serverpkg }} - pkg: {{ mysql.serverpkg }}
{% if (os_family in ['RedHat', 'Suse'] and mysql.version is defined and mysql.version >= 5.7 and mysql.serverpkg.lower() != 'mariadb-server') or (os_family in ['Gentoo']) %} {%- if (os_family in ['RedHat', 'Suse'] and mysql.version is defined and mysql.version >= 5.7 and mysql.serverpkg.lower() != 'mariadb-server') or (os_family in ['Gentoo', 'FreeBSD']) %}
- cmd: mysql_initialize - cmd: mysql_initialize
{% elif os_family in ['RedHat', 'Suse'] and mysql.serverpkg.lower() == 'mariadb-server' %} {%- elif os_family in ['RedHat', 'Suse'] and mysql.serverpkg.lower() == 'mariadb-server' %}
- file: {{ mysql_datadir }} - file: {{ mysql_datadir }}
{% endif %} {%- endif %}
- watch: - watch:
- pkg: {{ mysql.serverpkg }} - pkg: {{ mysql.serverpkg }}
- file: mysql_config - file: mysql_config
{% if "config_directory" in mysql and "server_config" in mysql %} {%- if "config_directory" in mysql and "server_config" in mysql %}
- file: mysql_server_config - file: mysql_server_config
{% endif %} {%- endif %}
mysql_what_is_status_of_{{ mysql.service }}: mysql_what_is_status_of_{{ mysql.service }}:
cmd.run: cmd.run:

View file

@ -1,39 +1,40 @@
{% from tpldir ~ "/map.jinja" import mysql with context %} {%- from tpldir ~ "/map.jinja" import mysql with context %}
{%- set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %} {%- set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %}
{%- set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %} {%- set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %}
{%- set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %} {%- set mysql_host = salt['pillar.get']('mysql:server:host', 'localhost') %}
{% set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', mysql_root_user) %} {%- set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', mysql_root_user) %}
{% set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %} {%- set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %}
{% set user_states = [] %} {%- set user_states = [] %}
{% set user_hosts = [] %} {%- set user_hosts = [] %}
include: include:
- .python - .python
{% for name, user in salt['pillar.get']('mysql:user', {}).items() %} {%- for name, user in salt['pillar.get']('mysql:user', {}).items() %}
{% set user_host = salt['pillar.get']('mysql:user:%s:host'|format(name)) %} {%- set user_host = salt['pillar.get']('mysql:user:%s:host'|format(name)) %}
{% if user_host != '' %} {%- if user_host != '' %}
{% set user_hosts = [user_host] %} {%- set user_hosts = [user_host] %}
{% else %} {%- else %}
{% set user_hosts = salt['pillar.get']('mysql:user:%s:hosts'|format(name)) %} {%- set user_hosts = salt['pillar.get']('mysql:user:%s:hosts'|format(name)) %}
{% endif %} {%- endif %}
{% if not user_hosts %} {%- if not user_hosts %}
{% set mine_target = salt['pillar.get']('mysql:user:%s:mine_hosts:target'|format(name)) %} {%- set mine_target = salt['pillar.get']('mysql:user:%s:mine_hosts:target'|format(name)) %}
{% set mine_function = salt['pillar.get']('mysql:user:%s:mine_hosts:function'|format(name)) %} {%- set mine_function = salt['pillar.get']('mysql:user:%s:mine_hosts:function'|format(name)) %}
{% set mine_expression_form = salt['pillar.get']('mysql:user:%s:mine_hosts:expr_form'|format(name)) %} {%- set mine_expression_form = salt['pillar.get']('mysql:user:%s:mine_hosts:expr_form'|format(name)) %}
{% if mine_target and mine_function and mine_expression_form %} {%- if mine_target and mine_function and mine_expression_form %}
{% set user_hosts = salt['mine.get'](mine_target, mine_function, mine_expression_form).values() %} {%- set user_hosts = salt['mine.get'](mine_target, mine_function, mine_expression_form).values() %}
{% endif %} {%- endif %}
{% endif %} {%- endif %}
{% for host in user_hosts %} {%- for host in user_hosts %}
{% set state_id = 'mysql_user_' ~ name ~ '_' ~ host%} {%- set state_id = 'mysql_user_' ~ name ~ '_' ~ host %}
{{ state_id }}: {{ state_id }}:
{%- if user.get('present', True) %}
mysql_user.present: mysql_user.present:
- name: {{ name }} - name: {{ name }}
- host: '{{ host }}' - host: '{{ host }}'
@ -41,14 +42,22 @@ include:
- password_hash: '{{ user['password_hash'] }}' - password_hash: '{{ user['password_hash'] }}'
{%- elif user['password'] is defined and user['password'] != None %} {%- elif user['password'] is defined and user['password'] != None %}
- password: '{{ user['password'] }}' - password: '{{ user['password'] }}'
{%- elif user['unix_socket'] is defined and user['unix_socket'] != None %}
- allow_passwordless: True
- unix_socket: True
{%- else %} {%- else %}
- allow_passwordless: True - allow_passwordless: True
{%- endif %}
{%- else %}
mysql_user.absent:
- name: {{ name }}
- host: '{{ host }}'
{%- endif %} {%- endif %}
- connection_host: '{{ mysql_host }}' - connection_host: '{{ mysql_host }}'
- connection_user: '{{ mysql_salt_user }}' - connection_user: '{{ mysql_salt_user }}'
{% if mysql_salt_pass %} {%- if mysql_salt_pass %}
- connection_pass: '{{ mysql_salt_pass }}' - connection_pass: '{{ mysql_salt_pass }}'
{% endif %} {%- endif %}
- connection_charset: utf8 - connection_charset: utf8
{%- if 'grants' in user %} {%- if 'grants' in user %}
@ -58,72 +67,72 @@ include:
- grant: {{ user['grants']|join(",") }} - grant: {{ user['grants']|join(",") }}
- database: '*.*' - database: '*.*'
- grant_option: {{ user['grant_option'] | default(False) }} - grant_option: {{ user['grant_option'] | default(False) }}
{% if 'ssl' in user or 'ssl-X509' in user %} {%- if 'ssl' in user or 'ssl-X509' in user %}
- ssl_option: - ssl_option:
- SSL: {{ user['ssl'] | default(False) }} - SSL: {{ user['ssl'] | default(False) }}
{% if user['ssl-X509'] is defined %} {%- if user['ssl-X509'] is defined %}
- X509: {{ user['ssl-X509'] }} - X509: {{ user['ssl-X509'] }}
{% endif %} {%- endif %}
{% if user['ssl-SUBJECT'] is defined %} {%- if user['ssl-SUBJECT'] is defined %}
- SUBJECT: {{ user['ssl-SUBJECT'] }} - SUBJECT: {{ user['ssl-SUBJECT'] }}
{% endif %} {%- endif %}
{% if user['ssl-ISSUER'] is defined %} {%- if user['ssl-ISSUER'] is defined %}
- ISSUER: {{ user['ssl-ISSUER'] }} - ISSUER: {{ user['ssl-ISSUER'] }}
{% endif %} {%- endif %}
{% if user['ssl-CIPHER'] is defined %} {%- if user['ssl-CIPHER'] is defined %}
- CIPHER: {{ user['ssl-CIPHER'] }} - CIPHER: {{ user['ssl-CIPHER'] }}
{% endif %} {%- endif %}
{% endif %} {%- endif %}
- user: {{ name }} - user: {{ name }}
- host: '{{ host }}' - host: '{{ host }}'
- connection_host: '{{ mysql_host }}' - connection_host: '{{ mysql_host }}'
- connection_user: '{{ mysql_salt_user }}' - connection_user: '{{ mysql_salt_user }}'
{% if mysql_salt_pass -%} {%- if mysql_salt_pass %}
- connection_pass: '{{ mysql_salt_pass }}' - connection_pass: '{{ mysql_salt_pass }}'
{% endif %} {%- endif %}
- connection_charset: utf8 - connection_charset: utf8
- require: - require:
- mysql_user: {{ state_id }} - mysql_user: {{ state_id }}
{% endif %} {%- endif %}
{%- if 'databases' in user %} {%- if 'databases' in user %}
{% for db in user['databases'] %} {%- for db in user['databases'] %}
{{ state_id ~ '_' ~ loop.index0 }}: {{ state_id ~ '_' ~ loop.index0 }}:
mysql_grants.present: mysql_grants.present:
- name: {{ name ~ '_' ~ db['database'] ~ '_' ~ db['table'] | default('all') }} - name: {{ name ~ '_' ~ db['database'] ~ '_' ~ db['table'] | default('all') }}
- grant: {{db['grants']|join(",")}} - grant: {{ db['grants']|join(",") }}
- database: '{{ db['database'] }}.{{ db['table'] | default('*') }}' - database: '{{ db['database'] }}.{{ db['table'] | default('*') }}'
- grant_option: {{ db['grant_option'] | default(False) }} - grant_option: {{ db['grant_option'] | default(False) }}
{% if 'ssl' in user or 'ssl-X509' in user %} {%- if 'ssl' in user or 'ssl-X509' in user %}
- ssl_option: - ssl_option:
- SSL: {{ user['ssl'] | default(False) }} - SSL: {{ user['ssl'] | default(False) }}
{% if user['ssl-X509'] is defined %} {%- if user['ssl-X509'] is defined %}
- X509: {{ user['ssl-X509'] }} - X509: {{ user['ssl-X509'] }}
{% endif %} {%- endif %}
{% if user['ssl-SUBJECT'] is defined %} {%- if user['ssl-SUBJECT'] is defined %}
- SUBJECT: {{ user['ssl-SUBJECT'] }} - SUBJECT: {{ user['ssl-SUBJECT'] }}
{% endif %} {%- endif %}
{% if user['ssl-ISSUER'] is defined %} {%- if user['ssl-ISSUER'] is defined %}
- ISSUER: {{ user['ssl-ISSUER'] }} - ISSUER: {{ user['ssl-ISSUER'] }}
{% endif %} {%- endif %}
{% if user['ssl-CIPHER'] is defined %} {%- if user['ssl-CIPHER'] is defined %}
- CIPHER: {{ user['ssl-CIPHER'] }} - CIPHER: {{ user['ssl-CIPHER'] }}
{% endif %} {%- endif %}
{% endif %} {%- endif %}
- user: {{ name }} - user: {{ name }}
- host: '{{ host }}' - host: '{{ host }}'
- escape: {{ db['escape'] | default(True) }} - escape: {{ db['escape'] | default(True) }}
- connection_host: '{{ mysql_host }}' - connection_host: '{{ mysql_host }}'
- connection_user: '{{ mysql_salt_user }}' - connection_user: '{{ mysql_salt_user }}'
{% if mysql_salt_pass -%} {%- if mysql_salt_pass %}
- connection_pass: '{{ mysql_salt_pass }}' - connection_pass: '{{ mysql_salt_pass }}'
{% endif %} {%- endif %}
- connection_charset: utf8 - connection_charset: utf8
- require: - require:
- mysql_user: {{ state_id }} - mysql_user: {{ state_id }}
{% endfor %} {%- endfor %}
{% endif %} {%- endif %}
{% do user_states.append(state_id) %} {%- do user_states.append(state_id) %}
{% endfor %} {%- endfor %}
{% endfor %} {%- endfor %}

View file

@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
mysql: mysql:
global: global:
client-server: client-server:
@ -72,25 +75,28 @@ mysql:
- name: bar - name: bar
character_set: utf8 character_set: utf8
collate: utf8_general_ci collate: utf8_general_ci
# Delete DB
- name: obsolete_db
present: false
schema: schema:
foo: foo:
load: True load: true
source: salt://{{ tpldir }}/files/foo.schema source: salt://{{ tpldir }}/files/foo.schema
bar: bar:
load: False load: false
baz: baz:
load: True load: true
source: salt://{{ tpldir }}/files/baz.schema.tmpl source: salt://{{ tpldir }}/files/baz.schema.tmpl
template: jinja template: jinja
qux: qux:
load: True load: true
source: salt://{{ tpldir }}/files/qux.schema.tmpl source: salt://{{ tpldir }}/files/qux.schema.tmpl
template: jinja template: jinja
context: context:
encabulator: Turbo encabulator: Turbo
girdlespring: differential girdlespring: differential
quux: quux:
load: True load: true
source: salt://{{ tpldir }}/files/qux.schema.tmpl source: salt://{{ tpldir }}/files/qux.schema.tmpl
template: jinja template: jinja
context: context:
@ -106,14 +112,14 @@ mysql:
databases: databases:
- database: foo - database: foo
grants: ['select', 'insert', 'update'] grants: ['select', 'insert', 'update']
escape: True escape: true
- database: bar - database: bar
grants: ['all privileges'] grants: ['all privileges']
bob: bob:
password_hash: '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4' password_hash: '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4'
host: localhost host: '%' # Any host
ssl: True ssl: true
ssl-X509: True ssl-X509: true
ssl-SUBJECT: Subject ssl-SUBJECT: Subject
ssl-ISSUER: Name ssl-ISSUER: Name
ssl-CIPHER: Cipher ssl-CIPHER: Cipher
@ -124,11 +130,18 @@ mysql:
# use two '%' # use two '%'
- database: '`foo\_%%`' - database: '`foo\_%%`'
grants: ['all privileges'] grants: ['all privileges']
grant_option: True grant_option: true
escape: False escape: false
- database: bar - database: bar
table: foobar table: foobar
grants: ['select', 'insert', 'update', 'delete'] grants: ['select', 'insert', 'update', 'delete']
# User 'alice' will be allowed to connect to the server without password
# as long as she has access to the unix socket.
# This option forces allow_passwordless to be set to True
alice:
host: 'localhost'
unix_socket: true
nopassuser: nopassuser:
password: ~ password: ~
host: localhost host: localhost
@ -143,6 +156,12 @@ mysql:
- database: foo - database: foo
grants: ['select', 'insert', 'update'] grants: ['select', 'insert', 'update']
# Remove a user
obsoleteuser:
host: localhost
# defaults to true
present: false
# Override any names defined in map.jinja # Override any names defined in map.jinja
# serverpkg: mysql-server # serverpkg: mysql-server
# clientpkg: mysql-client # clientpkg: mysql-client
@ -153,53 +172,63 @@ mysql:
# Install MySQL headers # Install MySQL headers
dev: dev:
# Install dev package - defaults to False # Install dev package - defaults to false
install: False install: false
macos: macos:
products: products:
community_server: community_server:
enabled: True # default enabled: true # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-8.0.11-macos10.13-x86_64.dmg url: https://downloads.mysql.com/archives/get/file/mysql-8.0.11-macos10.13-x86_64.dmg
sum: 'md5=602a84390ecf3d82025b1d99fc594124' sum: 'md5=602a84390ecf3d82025b1d99fc594124'
workbench: workbench:
enabled: True # default enabled: true # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-workbench-community-8.0.11-rc-macos-x86_64.dmg url: https://downloads.mysql.com/archives/get/file/mysql-workbench-community-8.0.11-rc-macos-x86_64.dmg
sum: 'md5=37c5ae5bd75a4e1804ae6e0127d68611' sum: 'md5=37c5ae5bd75a4e1804ae6e0127d68611'
cluster: cluster:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-cluster-gpl-7.6.6-macos10.13-x86_64.dmg url: https://downloads.mysql.com/archives/get/file/mysql-cluster-gpl-7.6.6-macos10.13-x86_64.dmg
sum: 'md5=0df975908e7d8e4e8c1003d95edf4721' sum: 'md5=0df975908e7d8e4e8c1003d95edf4721'
router: router:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-router-8.0.11-macos10.13-x86-64bit.dmg url: https://downloads.mysql.com/archives/get/file/mysql-router-8.0.11-macos10.13-x86-64bit.dmg
sum: 'md5=8dd536f2f223933ecbfb8b19e54ee2f6' sum: 'md5=8dd536f2f223933ecbfb8b19e54ee2f6'
utilities: utilities:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-utilities-1.6.5-macos10.12.dmg url: https://downloads.mysql.com/archives/get/file/mysql-utilities-1.6.5-macos10.12.dmg
sum: 'md5=4c8e75bb217b8293dcdeb915b649c2c8' sum: 'md5=4c8e75bb217b8293dcdeb915b649c2c8'
shell: shell:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-shell-8.0.11-macos10.13-x86-64bit.dmg url: https://downloads.mysql.com/archives/get/file/mysql-shell-8.0.11-macos10.13-x86-64bit.dmg
sum: 'md5=43db4f0fc39f88c1d7be4a4f52cec363' sum: 'md5=43db4f0fc39f88c1d7be4a4f52cec363'
proxy: proxy:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-proxy-0.8.5-osx10.7-x86-32bit.tar.gz url: https://downloads.mysql.com/archives/get/file/mysql-proxy-0.8.5-osx10.7-x86-32bit.tar.gz
sum: 'md5=107df22412aa8c483d2021e1af24ee22' sum: 'md5=107df22412aa8c483d2021e1af24ee22'
connnector: connector:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-connector-nodejs-8.0.11.tar.gz url: https://downloads.mysql.com/archives/get/file/mysql-connector-nodejs-8.0.11.tar.gz
sum: 'md5=dece7fe5607918ba68499ef07c31508d' sum: 'md5=dece7fe5607918ba68499ef07c31508d'
forvisualstudio: forvisualstudio:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-for-visualstudio-2.0.4-src.zip url: https://downloads.mysql.com/archives/get/file/mysql-for-visualstudio-2.0.4-src.zip
sum: 'md5=fcf39316505ee2921e31a431eae77a9c' sum: 'md5=fcf39316505ee2921e31a431eae77a9c'
forexcel: forexcel:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-for-excel-1.3.6-src.zip url: https://downloads.mysql.com/archives/get/file/mysql-for-excel-1.3.6-src.zip
sum: 'md5=2cc8b65eb72a1b07a6e4e2665e2a29e3' sum: 'md5=2cc8b65eb72a1b07a6e4e2665e2a29e3'
notifier: notifier:
enabled: False #default enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-notifier-1.1.6-src.zip url: https://downloads.mysql.com/archives/get/file/mysql-notifier-1.1.6-src.zip
sum: 'md5=349f1994681763fd6626a8ddf6be5363' sum: 'md5=349f1994681763fd6626a8ddf6be5363'

30
pre-commit_semantic-release.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/sh
###############################################################################
# (A) Update `FORMULA` with `${nextRelease.version}`
###############################################################################
sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA
###############################################################################
# (B) Use `m2r` to convert automatically produced `.md` docs to `.rst`
###############################################################################
# Install `m2r`
sudo -H pip install m2r
# Copy and then convert the `.md` docs
cp ./*.md docs/
cd docs/ || exit
m2r --overwrite ./*.md
# Change excess `H1` headings to `H2` in converted `CHANGELOG.rst`
sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst
sed -i -e '1,4s/-/=/g' CHANGELOG.rst
# Use for debugging output, when required
# cat AUTHORS.rst
# cat CHANGELOG.rst
# Return back to the main directory
cd ..

18
release-rules.js Normal file
View file

@ -0,0 +1,18 @@
// No release is triggered for the types commented out below.
// Commits using these types will be incorporated into the next release.
//
// NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
module.exports = [
{breaking: true, release: 'major'},
// {type: 'build', release: 'patch'},
// {type: 'chore', release: 'patch'},
// {type: 'ci', release: 'patch'},
{type: 'docs', release: 'patch'},
{type: 'feat', release: 'minor'},
{type: 'fix', release: 'patch'},
{type: 'perf', release: 'patch'},
{type: 'refactor', release: 'patch'},
{type: 'revert', release: 'patch'},
{type: 'style', release: 'patch'},
{type: 'test', release: 'patch'},
];

106
release.config.js Normal file
View file

@ -0,0 +1,106 @@
module.exports = {
branch: 'master',
plugins: [
['@semantic-release/commit-analyzer', {
preset: 'angular',
releaseRules: './release-rules.js',
}],
'@semantic-release/release-notes-generator',
['@semantic-release/changelog', {
changelogFile: 'CHANGELOG.md',
changelogTitle: '# Changelog',
}],
['@semantic-release/exec', {
prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}',
}],
['@semantic-release/git', {
assets: ['*.md', 'docs/*.rst', 'FORMULA'],
}],
'@semantic-release/github',
],
generateNotes: {
preset: 'angular',
writerOpts: {
// Required due to upstream bug preventing all types being displayed.
// Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
// Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
transform: (commit, context) => {
const issues = []
commit.notes.forEach(note => {
note.title = `BREAKING CHANGES`
})
// NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
if (commit.type === `feat`) {
commit.type = `Features`
} else if (commit.type === `fix`) {
commit.type = `Bug Fixes`
} else if (commit.type === `perf`) {
commit.type = `Performance Improvements`
} else if (commit.type === `revert`) {
commit.type = `Reverts`
} else if (commit.type === `docs`) {
commit.type = `Documentation`
} else if (commit.type === `style`) {
commit.type = `Styles`
} else if (commit.type === `refactor`) {
commit.type = `Code Refactoring`
} else if (commit.type === `test`) {
commit.type = `Tests`
} else if (commit.type === `build`) {
commit.type = `Build System`
// } else if (commit.type === `chore`) {
// commit.type = `Maintenance`
} else if (commit.type === `ci`) {
commit.type = `Continuous Integration`
} else {
return
}
if (commit.scope === `*`) {
commit.scope = ``
}
if (typeof commit.hash === `string`) {
commit.shortHash = commit.hash.substring(0, 7)
}
if (typeof commit.subject === `string`) {
let url = context.repository
? `${context.host}/${context.owner}/${context.repository}`
: context.repoUrl
if (url) {
url = `${url}/issues/`
// Issue URLs.
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
issues.push(issue)
return `[#${issue}](${url}${issue})`
})
}
if (context.host) {
// User URLs.
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
if (username.includes('/')) {
return `@${username}`
}
return `[@${username}](${context.host}/${username})`
})
}
}
// remove references that already appear in the subject
commit.references = commit.references.filter(reference => {
if (issues.indexOf(reference.issue) === -1) {
return true
}
return false
})
return commit
},
},
},
};

View file

@ -0,0 +1,50 @@
# InSpec Profile: `default`
This shows the implementation of the `default` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
## Verify a profile
InSpec ships with built-in features to verify a profile structure.
```bash
$ inspec check default
Summary
-------
Location: default
Profile: profile
Controls: 4
Timestamp: 2019-06-24T23:09:01+00:00
Valid: true
Errors
------
Warnings
--------
```
## Execute a profile
To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
```bash
$ inspec exec default
..
Finished in 0.0025 seconds (files took 0.12449 seconds to load)
8 examples, 0 failures
```
## Execute a specific control from a profile
To run one control from the profile use `inspec exec /path/to/profile --controls name`.
```bash
$ inspec exec default --controls package
.
Finished in 0.0025 seconds (files took 0.12449 seconds to load)
1 examples, 0 failures
```
See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).

View file

@ -0,0 +1,17 @@
# frozen_string_literal: true
# Override by OS
package_name = 'mariadb-server'
if (os[:name] == 'suse') || (os[:name] == 'opensuse')
package_name = 'mariadb'
elsif (os[:name] == 'debian') && os[:release].start_with?('8')
package_name = 'mysql-server'
end
control 'mysql package' do
title 'should be installed'
describe package(package_name) do
it { should be_installed }
end
end

View file

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
name: default
title: mysql formula
maintainer: SaltStack Formulas
license: Apache-2.0
summary: Verify that the mysql formula is setup and configured correctly
supports:
- platform-name: debian
- platform-name: ubuntu
- platform-name: centos
- platform-name: fedora
- platform-name: opensuse
- platform-name: suse
- platform-name: freebsd
- platform-name: amazon
- platform-name: arch

226
test/salt/pillar/mysql.sls Normal file
View file

@ -0,0 +1,226 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
mysql:
global:
client-server:
default_character_set: utf8
clients:
mysql:
default_character_set: utf8
mysqldump:
default_character_set: utf8
library:
client:
default_character_set: utf8
server:
# Use this account for database admin (defaults to root)
# root_user: 'admin'
# root_password: '' - to have root@localhost without password
root_password: 'somepass'
root_password_hash: '*13883BDDBE566ECECC0501CDE9B293303116521A'
user: mysql
# If you only manage the dbs and users and the server is on
# another host
# host: 123.123.123.123
# my.cnf sections changes
mysqld:
# you can use either underscore or hyphen in param names
bind-address: 0.0.0.0
log_bin: /var/log/mysql/mysql-bin.log
datadir: /var/lib/mysql
port: 3307
binlog_do_db: foo
auto_increment_increment: 5
binlog-ignore-db:
- mysql
- sys
- information_schema
- performance_schema
mysql:
# my.cnf param that not require value
no-auto-rehash: noarg_present
# salt_user:
# salt_user_name: 'salt'
# salt_user_password: 'someotherpass'
# grants:
# - 'all privileges'
# Manage config
config:
file: ~/.my.cnf
sections:
client:
port: 33306
socket: /var/lib/mysql-socket/mysql.sock
mysqld_safe:
plugin-dir: '~/mysql/plugins'
mysqld:
user: myself
port: 33306
datadir: ~/mysql/datadir
apparmor:
dir: /etc/apparmor.d/local
file: usr.sbin.mysqld
# Manage databases
database:
# Simple definition using default charset and collate
- foo
# Detailed definition
- name: bar
character_set: utf8
collate: utf8_general_ci
# Delete DB
- name: obsolete_db
present: false
schema:
foo:
load: false
bar:
load: false
baz:
load: true
source: salt://{{ tpldir }}/files/baz.schema.tmpl
template: jinja
qux:
load: true
source: salt://{{ tpldir }}/files/qux.schema.tmpl
template: jinja
context:
encabulator: Turbo
girdlespring: differential
quux:
load: true
source: salt://{{ tpldir }}/files/qux.schema.tmpl
template: jinja
context:
encabulator: Retro
girdlespring: integral
# Manage users
# you can get pillar for existing server using scripts/import_users.py script
user:
frank:
password: 'somepass'
host: localhost
databases:
- database: foo
grants: ['select', 'insert', 'update']
escape: true
- database: bar
grants: ['all privileges']
# bob:
# password_hash: '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4'
# host: '%' # Any host
# ssl: true
# ssl-X509: true
# ssl-SUBJECT: Subject
# ssl-ISSUER: Name
# ssl-CIPHER: Cipher
# databases:
# # https://github.com/saltstack/salt/issues/41178
# # If you want to refer to databases using wildcards, turn off escape so
# # the renderer does not escape them, enclose the string in '`' and
# # use two '%'
# - database: '`foo\_%%`'
# grants: ['all privileges']
# grant_option: true
# escape: false
# - database: bar
# table: foobar
# grants: ['select', 'insert', 'update', 'delete']
nopassuser:
password: ~
host: localhost
databases: []
application:
password: 'somepass'
mine_hosts:
target: "G@role:database and *.example.com"
function: "network.get_hostname"
expr_form: compound
databases:
- database: foo
grants: ['select', 'insert', 'update']
# Remove a user
obsoleteuser:
host: localhost
# defaults to true
present: false
# Override any names defined in map.jinja
# serverpkg: mysql-server
# clientpkg: mysql-client
# service: mysql
# pythonpkg: python-mysqldb
# devpkg: mysql-devel
# debconf_utils: debconf-utils
# Install MySQL headers
dev:
# Install dev package - defaults to false
install: false
macos:
products:
community_server:
enabled: true # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-8.0.11-macos10.13-x86_64.dmg
sum: 'md5=602a84390ecf3d82025b1d99fc594124'
workbench:
enabled: true # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-workbench-community-8.0.11-rc-macos-x86_64.dmg
sum: 'md5=37c5ae5bd75a4e1804ae6e0127d68611'
cluster:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-cluster-gpl-7.6.6-macos10.13-x86_64.dmg
sum: 'md5=0df975908e7d8e4e8c1003d95edf4721'
router:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-router-8.0.11-macos10.13-x86-64bit.dmg
sum: 'md5=8dd536f2f223933ecbfb8b19e54ee2f6'
utilities:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-utilities-1.6.5-macos10.12.dmg
sum: 'md5=4c8e75bb217b8293dcdeb915b649c2c8'
shell:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-shell-8.0.11-macos10.13-x86-64bit.dmg
sum: 'md5=43db4f0fc39f88c1d7be4a4f52cec363'
proxy:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-proxy-0.8.5-osx10.7-x86-32bit.tar.gz
sum: 'md5=107df22412aa8c483d2021e1af24ee22'
connector:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-connector-nodejs-8.0.11.tar.gz
sum: 'md5=dece7fe5607918ba68499ef07c31508d'
forvisualstudio:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-for-visualstudio-2.0.4-src.zip
sum: 'md5=fcf39316505ee2921e31a431eae77a9c'
forexcel:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-for-excel-1.3.6-src.zip
sum: 'md5=2cc8b65eb72a1b07a6e4e2665e2a29e3'
notifier:
enabled: false # default
# yamllint disable-line rule:line-length
url: https://downloads.mysql.com/archives/get/file/mysql-notifier-1.1.6-src.zip
sum: 'md5=349f1994681763fd6626a8ddf6be5363'