mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-16 01:30:25 +00:00
debian: debconf root password, support for percona
Default values available for percona-server-server.
This commit is contained in:
parent
afae4c54b7
commit
bb17c3c512
2 changed files with 27 additions and 6 deletions
|
@ -9,8 +9,9 @@ Ubuntu:
|
|||
service: mysql
|
||||
python: python-mysqldb
|
||||
debconf_utils: debconf-utils
|
||||
debconf_root_password: mysql-server/root_password
|
||||
debconf_root_password_again: mysql-server/root_password_again
|
||||
## Having some auto-detect for some different pkg if not explicitly set
|
||||
#debconf_root_password: mysql-server/root_password
|
||||
#debconf_root_password_again: mysql-server/root_password_again
|
||||
dev: libmysqlclient-dev
|
||||
config:
|
||||
file: /etc/mysql/my.cnf
|
||||
|
@ -63,8 +64,9 @@ Debian:
|
|||
client: {{ mysql_engine }}-client
|
||||
python: python-mysqldb
|
||||
debconf_utils: debconf-utils
|
||||
debconf_root_password: mysql-server/root_password
|
||||
debconf_root_password_again: mysql-server/root_password_again
|
||||
## Having some auto-detect for some different pkg if not explicitly set
|
||||
#debconf_root_password: mysql-server/root_password
|
||||
#debconf_root_password_again: mysql-server/root_password_again
|
||||
dev: lib{{ mysql_engine }}client-dev
|
||||
config:
|
||||
file: /etc/mysql/my.cnf
|
||||
|
|
|
@ -16,6 +16,25 @@ include:
|
|||
|
||||
{% 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 %}
|
||||
{% set debconf_root_password = 'mysql-server/root_password' %}
|
||||
{% set debconf_root_password_again = 'mysql-server/root_password_again' %}
|
||||
{% endif %}
|
||||
|
||||
mysql_debconf_utils:
|
||||
pkg.installed:
|
||||
- name: {{ mysql.debconf_utils }}
|
||||
|
@ -35,8 +54,8 @@ mysql_password_debconf:
|
|||
debconf.set:
|
||||
- name: mysql-server
|
||||
- data:
|
||||
{{mysql.debconf_root_password}}: {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
{{mysql.debconf_root_password_again}}: {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
{{debconf_root_password}}: {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
{{debconf_root_password_again}}: {'type': 'password', 'value': '{{ mysql_root_password }}'}
|
||||
- require_in:
|
||||
- pkg: {{ mysql.server }}
|
||||
- require:
|
||||
|
|
Loading…
Add table
Reference in a new issue