mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-17 10:10:30 +00:00
Merge c74f8bedca
into 61ee875479
This commit is contained in:
commit
a76d845206
2 changed files with 9 additions and 3 deletions
|
@ -60,7 +60,10 @@ include:
|
|||
|
||||
{{ state_id }}_load:
|
||||
cmd.run:
|
||||
- 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 %}$SALT_PASS {{ database }} < /etc/mysql/{{ database }}.schema
|
||||
- env:
|
||||
- SALT_PASS: "{{ mysql_salt_pass }}"
|
||||
- output_loglevel: quiet
|
||||
- onchanges:
|
||||
- file: {{ state_id }}_schema
|
||||
- mysql_database: {{ state_id }}
|
||||
|
|
|
@ -97,8 +97,11 @@ mysql_password_debconf:
|
|||
{%- elif os_family in ['RedHat', 'Suse', 'FreeBSD'] %}
|
||||
mysql_root_password:
|
||||
cmd.run:
|
||||
- name: mysqladmin --host "{{ mysql_host }}" --user {{ mysql_root_user }} password '{{ mysql_root_password|replace("'", "'\"'\"'") }}'
|
||||
- unless: mysql --host "{{ mysql_host }}" --user {{ mysql_root_user }} --password='{{ mysql_root_password|replace("'", "'\"'\"'") }}' --execute="SELECT 1;"
|
||||
- name: mysqladmin --host "{{ mysql_host }}" --user {{ mysql_root_user }} password $SALT_PASS
|
||||
- unless: mysql --host "{{ mysql_host }}" --user {{ mysql_root_user }} --password=$SALT_PASS --execute="SELECT 1;"
|
||||
- env:
|
||||
- SALT_PASS: "{{ mysql_root_password|replace("'", "'\"'\"'") }}"
|
||||
- output_loglevel: quiet
|
||||
- require:
|
||||
- service: mysqld-service-running
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue