Salt Mysql_user Management

Source: Internet
Author: User
Tags saltstack


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.