From 1c10d7f2cc8a4593a7b36a53a44d51444de4c100 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Sun, 16 Feb 2020 20:53:34 +0100 Subject: [PATCH 1/5] feat(map.jinja): load a configurable list of YAML files Lookup the configuration for `map.jinja` from: 1. builtin default `['osarch', 'os_family', 'os', 'osfinger', 'id']` 2. `defaults.yaml`: optional define a formula specific `map.jinja:sources` 3. global configuration lookup `map.jinja:sources` 4. formula specific `:map.jinja:sources` to find which configuration YAML files to load. The hard coded default is backward compatible and add the minion id at the end of the list. If an entry does not match a `salt['config.get']` parameter, it's used as a literal file path (with `.yaml` added if it's missing). Each YAML file are formatted with the following top level keys: - `values`: contains the the parameter values - `strategy` (optional): define the merge strategy for the function `salt.slsutils.merge` (aggregate, list, overwrite, recurse, smart). The default is `smart`. - `merge_lists` (optional): boolean to merge lists or overwrite them The parameters values are merged in the following order: 1. initialize default values from `defaults.yaml` 2. merge the values from the YAML file `/parameters//.yaml` in the order defined by `map.jinja:sources` 3. merge the values from `:lookup` 4. merge the values from `salt['config.get']()` --- mysql/map.jinja | 124 +++++++++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 43 deletions(-) diff --git a/mysql/map.jinja b/mysql/map.jinja index f4351ace..93f950bb 100644 --- a/mysql/map.jinja +++ b/mysql/map.jinja @@ -1,55 +1,93 @@ # -*- coding: utf-8 -*- # vim: ft=jinja -{#- Get the `tplroot` from `tpldir` #} -{%- 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={}) %} - +{# mysql-formula specific initialisation #} {%- 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']( - osfamilymap, - grain='os_family', - merge=salt['grains.filter_by']( - osmap, - grain='os', - merge=salt['grains.filter_by']( - osfingermap, - grain='osfinger', - merge=salt['grains.filter_by']( - _config, - default='lookup' - ) - ) - ) - ) - ) - ) -%} - -{%- set config = salt['grains.filter_by']( - {'defaults': defaults}, - default='defaults', - merge=_config - ) -%} +{#- Get the `tplroot` from `tpldir` #} +{%- set tplroot = tpldir.split('/')[0] %} + +{# Where to lookup parameters source files #} +{%- set map_sources_dir = tplroot | path_join('parameters') %} + +{#- Load defaults first to allow per formula default map.jinja configuration #} +{%- set _defaults_filename = map_sources_dir | path_join('defaults.yaml') %} +{%- do salt.log.debug('map.jinja: initialise parameters from ' ~ _defaults_filename ) %} +{%- import_yaml _defaults_filename as default_settings %} + +{# Reproduce previous behaviour #} +{%- set default_settings = salt.slsutil.merge(py_ver_settings[grains.pythonversion[0]], + default_settings) %} + +{# List of sources to lookup for parameters #} +{%- do salt.log.debug('map.jinja: lookup map.jinja configuration sources') %} +{# Fallback to previously used grains #} +{%- set map_sources = ['osarch', 'os_family', 'os', 'osfinger'] %} +{# Configure map.jinja from defaults.yaml #} +{# Do not use the `traverse` SaltStack jinja2 filter to support version 2017 #} +{%- set _defaults_map_jinja = default_settings.get('map.jinja', {}) %} +{%- set map_sources = _defaults_map_jinja.get('sources', map_sources) %} + +{# Lookup global sources #} +{%- set map_sources = salt['config.get']('map.jinja:sources', map_sources) %} +{# Lookup per formula sources #} +{%- set map_sources = salt['config.get'](tplroot ~ ':map.jinja:sources', map_sources) %} + +{%- do salt.log.debug('map.jinja: load parameters with sources from ' ~ map_sources) %} + +{# Work around assignment inside for loop #} +{# Do not clobber namespace with too much variables #} +{%- set _config = { 'stack': default_settings, 'formula': {} } %} + +{%- for map_source in map_sources %} + {# Lookup the grain/pillar/... #} + {# Fallback to use the source name as a direct filename #} + {%- set map_values = salt['config.get'](map_source, []) %} + + {# Mangle `map_source` to use it as literal path #} + {%- if map_values|length == 0 %} + {%- set map_source_parts = map_source.split('/') %} + {%- set map_source = map_source_parts[0:-1] | join('/') %} + {%- set map_values = map_source_parts[-1].rstrip('.yaml') %} + {%- endif %} + + {# Some configuration return list #} + {%- if map_values is string %} + {%- set map_values = [map_values] %} + {%- endif %} + + {%- for map_value in map_values %} + {%- set yamlfile = map_sources_dir | path_join(map_source, map_value ~ '.yaml') %} + {%- do salt.log.debug('map.jinja: load parameters from file ' ~ yamlfile) %} + {%- load_yaml as loaded_values %} + {%- include yamlfile ignore missing %} + {%- endload %} + + {%- if loaded_values %} + {# Merge loaded values on the stack #} + {%- do salt.log.debug('map.jinja: merge parameters from ' ~ yamlfile) %} + {%- do _config.update({'stack': salt.slsutil.merge(_config['stack'], + loaded_values.get('values', {}), + strategy=loaded_values.get('strategy', 'smart'), + merge_lists=loaded_values.get('merge_lists', False) | to_bool)}) + %} + {%- endif %} + {%- endfor %} +{%- endfor %} + +{#- Retrieve the config dict only once #} +{%- do _config.update({'formula': salt['config.get'](tplroot, default={})}) %} + +{# Merge the lookup dict at top level #} +{%- set config = salt.slsutil.merge(_config['stack'], _config['formula'].get('lookup', {})) %} +{# Merge the config dict #} +{%- set config = salt.slsutil.merge(config, _config['formula']) %} + +{%- do salt.log.debug('map.jinja: save parameters in variable "mysql"') %} {%- set mysql = config %} {#- Post-processing for specific non-YAML customisations #} From 282113f4b0d41dcd214af01ce8292b7969d6243c Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Sun, 16 Feb 2020 20:56:18 +0100 Subject: [PATCH 2/5] feat(map.jinja): `defaults.yaml` must be under `parameters/` * mysql/parameters/defaults.yaml: remove the top level key. --- mysql/defaults.yaml | 119 --------------------------------- mysql/parameters/defaults.yaml | 119 +++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 119 deletions(-) delete mode 100644 mysql/defaults.yaml create mode 100644 mysql/parameters/defaults.yaml diff --git a/mysql/defaults.yaml b/mysql/defaults.yaml deleted file mode 100644 index 83f556dc..00000000 --- a/mysql/defaults.yaml +++ /dev/null @@ -1,119 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=yaml ---- -mysql: - serverpkg: mysql-server - clientpkg: mysql-client - service: mysql - devpkg: mysql-devel - debconf_utils: debconf-utils - - config: - file: /etc/mysql/my.cnf - sections: - client: - port: 3306 - socket: /var/run/mysqld/mysqld.sock - mysqld_safe: {} - mysqld: - user: mysql - socket: /var/run/mysqld/mysqld.sock - port: 3306 - datadir: /var/lib/mysql - apparmor: - dir: /etc/apparmor.d/local - file: usr.sbin.mysqld - - macos: - userhomes: /Users - # `user` and `group` are set from `map.jinja` - # user: ~ - # group: ~ - dl: - tmpdir: /tmp/mysqltmp - prefix: /usr/local - opts: -s -L - interval: 60 - retries: 2 - products: - community_server: - 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 - sum: 'md5=602a84390ecf3d82025b1d99fc594124' - isapp: false - path: /usr/local/mysql - app: mysql - workbench: - 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 - sum: 'md5=37c5ae5bd75a4e1804ae6e0127d68611' - isapp: true - path: /Applications/MySQLWorkbench/Contents/Versions/latest - app: MySQLWorkbench - cluster: - 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 - sum: 'md5=0df975908e7d8e4e8c1003d95edf4721' - isapp: false - path: /usr/local/mysqlcluster - app: MySQLCluster - router: - 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 - sum: 'md5=8dd536f2f223933ecbfb8b19e54ee2f6' - isapp: false - app: MySQLRouter - utilities: - enabled: false - # 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' - isapp: true ## ?? - app: MySQLUtilties - shell: - 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 - sum: 'md5=43db4f0fc39f88c1d7be4a4f52cec363' - isapp: true ## ?? - app: MySQLShell - proxy: - 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 - sum: 'md5=107df22412aa8c483d2021e1af24ee22' - 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 - sum: 'md5=dece7fe5607918ba68499ef07c31508d' - forvisualstudio: - enabled: false - # 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 - # 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 - # yamllint disable-line rule:line-length - url: https://downloads.mysql.com/archives/get/file/mysql-notifier-1.1.6-src.zip - sum: 'md5=349f1994681763fd6626a8ddf6be5363' - - # The following dict names are reserved for pillar data (see pillar.example) - global: {} - clients: {} - library: {} - server: {} - salt_user: {} - database: {} - schema: {} - user: {} - dev: {} diff --git a/mysql/parameters/defaults.yaml b/mysql/parameters/defaults.yaml new file mode 100644 index 00000000..a6f991d2 --- /dev/null +++ b/mysql/parameters/defaults.yaml @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +serverpkg: mysql-server +clientpkg: mysql-client +service: mysql +devpkg: mysql-devel +debconf_utils: debconf-utils + +config: + file: /etc/mysql/my.cnf + sections: + client: + port: 3306 + socket: /var/run/mysqld/mysqld.sock + mysqld_safe: {} + mysqld: + user: mysql + socket: /var/run/mysqld/mysqld.sock + port: 3306 + datadir: /var/lib/mysql + apparmor: + dir: /etc/apparmor.d/local + file: usr.sbin.mysqld + +macos: + userhomes: /Users + # `user` and `group` are set from `map.jinja` + # user: ~ + # group: ~ + dl: + tmpdir: /tmp/mysqltmp + prefix: /usr/local + opts: -s -L + interval: 60 + retries: 2 + products: + community_server: + 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 + sum: 'md5=602a84390ecf3d82025b1d99fc594124' + isapp: false + path: /usr/local/mysql + app: mysql + workbench: + 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 + sum: 'md5=37c5ae5bd75a4e1804ae6e0127d68611' + isapp: true + path: /Applications/MySQLWorkbench/Contents/Versions/latest + app: MySQLWorkbench + cluster: + 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 + sum: 'md5=0df975908e7d8e4e8c1003d95edf4721' + isapp: false + path: /usr/local/mysqlcluster + app: MySQLCluster + router: + 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 + sum: 'md5=8dd536f2f223933ecbfb8b19e54ee2f6' + isapp: false + app: MySQLRouter + utilities: + enabled: false + # 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' + isapp: true ## ?? + app: MySQLUtilties + shell: + 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 + sum: 'md5=43db4f0fc39f88c1d7be4a4f52cec363' + isapp: true ## ?? + app: MySQLShell + proxy: + 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 + sum: 'md5=107df22412aa8c483d2021e1af24ee22' + 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 + sum: 'md5=dece7fe5607918ba68499ef07c31508d' + forvisualstudio: + enabled: false + # 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 + # 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 + # yamllint disable-line rule:line-length + url: https://downloads.mysql.com/archives/get/file/mysql-notifier-1.1.6-src.zip + sum: 'md5=349f1994681763fd6626a8ddf6be5363' + +# The following dict names are reserved for pillar data (see pillar.example) +global: {} +clients: {} +library: {} +server: {} +salt_user: {} +database: {} +schema: {} +user: {} +dev: {} +... From db370aa671ee0ec29b4ca35024e4b9856d08d58d Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Sun, 16 Feb 2020 20:58:08 +0100 Subject: [PATCH 3/5] feat(map.jinja): split `osfamilymap.yaml` under `parameters/os_family/` --- mysql/osfamilymap.yaml | 250 ------------------------ mysql/parameters/os_family/Arch.yaml | 68 +++++++ mysql/parameters/os_family/Debian.yaml | 57 ++++++ mysql/parameters/os_family/FreeBSD.yaml | 65 ++++++ mysql/parameters/os_family/Gentoo.yaml | 99 ++++++++++ mysql/parameters/os_family/RedHat.yaml | 38 ++++ mysql/parameters/os_family/Suse.yaml | 52 +++++ 7 files changed, 379 insertions(+), 250 deletions(-) delete mode 100644 mysql/osfamilymap.yaml create mode 100644 mysql/parameters/os_family/Arch.yaml create mode 100644 mysql/parameters/os_family/Debian.yaml create mode 100644 mysql/parameters/os_family/FreeBSD.yaml create mode 100644 mysql/parameters/os_family/Gentoo.yaml create mode 100644 mysql/parameters/os_family/RedHat.yaml create mode 100644 mysql/parameters/os_family/Suse.yaml diff --git a/mysql/osfamilymap.yaml b/mysql/osfamilymap.yaml deleted file mode 100644 index 7730afb3..00000000 --- a/mysql/osfamilymap.yaml +++ /dev/null @@ -1,250 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=yaml ---- -Debian: - devpkg: libmysqlclient-dev - - config: - sections: - mysqld_safe: - socket: /var/run/mysqld/mysqld.sock - nice: 0 - mysqld: - pid_file: /var/run/mysqld/mysqld.pid - basedir: /usr - tmpdir: /tmp - lc_messages_dir: /usr/share/mysql - skip_external_locking: noarg_present - bind_address: 127.0.0.1 - key_buffer_size: 16M - max_allowed_packet: 16M - thread_stack: 192K - thread_cache_size: 8 - query_cache_limit: 1M - query_cache_size: 16M - expire_logs_days: 10 - max_binlog_size: 100M - # innodb_flush_log_at_trx_commit: 1 - # innodb_lock_wait_timeout: 50 - # innodb_file_per_table: noarg_present - mysqldump: - quick: noarg_present - quote_names: noarg_present - max_allowed_packet: 16M - isamchk: - key_buffer_size: 16M - append: | - !includedir /etc/mysql/conf.d/ - -RedHat: - service: mysqld - clientpkg: mysql - pythonpkg: MySQL-python - config: - file: /etc/my.cnf - sections: - client: {} - mysqld_safe: - log_error: /var/log/mysql/mysqld.log - pid_file: /var/run/mysql/mysqld.pid - mysqld: - socket: /var/lib/mysql/mysql.sock - bind_address: 127.0.0.1 - symbolic_links: 0 - -Suse: - serverpkg: mariadb - clientpkg: mariadb-client - pythonpkg: python2-pymysql - - config: - file: /etc/my.cnf - sections: - client: - socket: /var/run/mysql/mysql.sock - mysqld: - # Empty values below to be resolved, disabling the rule in the meantime - # yamllint disable rule:empty-values - port: - user: - socket: - datadir: - tmpdir: - # yamllint enable rule:empty-values - innodb_file_format: Barracuda - innodb_file_per_table: 'ON' - server-id: 1 - sql_mode: NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES - mysqld_multi: - mysqld: /usr/bin/mysqld_safe - mysqladmin: /usr/bin/mysqladmin - log: /var/log/mysqld_multi.log - append: | - !includedir /etc/my.cnf.d - -Arch: - serverpkg: mariadb - clientpkg: mariadb-clients - service: mysqld - pythonpkg: mysql-python - # Empty value below to be resolved, disabling the rule in the meantime - # yamllint disable-line rule:empty-values - dev: - - config: - sections: - client: - socket: /run/mysqld/mysqld.sock - mysqld: - datadir: /var/lib/mysql - socket: /run/mysqld/mysqld.sock - symbolic_links: 0 - log-bin: mysql-bin - key_buffer_size: 16M - max_allowed_packet: 1M - table_open_cache: 64 - sort_buffer_size: 512K - net_buffer_length: 8K - read_buffer_size: 256K - read_rnd_buffer_size: 512K - myisam_sort_buffer_size: 8M - binlog_format: mixed - server-id: 1 - skip-external-locking: noarg_present - - mysqldump: - max_allowed_packet: 16M - quick: noarg_present - - mysql: - no-auto-rehash: noarg_present - - myisamchk: - key_buffer_size: 20M - sort_buffer_size: 20M - read_buffer: 2M - write_buffer: 2M - - mysqlhotcopy: - interactive-timeout: noarg_present - -Gentoo: - serverpkg: dev-db/mysql - clientpkg: dev-db/mysql - pythonpkg: dev-python/mysql-python - devpkg: dev-db/mysqlced - - config: - sections: - mysql: - character_sets_dir: /usr/share/mysql/charsets - default_character_set: utf8 - mysqladmin: - character_sets_dir: /usr/share/mysql/charsets - default_character_set: utf8 - mysqlcheck: - character_sets_dir: /usr/share/mysql/charsets - default_character_set: utf8 - mysqldump: - character_sets_dir: /usr/share/mysql/charsets - default_character_set: utf8 - quick: noarg_present - max_allowed_packet: 16M - mysqlimport: - character_sets_dir: /usr/share/mysql/charsets - default_character_set: utf8 - mysqlshow: - character_sets_dir: /usr/share/mysql/charsets - default_character_set: utf8 - myisamchk: - character_sets_dir: /usr/share/mysql/charsets - key_buffer: 20M ## ????? key_buffer_size ? - sort_buffer_size: 20M - read_buffer: 2M - write_buffer: 2M - myisampack: - character_sets_dir: /usr/share/mysql/charsets - mysqld_safe: - err_log: /var/log/mysql/mysql.err - mysqld: - character_set_serverpkg: utf8 - # note: the gentoo init.d script specifically needs pid-file - # (dash not underscore) - pid-file: /var/run/mysqld/mysqld.pid - log_error: /var/log/mysql/mysqld.err - basedir: /usr - datadir: /var/lib/mysql - skip_external_locking: noarg_present - key_buffer_size: 16M - max_allowed_packet: 1M - table_open_cache: 64 - sort_buffer_size: 512K - net_buffer_length: 8K - read_buffer_size: 256K - read_rnd_buffer_size: 512K - myisam_sort_buffer_size: 8M - language: /usr/share/mysql/english - bind_address: 127.0.0.1 - log_bin: noarg_present - server_id: 1 - tmpdir: /tmp - innodb_buffer_pool_size: 16M - innodb_additional_mem_pool_size: 2M - innodb_data_file_path: ibdata1:10M:autoextend:max:128M - innodb_log_file_size: 5M - innodb_log_buffer_size: 8M - innodb_log_files_in_group: 2 - innodb_flush_log_at_trx_commit: 1 - innodb_lock_wait_timeout: 50 - innodb_file_per_table: noarg_present - isamchk: - key_buffer: 20M ## ????? key_buffer_size ? - sort_buffer_size: 20M - read_buffer: 2M - write_buffer: 2M - mysqlhotcopy: - interactive_timeout: noarg_present - -FreeBSD: - serverpkg: mysql56-server - clientpkg: mysql56-client - service: mysql-server - pythonpkg: py27-pymysql - devpkg: mysql56-server - - config: - file: /usr/local/etc/my.cnf - sections: - client: - socket: /tmp/mysql.sock - mysqld: - # Empty values below to be resolved, disabling the rule in the meantime - # yamllint disable rule:empty-values - user: - datadir: - # yamllint enable rule:empty-values - socket: /tmp/mysql.sock - skip-external-locking: noarg_present - key_buffer_size: 16M - max_allowed_packet: 1M - table_open_cache: 64 - sort_buffer_size: 512K - net_buffer_length: 8K - read_buffer_size: 256K - read_rnd_buffer_size: 512K - myisam_sort_buffer_size: 8M - log-bin: mysql-bin - binlog_format: mixed - server-id: 1 - mysqldump: - quick: noarg_present - max_allowed_packet: 16M - mysql: - no-auto-rehash: noarg_present - myisamchk: - key_buffer_size: 20M - sort_buffer_size: 20M - read_buffer: 2M - write_buffer: 2M - mysqlhotcopy: - interactive-timeout: noarg_present diff --git a/mysql/parameters/os_family/Arch.yaml b/mysql/parameters/os_family/Arch.yaml new file mode 100644 index 00000000..4c61f649 --- /dev/null +++ b/mysql/parameters/os_family/Arch.yaml @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os_family') == Arch. +# You just need to add the key:values for this `os_family` that differ +# from `defaults.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os_family` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + serverpkg: mariadb + clientpkg: mariadb-clients + service: mysqld + pythonpkg: mysql-python + # Empty value below to be resolved, disabling the rule in the meantime + # yamllint disable-line rule:empty-values + dev: + + config: + sections: + client: + socket: /run/mysqld/mysqld.sock + mysqld: + datadir: /var/lib/mysql + socket: /run/mysqld/mysqld.sock + symbolic_links: 0 + log-bin: mysql-bin + key_buffer_size: 16M + max_allowed_packet: 1M + table_open_cache: 64 + sort_buffer_size: 512K + net_buffer_length: 8K + read_buffer_size: 256K + read_rnd_buffer_size: 512K + myisam_sort_buffer_size: 8M + binlog_format: mixed + server-id: 1 + skip-external-locking: noarg_present + + mysqldump: + max_allowed_packet: 16M + quick: noarg_present + + mysql: + no-auto-rehash: noarg_present + + myisamchk: + key_buffer_size: 20M + sort_buffer_size: 20M + read_buffer: 2M + write_buffer: 2M + + mysqlhotcopy: + interactive-timeout: noarg_present + +... diff --git a/mysql/parameters/os_family/Debian.yaml b/mysql/parameters/os_family/Debian.yaml new file mode 100644 index 00000000..5de75d93 --- /dev/null +++ b/mysql/parameters/os_family/Debian.yaml @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os_family') == Debian. +# You just need to add the key:values for this `os_family` that differ +# from `defaults.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os_family` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + devpkg: libmysqlclient-dev + + config: + sections: + mysqld_safe: + socket: /var/run/mysqld/mysqld.sock + nice: 0 + mysqld: + pid_file: /var/run/mysqld/mysqld.pid + basedir: /usr + tmpdir: /tmp + lc_messages_dir: /usr/share/mysql + skip_external_locking: noarg_present + bind_address: 127.0.0.1 + key_buffer_size: 16M + max_allowed_packet: 16M + thread_stack: 192K + thread_cache_size: 8 + query_cache_limit: 1M + query_cache_size: 16M + expire_logs_days: 10 + max_binlog_size: 100M + # innodb_flush_log_at_trx_commit: 1 + # innodb_lock_wait_timeout: 50 + # innodb_file_per_table: noarg_present + mysqldump: + quick: noarg_present + quote_names: noarg_present + max_allowed_packet: 16M + isamchk: + key_buffer_size: 16M + append: | + !includedir /etc/mysql/conf.d/ + +... diff --git a/mysql/parameters/os_family/FreeBSD.yaml b/mysql/parameters/os_family/FreeBSD.yaml new file mode 100644 index 00000000..13dd5d78 --- /dev/null +++ b/mysql/parameters/os_family/FreeBSD.yaml @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os_family') == FreeBSD. +# You just need to add the key:values for this `os_family` that differ +# from `defaults.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os_family` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + serverpkg: mysql56-server + clientpkg: mysql56-client + service: mysql-server + pythonpkg: py27-pymysql + devpkg: mysql56-server + + config: + file: /usr/local/etc/my.cnf + sections: + client: + socket: /tmp/mysql.sock + mysqld: + # Empty values below to be resolved, disabling the rule in the meantime + # yamllint disable rule:empty-values + user: + datadir: + # yamllint enable rule:empty-values + socket: /tmp/mysql.sock + skip-external-locking: noarg_present + key_buffer_size: 16M + max_allowed_packet: 1M + table_open_cache: 64 + sort_buffer_size: 512K + net_buffer_length: 8K + read_buffer_size: 256K + read_rnd_buffer_size: 512K + myisam_sort_buffer_size: 8M + log-bin: mysql-bin + binlog_format: mixed + server-id: 1 + mysqldump: + quick: noarg_present + max_allowed_packet: 16M + mysql: + no-auto-rehash: noarg_present + myisamchk: + key_buffer_size: 20M + sort_buffer_size: 20M + read_buffer: 2M + write_buffer: 2M + mysqlhotcopy: + interactive-timeout: noarg_present +... diff --git a/mysql/parameters/os_family/Gentoo.yaml b/mysql/parameters/os_family/Gentoo.yaml new file mode 100644 index 00000000..5c560659 --- /dev/null +++ b/mysql/parameters/os_family/Gentoo.yaml @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os_family') == Gentoo. +# You just need to add the key:values for this `os_family` that differ +# from `defaults.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os_family` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + serverpkg: dev-db/mysql + clientpkg: dev-db/mysql + pythonpkg: dev-python/mysql-python + devpkg: dev-db/mysqlced + + config: + sections: + mysql: + character_sets_dir: /usr/share/mysql/charsets + default_character_set: utf8 + mysqladmin: + character_sets_dir: /usr/share/mysql/charsets + default_character_set: utf8 + mysqlcheck: + character_sets_dir: /usr/share/mysql/charsets + default_character_set: utf8 + mysqldump: + character_sets_dir: /usr/share/mysql/charsets + default_character_set: utf8 + quick: noarg_present + max_allowed_packet: 16M + mysqlimport: + character_sets_dir: /usr/share/mysql/charsets + default_character_set: utf8 + mysqlshow: + character_sets_dir: /usr/share/mysql/charsets + default_character_set: utf8 + myisamchk: + character_sets_dir: /usr/share/mysql/charsets + key_buffer: 20M ## ????? key_buffer_size ? + sort_buffer_size: 20M + read_buffer: 2M + write_buffer: 2M + myisampack: + character_sets_dir: /usr/share/mysql/charsets + mysqld_safe: + err_log: /var/log/mysql/mysql.err + mysqld: + character_set_serverpkg: utf8 + # note: the gentoo init.d script specifically needs pid-file + # (dash not underscore) + pid-file: /var/run/mysqld/mysqld.pid + log_error: /var/log/mysql/mysqld.err + basedir: /usr + datadir: /var/lib/mysql + skip_external_locking: noarg_present + key_buffer_size: 16M + max_allowed_packet: 1M + table_open_cache: 64 + sort_buffer_size: 512K + net_buffer_length: 8K + read_buffer_size: 256K + read_rnd_buffer_size: 512K + myisam_sort_buffer_size: 8M + language: /usr/share/mysql/english + bind_address: 127.0.0.1 + log_bin: noarg_present + server_id: 1 + tmpdir: /tmp + innodb_buffer_pool_size: 16M + innodb_additional_mem_pool_size: 2M + innodb_data_file_path: ibdata1:10M:autoextend:max:128M + innodb_log_file_size: 5M + innodb_log_buffer_size: 8M + innodb_log_files_in_group: 2 + innodb_flush_log_at_trx_commit: 1 + innodb_lock_wait_timeout: 50 + innodb_file_per_table: noarg_present + isamchk: + key_buffer: 20M ## ????? key_buffer_size ? + sort_buffer_size: 20M + read_buffer: 2M + write_buffer: 2M + mysqlhotcopy: + interactive_timeout: noarg_present + +... diff --git a/mysql/parameters/os_family/RedHat.yaml b/mysql/parameters/os_family/RedHat.yaml new file mode 100644 index 00000000..934662af --- /dev/null +++ b/mysql/parameters/os_family/RedHat.yaml @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os_family') == RedHat. +# You just need to add the key:values for this `os_family` that differ +# from `defaults.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os_family` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + service: mysqld + clientpkg: mysql + pythonpkg: MySQL-python + config: + file: /etc/my.cnf + sections: + client: {} + mysqld_safe: + log_error: /var/log/mysql/mysqld.log + pid_file: /var/run/mysql/mysqld.pid + mysqld: + socket: /var/lib/mysql/mysql.sock + bind_address: 127.0.0.1 + symbolic_links: 0 + +... diff --git a/mysql/parameters/os_family/Suse.yaml b/mysql/parameters/os_family/Suse.yaml new file mode 100644 index 00000000..c404e0b2 --- /dev/null +++ b/mysql/parameters/os_family/Suse.yaml @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os_family') == Suse. +# You just need to add the key:values for this `os_family` that differ +# from `defaults.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os_family` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + serverpkg: mariadb + clientpkg: mariadb-client + pythonpkg: python2-pymysql + + config: + file: /etc/my.cnf + sections: + client: + socket: /var/run/mysql/mysql.sock + mysqld: + # Empty values below to be resolved, disabling the rule in the meantime + # yamllint disable rule:empty-values + port: + user: + socket: + datadir: + tmpdir: + # yamllint enable rule:empty-values + innodb_file_format: Barracuda + innodb_file_per_table: 'ON' + server-id: 1 + sql_mode: NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES + mysqld_multi: + mysqld: /usr/bin/mysqld_safe + mysqladmin: /usr/bin/mysqladmin + log: /var/log/mysqld_multi.log + append: | + !includedir /etc/my.cnf.d + +... From c2cad1ba485d0fe05b212a0190f880db02398ba4 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Sun, 16 Feb 2020 21:02:21 +0100 Subject: [PATCH 4/5] feat(map.jinja): split `osmap.yaml` under `parameters/os/` --- mysql/parameters/os/Amazon.yaml | 26 ++++++++++ mysql/parameters/os/CentOS.yaml | 33 ++++++++++++ mysql/parameters/os/Debian.yaml | 24 +++++++++ .../{osmap.yaml => parameters/os/Fedora.yaml} | 52 +++++++------------ mysql/parameters/os/Ubuntu.yaml | 32 ++++++++++++ 5 files changed, 135 insertions(+), 32 deletions(-) create mode 100644 mysql/parameters/os/Amazon.yaml create mode 100644 mysql/parameters/os/CentOS.yaml create mode 100644 mysql/parameters/os/Debian.yaml rename mysql/{osmap.yaml => parameters/os/Fedora.yaml} (60%) create mode 100644 mysql/parameters/os/Ubuntu.yaml diff --git a/mysql/parameters/os/Amazon.yaml b/mysql/parameters/os/Amazon.yaml new file mode 100644 index 00000000..542ffc8e --- /dev/null +++ b/mysql/parameters/os/Amazon.yaml @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os') == Amazon. +# You just need to add the key:values for this `os` that differ +# from `defaults.yaml` + `.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + clientpkg: mysql + service: mysqld + pythonpkg: MySQL-python +... diff --git a/mysql/parameters/os/CentOS.yaml b/mysql/parameters/os/CentOS.yaml new file mode 100644 index 00000000..c917fb57 --- /dev/null +++ b/mysql/parameters/os/CentOS.yaml @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os') == CentOS. +# You just need to add the key:values for this `os` that differ +# from `defaults.yaml` + `.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + config_directory: /etc/my.cnf.d/ + server_config: + file: server.cnf + sections: + mysqld_safe: + log_error: /var/log/mysql/mysqld.log + pid_file: /var/run/mysql/mysqld.pid + mysqld: + socket: /var/lib/mysql/mysql.sock + bind_address: 127.0.0.1 +... diff --git a/mysql/parameters/os/Debian.yaml b/mysql/parameters/os/Debian.yaml new file mode 100644 index 00000000..adb3b180 --- /dev/null +++ b/mysql/parameters/os/Debian.yaml @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os') == Debian. +# You just need to add the key:values for this `os` that differ +# from `defaults.yaml` + `.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + service: mysql +... diff --git a/mysql/osmap.yaml b/mysql/parameters/os/Fedora.yaml similarity index 60% rename from mysql/osmap.yaml rename to mysql/parameters/os/Fedora.yaml index c2cf746d..c964684a 100644 --- a/mysql/osmap.yaml +++ b/mysql/parameters/os/Fedora.yaml @@ -1,33 +1,25 @@ # -*- coding: utf-8 -*- # vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os') == Fedora. +# You just need to add the key:values for this `os` that differ +# from `defaults.yaml` + `.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' --- -Debian: - service: mysql - -Ubuntu: - service: mysql - devpkg: libmysqlclient-dev - config: - sections: - mysqld: - tmpdir: /tmp - log_error: /var/log/mysql/error.log - append: | - !includedir /etc/mysql/conf.d/ - -CentOS: - config_directory: /etc/my.cnf.d/ - server_config: - file: server.cnf - sections: - mysqld_safe: - log_error: /var/log/mysql/mysqld.log - pid_file: /var/run/mysql/mysqld.pid - mysqld: - socket: /var/lib/mysql/mysql.sock - bind_address: 127.0.0.1 - -Fedora: +values: serverpkg: mariadb-server clientpkg: mariadb service: mariadb @@ -66,8 +58,4 @@ Fedora: wsrep_causal_reads: 0 wsrep_sst_method: rsync wsrep_sst_auth: "root:" - -Amazon: - clientpkg: mysql - service: mysqld - pythonpkg: MySQL-python +... diff --git a/mysql/parameters/os/Ubuntu.yaml b/mysql/parameters/os/Ubuntu.yaml new file mode 100644 index 00000000..79d29a94 --- /dev/null +++ b/mysql/parameters/os/Ubuntu.yaml @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('os') == Ubuntu. +# You just need to add the key:values for this `os` that differ +# from `defaults.yaml` + `.yaml` + `.yaml`. +# +# If you do not need to provide defaults via the `os` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + service: mysql + devpkg: libmysqlclient-dev + config: + sections: + mysqld: + tmpdir: /tmp + log_error: /var/log/mysql/error.log + append: | + !includedir /etc/mysql/conf.d/ +... From 2458f1c0268ae01da85226bd1ab2a0c3606603c3 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Sun, 16 Feb 2020 21:06:04 +0100 Subject: [PATCH 5/5] feat(map.jinja): split `osfingermap.yaml` under `parameters/osfinger/` --- mysql/osfingermap.yaml | 67 ------------------- mysql/parameters/osfinger/CentOS Linux-7.yaml | 38 +++++++++++ mysql/parameters/osfinger/Debian-10.yaml | 31 +++++++++ mysql/parameters/osfinger/Debian-9.yaml | 31 +++++++++ mysql/parameters/osfinger/Leap-42.yaml | 24 +++++++ mysql/parameters/osfinger/Redhat-7.yaml | 33 +++++++++ mysql/parameters/osfinger/Ubuntu-16.04.yaml | 26 +++++++ mysql/parameters/osfinger/Ubuntu-18.04.yaml | 26 +++++++ 8 files changed, 209 insertions(+), 67 deletions(-) delete mode 100644 mysql/osfingermap.yaml create mode 100644 mysql/parameters/osfinger/CentOS Linux-7.yaml create mode 100644 mysql/parameters/osfinger/Debian-10.yaml create mode 100644 mysql/parameters/osfinger/Debian-9.yaml create mode 100644 mysql/parameters/osfinger/Leap-42.yaml create mode 100644 mysql/parameters/osfinger/Redhat-7.yaml create mode 100644 mysql/parameters/osfinger/Ubuntu-16.04.yaml create mode 100644 mysql/parameters/osfinger/Ubuntu-18.04.yaml diff --git a/mysql/osfingermap.yaml b/mysql/osfingermap.yaml deleted file mode 100644 index 7797a8b3..00000000 --- a/mysql/osfingermap.yaml +++ /dev/null @@ -1,67 +0,0 @@ -# -*- 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-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 diff --git a/mysql/parameters/osfinger/CentOS Linux-7.yaml b/mysql/parameters/osfinger/CentOS Linux-7.yaml new file mode 100644 index 00000000..11e4392f --- /dev/null +++ b/mysql/parameters/osfinger/CentOS Linux-7.yaml @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('osfinger') == CentOS Linux-7. +# You just need to add the key:values for this `osfinger` that differ +# from `defaults.yaml`. +# +# If you do not need to provide defaults via the `osfinger` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + # 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 +... diff --git a/mysql/parameters/osfinger/Debian-10.yaml b/mysql/parameters/osfinger/Debian-10.yaml new file mode 100644 index 00000000..836d733d --- /dev/null +++ b/mysql/parameters/osfinger/Debian-10.yaml @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('osfinger') == Debian-10. +# You just need to add the key:values for this `osfinger` that differ +# from `defaults.yaml`. +# +# If you do not need to provide defaults via the `osfinger` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + serverpkg: mariadb-server + service: mariadb + clientpkg: mariadb-client + devpkg: libmariadbclient-dev + config: + append: | + !includedir /etc/mysql/conf.d/ + # !includedir /etc/mysql/mariadb.conf.d/ +... diff --git a/mysql/parameters/osfinger/Debian-9.yaml b/mysql/parameters/osfinger/Debian-9.yaml new file mode 100644 index 00000000..dd986d24 --- /dev/null +++ b/mysql/parameters/osfinger/Debian-9.yaml @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('osfinger') == Debian-9. +# You just need to add the key:values for this `osfinger` that differ +# from `defaults.yaml`. +# +# If you do not need to provide defaults via the `osfinger` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + serverpkg: mariadb-server + service: mariadb + clientpkg: mariadb-client + devpkg: libmariadbclient-dev + config: + append: | + !includedir /etc/mysql/conf.d/ + # !includedir /etc/mysql/mariadb.conf.d/ +... diff --git a/mysql/parameters/osfinger/Leap-42.yaml b/mysql/parameters/osfinger/Leap-42.yaml new file mode 100644 index 00000000..52250328 --- /dev/null +++ b/mysql/parameters/osfinger/Leap-42.yaml @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('osfinger') == Leap-42. +# You just need to add the key:values for this `osfinger` that differ +# from `defaults.yaml`. +# +# If you do not need to provide defaults via the `osfinger` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + pythonpkg: python-PyMySQL +... diff --git a/mysql/parameters/osfinger/Redhat-7.yaml b/mysql/parameters/osfinger/Redhat-7.yaml new file mode 100644 index 00000000..eebe6069 --- /dev/null +++ b/mysql/parameters/osfinger/Redhat-7.yaml @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('osfinger') == Redhat-7. +# You just need to add the key:values for this `osfinger` that differ +# from `defaults.yaml`. +# +# If you do not need to provide defaults via the `osfinger` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + # 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 +... diff --git a/mysql/parameters/osfinger/Ubuntu-16.04.yaml b/mysql/parameters/osfinger/Ubuntu-16.04.yaml new file mode 100644 index 00000000..aed6b038 --- /dev/null +++ b/mysql/parameters/osfinger/Ubuntu-16.04.yaml @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('osfinger') == Ubuntu-16.04. +# You just need to add the key:values for this `osfinger` that differ +# from `defaults.yaml`. +# +# If you do not need to provide defaults via the `osfinger` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + serverpkg: mariadb-server + # service: mariadb + clientpkg: mariadb-client +... diff --git a/mysql/parameters/osfinger/Ubuntu-18.04.yaml b/mysql/parameters/osfinger/Ubuntu-18.04.yaml new file mode 100644 index 00000000..1aeac85b --- /dev/null +++ b/mysql/parameters/osfinger/Ubuntu-18.04.yaml @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +# +# Setup variables specific to salt['config.get']('osfinger') == Ubuntu-18.04. +# You just need to add the key:values for this `osfinger` that differ +# from `defaults.yaml`. +# +# If you do not need to provide defaults via the `osfinger` config, +# you can remove this file or provide at least an empty dict, e.g. +# values: {} +# +# This file will be merged with `salt.slsutil.merge`: +# +# You can select the merging strategy by defining the `strategy` dict +# with one of: `aggregate`, `list`, `overwrite`, `recurse`, `smart`, e.g. +# strategy: 'recurse' +# +# If you use the `recurse` or `overwrite` strategy, you can aggregate +# the lists by defining the `merge_lists` dict with a boolean, e.g. +# merge_lists: 'true' +--- +values: + serverpkg: mariadb-server + # service: mariadb + clientpkg: mariadb-client +...