.
This commit is contained in:
parent
9ac32539c8
commit
b62bb23790
@ -1,6 +1,6 @@
|
||||
import salt.exceptions
|
||||
|
||||
def root_password(name):
|
||||
def root_password(name, password):
|
||||
"""
|
||||
Set the mysql/mariadb root password
|
||||
|
||||
@ -8,18 +8,18 @@ def root_password(name):
|
||||
the password to user for root
|
||||
"""
|
||||
ret = {
|
||||
"name": "root password",
|
||||
"name": name,
|
||||
"changes": {},
|
||||
"result": False,
|
||||
"comment": ""
|
||||
}
|
||||
|
||||
if __salt__["mysql.check_credentials"]("root", name):
|
||||
if __salt__["mysql.check_credentials"]("root", password):
|
||||
ret["comment"]="Password is in correct state"
|
||||
ret["result"] = True
|
||||
return ret
|
||||
|
||||
result = __salt__["mysql.set_root_password"](name)
|
||||
result = __salt__["mysql.set_root_password"](password)
|
||||
if not result["result"]:
|
||||
ret["comment"] = result["err"]
|
||||
return ret
|
||||
|
@ -9,4 +9,5 @@ Start mariadb:
|
||||
|
||||
Check Root password:
|
||||
mysql.root_password:
|
||||
- name: {{ pillar['mariadb']['root_password'] }}
|
||||
- name: root
|
||||
- password: {{ pillar['mariadb']['root_password'] }}
|
||||
|
@ -6,3 +6,4 @@ base:
|
||||
- atftp
|
||||
- dnsmasq
|
||||
- nginx
|
||||
- mariadb
|
||||
|
@ -89,7 +89,7 @@ function check_prerequisites(){
|
||||
}
|
||||
|
||||
function do_salt_call(){
|
||||
local salt="sudo salt-call --local --file-root $SCRIPTDIR/salt/states --pillar-root $SCRIPTDIR/salt/pillars"
|
||||
local salt="sudo salt-call --local --file-root $SCRIPTDIR/salt/states --pillar-root $SCRIPTDIR/salt/pillars --module-dirs=$SCRIPTDIR/salt/modules"
|
||||
new_log "Running salt high state"
|
||||
if asktobreak;then
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user