mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-16 01:30:25 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
9bc73338f2
4 changed files with 82 additions and 30 deletions
5
Gemfile
5
Gemfile
|
@ -2,6 +2,11 @@
|
|||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
# Use the latest version of `inspec` prior to `4.23.4`, which introduces a
|
||||
# regression where the diff isn't displayed when comparing using `eq`.
|
||||
gem 'inspec', '~> 4.22.22'
|
||||
# Install the `kitchen-docker` gem from GitHub because the latest version
|
||||
# currently available (`2.10.0`) doesn't include a recent fix for Gentoo.
|
||||
gem 'kitchen-docker', github: 'test-kitchen/kitchen-docker', ref: '41e80fe'
|
||||
gem 'kitchen-inspec', '>= 2.2.1'
|
||||
gem 'kitchen-salt', '>= 0.6.3'
|
||||
|
|
39
Gemfile.lock
39
Gemfile.lock
|
@ -17,7 +17,7 @@ GEM
|
|||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
aws-eventstream (1.1.0)
|
||||
aws-partitions (1.383.0)
|
||||
aws-partitions (1.386.0)
|
||||
aws-sdk-apigateway (1.55.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
|
@ -36,7 +36,7 @@ GEM
|
|||
aws-sdk-cloudformation (1.44.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-cloudfront (1.44.0)
|
||||
aws-sdk-cloudfront (1.46.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-cloudhsm (1.27.0)
|
||||
|
@ -77,7 +77,7 @@ GEM
|
|||
aws-sdk-dynamodb (1.55.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-ec2 (1.200.0)
|
||||
aws-sdk-ec2 (1.202.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-ecr (1.39.0)
|
||||
|
@ -95,7 +95,7 @@ GEM
|
|||
aws-sdk-elasticache (1.44.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-elasticbeanstalk (1.38.0)
|
||||
aws-sdk-elasticbeanstalk (1.39.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-elasticloadbalancing (1.29.0)
|
||||
|
@ -159,7 +159,7 @@ GEM
|
|||
aws-sdk-sms (1.27.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-sns (1.33.0)
|
||||
aws-sdk-sns (1.34.0)
|
||||
aws-sdk-core (~> 3, >= 3.109.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-sqs (1.34.0)
|
||||
|
@ -209,13 +209,13 @@ GEM
|
|||
ed25519 (1.2.4)
|
||||
erubi (1.9.0)
|
||||
excon (0.78.0)
|
||||
faraday (1.0.1)
|
||||
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 (1.0.0)
|
||||
faraday (~> 1.0)
|
||||
faraday_middleware (0.12.2)
|
||||
faraday (>= 0.7.4, < 1.0)
|
||||
ffi (1.13.1)
|
||||
ffi-yajl (2.3.4)
|
||||
libyajl2 (~> 1.2)
|
||||
|
@ -247,20 +247,20 @@ GEM
|
|||
i18n (1.8.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
inifile (3.0.0)
|
||||
inspec (4.23.11)
|
||||
faraday_middleware (>= 0.12.2, < 1.1)
|
||||
inspec-core (= 4.23.11)
|
||||
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.23.11)
|
||||
inspec-core (4.22.22)
|
||||
addressable (~> 2.4)
|
||||
chef-telemetry (~> 1.0)
|
||||
faraday (>= 0.9.0, < 1.1)
|
||||
faraday (>= 0.9.0)
|
||||
hashie (~> 3.4)
|
||||
json_schemer (>= 0.2.1, < 0.2.12)
|
||||
license-acceptance (>= 0.2.13, < 3.0)
|
||||
license-acceptance (>= 0.2.13, < 2.0)
|
||||
method_source (>= 0.8, < 2.0)
|
||||
mixlib-log (~> 3.0)
|
||||
multipart-post (~> 2.0)
|
||||
|
@ -293,11 +293,11 @@ GEM
|
|||
hashie (>= 3.5)
|
||||
test-kitchen (>= 1.4)
|
||||
libyajl2 (1.2.0)
|
||||
license-acceptance (2.1.2)
|
||||
license-acceptance (1.0.19)
|
||||
pastel (~> 0.7)
|
||||
tomlrb (~> 1.2)
|
||||
tty-box (~> 0.6)
|
||||
tty-prompt (~> 0.20)
|
||||
tty-box (~> 0.3)
|
||||
tty-prompt (~> 0.18)
|
||||
little-plugger (1.1.4)
|
||||
logging (2.3.0)
|
||||
little-plugger (~> 1.1)
|
||||
|
@ -354,7 +354,7 @@ GEM
|
|||
rspec-mocks (~> 3.9.0)
|
||||
rspec-core (3.9.3)
|
||||
rspec-support (~> 3.9.3)
|
||||
rspec-expectations (3.9.2)
|
||||
rspec-expectations (3.9.3)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.9.0)
|
||||
rspec-its (1.3.0)
|
||||
|
@ -363,7 +363,7 @@ GEM
|
|||
rspec-mocks (3.9.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.9.0)
|
||||
rspec-support (3.9.3)
|
||||
rspec-support (3.9.4)
|
||||
rubyntlm (0.6.2)
|
||||
rubyzip (1.3.0)
|
||||
semverse (3.0.0)
|
||||
|
@ -521,6 +521,7 @@ PLATFORMS
|
|||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
inspec (~> 4.22.22)
|
||||
kitchen-docker!
|
||||
kitchen-inspec (>= 2.2.1)
|
||||
kitchen-salt (>= 0.6.3)
|
||||
|
|
|
@ -20,8 +20,6 @@ Debian:
|
|||
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
|
||||
|
|
|
@ -2,7 +2,7 @@ include:
|
|||
- .config
|
||||
- .python
|
||||
|
||||
{%- from tpldir ~ "/map.jinja" import mysql with context %}
|
||||
{% from tpldir ~ "/map.jinja" import mysql with context %}
|
||||
|
||||
{%- set os = salt['grains.get']('os', None) %}
|
||||
{%- set os_family = salt['grains.get']('os_family', None) %}
|
||||
|
@ -13,9 +13,44 @@ include:
|
|||
{%- set mysql_salt_password = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_password) %}
|
||||
{%- set mysql_datadir = salt['pillar.get']('mysql:server:mysqld:datadir', '/var/lib/mysql') %}
|
||||
{%- set mysql_unix_socket = salt['pillar.get']('mysql:server:unix_socket', '') %}
|
||||
|
||||
{%- set lsb_distrib_codename = salt['grains.get']('lsb_distrib_codename', None) %}
|
||||
{%- if mysql_root_password %}
|
||||
{%- if os_family == 'Debian' %}
|
||||
|
||||
{% if 'debconf_root_password' in mysql %}
|
||||
{% set debconf_root_password = mysql.debconf_root_password %}
|
||||
{% set debconf_root_password_again = mysql.debconf_root_password_again %}
|
||||
{% elif mysql.server.startswith('percona-server-server') %}
|
||||
{% if mysql.server < 'percona-server-server-5.7' %}{# 5.5 and 5.6 uses the same name... #}
|
||||
{% set debconf_root_password = 'percona-server-server/root_password' %}
|
||||
{% set debconf_root_password_again = 'percona-server-server/root_password_again' %}
|
||||
{% elif '5.7' in mysql.server %}{# 5.7 changed option name... #}
|
||||
{% set debconf_root_password = 'percona-server-server-5.7/root-pass' %}
|
||||
{% set debconf_root_password_again = 'percona-server-server-5.7/re-root-pass' %}
|
||||
{% else %}{# attempt to support future version? #}
|
||||
{% set debconf_root_password = mysql.server + '/root-pass' %}
|
||||
{% set debconf_root_password_again = mysql.server + '/re-root-pass' %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if salt['grains.get']('osmajorrelease')|int < 9 or not salt['grains.get']('os')|lower == 'debian' %}
|
||||
{% set debconf_root_password = 'mysql-server/root_password' %}
|
||||
{% set debconf_root_password_again = 'mysql-server/root_password_again' %}
|
||||
{% else %}
|
||||
{% set debconf_root_password = False %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if mysql.serverpkg == 'mysql-community-server' %}
|
||||
mysql-community-server_repo:
|
||||
pkgrepo.managed:
|
||||
- humanname: "Mysql official repo"
|
||||
- name: deb http://repo.mysql.com/apt/ubuntu/ {{ lsb_distrib_codename }} mysql-8.0
|
||||
- file: /etc/apt/sources.list.d/mysql.list
|
||||
- refresh: True
|
||||
- require_in:
|
||||
- pkg: mysql-community-server
|
||||
{% endif %}
|
||||
|
||||
mysql_debconf_utils:
|
||||
pkg.installed:
|
||||
- name: {{ mysql.debconf_utils }}
|
||||
|
@ -30,20 +65,33 @@ mysql_debconf:
|
|||
- require:
|
||||
- pkg: mysql_debconf_utils
|
||||
|
||||
{%- if 'osmajorrelease' in grains and salt['grains.get']('osmajorrelease')|int < 9 or not salt['grains.get']('os')|lower == 'debian' %}
|
||||
|
||||
{%- if debconf_root_password %}
|
||||
{% if mysql.serverpkg == 'mysql-community-server' %}
|
||||
mysql_password_debconf:
|
||||
debconf.set:
|
||||
- name: mysql-server
|
||||
- name: 'mysql-community-server'
|
||||
- data:
|
||||
'mysql-server/root_password': {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
'mysql-server/root_password_again': {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
'mysql-community-server/root-pass': {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
'mysql-community-server/re-root-pass': {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
'mysql-server/default-auth-override': {'type': 'string', 'value':'Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)'}
|
||||
- require_in:
|
||||
- pkg: {{ mysql.serverpkg }}
|
||||
- require:
|
||||
- pkg: mysql_debconf_utils
|
||||
{% else %}
|
||||
mysql_password_debconf:
|
||||
debconf.set:
|
||||
- name: mysql-server
|
||||
- data:
|
||||
{{debconf_root_password}}: {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
{{debconf_root_password_again}}: {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
- prereq:
|
||||
- pkg: {{ mysql.serverpkg }}
|
||||
- require:
|
||||
- pkg: mysql_debconf_utils
|
||||
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{%- elif os_family in ['RedHat', 'Suse', 'FreeBSD'] %}
|
||||
mysql_root_password:
|
||||
|
|
Loading…
Add table
Reference in a new issue