mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-17 10:10:30 +00:00
Added feature for setting up MySQL root password via the Salt debconf state instead of through the pkg state.
This commit is contained in:
parent
67c33d921c
commit
02081cccce
2 changed files with 13 additions and 4 deletions
|
@ -1,3 +0,0 @@
|
||||||
mysql-server-5.5 mysql-server/root_password_again password somepass
|
|
||||||
mysql-server-5.5 mysql-server/root_password password somepass
|
|
||||||
mysql-server-5.5 mysql-server/start_on_boot boolean true
|
|
|
@ -1,11 +1,23 @@
|
||||||
{% from "mysql/map.jinja" import mysql with context %}
|
{% from "mysql/map.jinja" import mysql with context %}
|
||||||
|
|
||||||
|
|
||||||
|
{% if grains['os'] in ['Ubuntu', 'Debian'] %}
|
||||||
|
mysql-debconf:
|
||||||
|
debconf.set:
|
||||||
|
- name: mysql-server
|
||||||
|
- data:
|
||||||
|
'mysql-server/root_password': {'type': 'password', 'value': '{{ salt['pillar.get']('mysql:server:root_password', 'somepass') }}'}
|
||||||
|
'mysql-server/root_password_again': {'type': 'password', 'value': '{{ salt['pillar.get']('mysql:server:root_password', 'somepass') }}'}
|
||||||
|
'mysql-server/start_on_boot': {'type': 'boolean', 'value': 'true'}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
mysqld:
|
mysqld:
|
||||||
pkg:
|
pkg:
|
||||||
- installed
|
- installed
|
||||||
- name: {{ mysql.server }}
|
- name: {{ mysql.server }}
|
||||||
{% if grains['os'] in ['Ubuntu', 'Debian'] %}
|
{% if grains['os'] in ['Ubuntu', 'Debian'] %}
|
||||||
- debconf: salt://mysql/files/mysql.deb.set
|
- require:
|
||||||
|
- debconf: mysql-debconf
|
||||||
{% endif %}
|
{% endif %}
|
||||||
service:
|
service:
|
||||||
- running
|
- running
|
||||||
|
|
Loading…
Add table
Reference in a new issue