ansible-collections/community.mysql

mysql_user password expiration support

resuni opened this issue · 5 comments

SUMMARY

Being able to manage user password expiration using the mysql_user module would be handy.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME
  • mysql_user
ADDITIONAL INFORMATION

Parameters would correspond with the PASSWORD EXPIRE syntax of the CREATE USER and ALTER USER commands. I envision two new parameters being created to support this:

  • password_expire - Accepted values: DEFAULT, NEVER, INTERVAL
  • password_expire_interval - Used to specify interval in days, if password_expire is set to INTERVAL.
# Create/alter user with password that expires every 90 days
- name: create user
  mysql_user:
    name: resuni
    host: "127.0.0.1"
    password: pass123
    password_expire: INTERVAL
    password_expire_interval: 90

# Create/alter user with password that doesn't expire
- name: create user
  mysql_user:
    name: resuni
    host: "127.0.0.1"
    password: pass123
    password_expire: NEVER

# Create/alter user to use default password expiration policy as defined in mysqld.cnf
- name: create user
  mysql_user:
    name: resuni
    host: "127.0.0.1"
    password: pass123
    password_expire: DEFAULT

For the record:

mariadb >= 10.4.3
mysql >= 10.6.6

no idea if this must be still covered.

@resuni do you have some time to implement that parameter?

@markuman Not in the near future. I might have some time later this year if no one else gets to it before then.

@resuni hi, thanks for the feature request!
I've put the help_wanted label