Because I want to reach what people say.
MySQL Account Management We manage through Saltstack's Mysql_user
All current MySQL account users are managed via git and password via salt pillar
The official website example, now basically clear, the English real dish, actually very simple, copy on the line. Oh.
Https://docs.saltstack.com/en/latest/ref/states/all/salt.states.mysql_user.html#salt.states.mysql_user.absent
Password is managed by Salt pillar
Refer to creating users in bulk by saltstack, changing passwords
openssl passwd -1 #cat /srv/salt/user/useradd.sls{% set user = ' mall ' %}{% set home = '/mall ' %}{{ user }}: user.present: - password: ' $1$mall$hoay4fci9xy6sl.ny97y91 ' - uid: 895 - gid_from_name: true - home: {{ home }} - createhome: true - shell: /bin/bash - maxdays: 90cp_skel: cmd.run: - name: ' Cp /etc/skel/.bash* {{ home }} && chown -r {{ user }}. {{ user }} {{ home }} ' - unless: test -f { { home }} /.bashrc#salt ' * ' state.sls user.useradd bulk password modification [[EMAIL PROTECTED]&Nbsp;user]# cat /srv/pillar/user.sls users: root: $1$/sijcbhz$ laqpyrt7.47phjo7azqsy. mall: $1$ucv5p06w$rp2fdf/qoonroc.y8tqn00 [[email protected] user]# cat passwd.sls {% for user, passwd in Pillar.get (' Users ', {}). Items () %}{{user}}: user.present: - password: {{passwd}}{% endfor %} sync password #salt ' * ' state.sls user.passwd
This article from "Want to have a dream, in case the realization of" blog, declined reprint!
Salt Mysql_user Management